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
Example of Level numbers - cobol programming: To explain the hierarchical structure introduced above, the concept of the level number is employed in COBOL. The most broad

When using the accept verb in cobol is it possible to assign something other then "SYSIN" for a ddname?

Example of add verb: (a) ADD A TO B. This illustration represents that the value of A will be added to the value of B and the result will be stored in B.  The alignment of

COMPOUND CONDITION: The two simple conditions can be connected by the logical operators AND or OR to form a compound condition (also termed as combined condition). When two co

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

PROGRAM FOR SCREEN SECTION:  identification division.   program- id.   environment division.   data division.   working-storage section.   01  a pic 9(2) value

CR and DB (Credit and Debit Sign): The two characters that is CR or DB symbol may appear only at the rightmost place of the picture. They are similar to the minus sign edit ch

READ STATEMENT: The aim of this verb is to make available the next logical record from the input file. It is important to note the meaning of the "next" logical record in the

Display control verbs in Cobol

Buffers: The Modern computers are able of handling I-O operations independent of the CPU by means of the hardware termed as data channel. For illustration, if two buffers a