Class condition - cobol programming, COBOL Programming

CLASS CONDITION:

 The class condition establishes whether or not the value of the operand is numeric or alphabetic. The operand is numeric if it contains only the digits 0 to 9 with or without the operational sign. An operand is alphabetic if it holds only the letters A to Z & space. The format of the class condition is as shown below:

The rules shown below apply in the situation of the class condition.

(i) The usage of the identifier should be DISPLAY or some forms of the DISPLAY.

(ii) For the NUMERIC option the identifier should be either numeric or alphanumeric.When the data item is defined with the operational sign then the appearance of the sign is considered as normal.

(iii) For the alphabetic option, the identifier should be either alphabetic or alphanumeric.

(iv) The identifier might be a group item. Though, for the NUMERIC option, the group item should not consists elementary items explained with an operational sign.

The class condition is very helpful for the validation of the input data. In COBOL, the data is read in the record region in similar form as recorded on the external medium regardless of the specified class of the individual fields in the record. For illustration, if we are reading the value of the numeric field from a card and the corresponding position in the card contains non-numeric characters, then the system will not detect it to be an error. Rather than, the nonnumeric characters will be stored in the character positions of the numeric field. This error may even pass ignored as during any subsequent numeric operation (like numeric MOVE or arithmetic operation), only the numeric portion of the characters in the field be used. And hence, the possible punching mistake in the data card can go and detected unless the proper care is taken. One may avoid a few of these blunders through the use of the class condition. 

Posted Date: 10/17/2012 1:40:48 AM | Location : United States







Related Discussions:- Class condition - cobol programming, Assignment Help, Ask Question on Class condition - cobol programming, Get Answer, Expert's Help, Class condition - cobol programming Discussions

Write discussion on Class condition - cobol programming
Your posts are moderated
Related Questions
/ (Slash Insertion): The edit character slash (/) also termed as virgule or stroke, may appear anyplace in the picture. When used, it will be inserted. More than one slash can

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

CONDITION - COBOL Programming: The condition is an entity which at one point of time can have only one of the two values - true or false. As we already know that, the IF verb

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

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

How do I move a single QUOTE to a field or set the value clause? "''" does not work?

Second form of Divide verb: The second form of this verb is as shown below: In this situation the identifier-1 or numeric- literal-1 will be divided by identifier-2 or

Program for Sequential File Creation & Rewriting  We have to write a program to create a Length file with just two fields: l (Length) and l-c (Length-Code). Add a few records.

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

Example of Accept statement: For illustration, ACCEPT FLAG-A can be specified to read the value of the FLAG_A from the console. It may be keep in mind that no file definition