Comparison of nonnumeric operands - relational condition, COBOL Programming

Comparison of Nonnumeric Operands:

A nonnumeric operand can be compared to the other nonnumeric operand according to the rules as shown below:

(i) Fields of Equal Sizes:

The Characters in the equivalent positions are compared to determine the value of the relational condition. The Comparison begins with the leftmost character in both the fields and proceeds in a left to right side manner. If the 2 characters being compared are found to be unequal at any stage, the field containing the biggest characters is considered to be greater. When the characters are only found to be identical does the comparison proceed to the later position on the right.  The 2 fields are taken to be equal only when all these pairs of characters have been found to be similar and the rightmost end has been reached.

(ii) Fields of Unequal Sizes:

If the two operands are not of equivalent size, the shorter field is considered to be extended on the right by spaces to make its size equivalent to the longer field and the rules for comparing fields of equal sizes are used. 

 

Posted Date: 10/17/2012 1:35:47 AM | Location : United States







Related Discussions:- Comparison of nonnumeric operands - relational condition, Assignment Help, Ask Question on Comparison of nonnumeric operands - relational condition, Get Answer, Expert's Help, Comparison of nonnumeric operands - relational condition Discussions

Write discussion on Comparison of nonnumeric operands - relational condition
Your posts are moderated
Related Questions
PROGRAMS FOR REDEFINES CLAUSE: We have to write a simple program to explain the REDEFINES clause at 01 level. identification division. program- id. Redef. environment

Numeric -   Literals : The numeric literal can be created with the help of digits only. It can have a sign (+ or -) and can also have a decimal point. If no sign is specifi

MULTIPLY VERB:   The Multiply Verb causes one or more multiplicands to be multiplied by the multiplier and to store the products. The form of the MULTIPLY verb is as shown be

RENAMES CLAUSE: At times re-grouping of an elementary data items in a record may be essential so that they can belong to the original as well as to the latest group. This is o

PERFORM WITH UNTIL OPTION: The format is as shown below: Illustration:  A) Perform p-3 until i > 5. Here p-3 will be executed whenever i B)  Perform p-2 thru

FILE DESCRIPTION- FIXED-LENGTH RECORDS: The normal characteristics of a file are explained in the file description (FD) entry of the DATA DIVISION.

LABEL RECORD CLAUSE: This clause specifies whether or not the standard header and trailer labels must be present in the magnetic-tape files. VALUE OF CLAUSE: The VAL

Illustration of perform statement: PERFORM    CALCUALTE-TAX. In this illustration, the CALCULATE-TAX is either a section name or paragraph name. Assume that it is a section

WRITE STATEMENT: The WRITE Statement verb releases a record in an output file. The syntax for the WRITE statement can be unlike depending on the output device and the medium us

Example of Move corresponding: Consider the DATA DIVISION entries shown below. Suppose it is needed that the data stored in the 4 fields of the PAY_REC should be