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
I need help with a COBOL programming assingment. I have started the program but I need help completing the program. I have 5 errors. Here is the question. 10. Suppose your company

PROGRAM FOR ELECTRICITY BILL: An electricity company supplies electricity to 4 types of customers coded 1, 2, 3 & 4.The rate schedule for customers is shown in one table as

B (Blank Insertion) : The occurrence of a B anyplace in the picture will insert a space character in the edited data. There can be more than one B in the picture. Examples:

Example of constructing an arithmetic expression: An arithmetic expression may be proceeded by a + or - sign. These operations are known as unary + or unary - operators. Il

DELETE STATEMENT : The file should be opened in the I-O mode. If the access is SEQUENTIAL, the INVALID KEY phrase must be specified. Rather than, the last input-output state

There are some restrictions when these procedures are used. (i) The Procedure should not contain any SORT/MERGE statement. (ii) An explicit transfer of the control outside

Currency Sign - edit characters for numeric data: $ (Currency Sign): The single currency sign can appear at the leftmost place of a picture. In that situation the $ cha

OPEN STATEMENT: Whenever a READ or a WRITE operation is executed on a file, then it should be open. The opening of a file may be completed with the help of the OPEN verb. With

Valid and Invalid Word - Cobol words: Valid Word             Invalid Word & Reason emp-sal                  -pay   ( it starts with a hyphen)  TOTAL MARK (blank space em

Display control verbs in Cobol