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
Rules for Simple sort verb: The work file is to be defined by a sort elaboration entry (SD entry).The format of SD entry is as shown below. The rules below should be taken

Major difference between file and array how does record read from array and file why we are not preparing array for real time

What is the difference between subscript and index

CONDITIONS-NAME CONDITION:   The condition name is an entity which itself is a condition and these can have either a true or false value. Though, a condition name cannot be d

BLANK WHEN ZERO: BLANK WHEN ZERO is an editing clause that may be used along with a picture. This will set the whole data item to blanks of its value is equal to zero. Though,

Rules for constructing an Arithmetic Expression: The rules for constructing an arithmetic expression are as shown below: (i) When an arithmetic expression specifies a calcu

PROGRAM FOR RENAMES CLAUSE: identification division. program- id. environment division. data division. working-storage section. 01 emp.      02 empdet.

Example of condition names: The illustration below is of the use of the condition names  77  MARITAL-STATUS     PIC    9   88  SINGLE    VALUE    IS     ZERO   88  MA

RULES FOR INDEXED TABLES: The rules of indexing a table with an INDEXED phrase are as shown below: (1) If indexing is completed for any one level of a table, then indexing

READ STATEMENTS: The common format for the read statements is as shown bellow. Format 1: READ file-name RECORD [ INTO   identifier ] [  ;  AT   END     imperative-s