Class condition - cobol programming, COBOL Programming

Assignment Help:

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. 


Related Discussions:- Class condition - cobol programming

Character set - cobol programming, Character Set: To study any languag...

Character Set: To study any language, first one should know the alphabets of the language and they are termed as character set in general. There are 50 different characters in

Declarative and file status clause, DECLARATIVE and FILE STATUS Clause: ...

DECLARATIVE and FILE STATUS Clause: The input-output exception condition in the situation of a direct access files can be handled by a declarative procedure in a manner simila

Procedure division statements for the indexed files, PROCEDURE DIVISION sta...

PROCEDURE DIVISION statements for the indexed files: All the statements which are available for a relative file are also available for an indexed file. READ STTATEMENT :

Cobol program, Write a COBOL IF sentence to use the values of numeric var...

Write a COBOL IF sentence to use the values of numeric variables EXAM and COURSEWORK , both assumed to be with format PIC 999 and in the range 0 to 100 and to move the value:

Program for add corresponding, PROGRAM FOR ADD CORRESPONDING: We have ...

PROGRAM FOR ADD CORRESPONDING: We have to write a simple program to demonstrate Add Corresponding.   identification division.   program- id.   environment division.

Write statement, WRITE STATEMENT: The WRITE Statement verb releases a r...

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

Illustration of multiply verb, Illustration of Multiply verb: (a)  MUL...

Illustration of Multiply verb: (a)  MULTIPLY A BY B. In this situation the value of A & B will be multiplied and the product will be stored in B.  The decimal point locatio

Redefines clause , REDEFINES CLAUSE: At times it may be found that two...

REDEFINES CLAUSE: At times it may be found that two or more storage regions defined in the DATA DIVISION are not in use concurrently. In such situations only one storage regio

Sign - picture clause, Sign - Picture clause: The numeric data item ca...

Sign - Picture clause: The numeric data item can be signed or unsigned. If a numeric data is regarded as unsigned then during the execution these unsigned data items are treat

File-control entries for the sequential files, FILE-CONTROL ENTRIES FOR THE...

FILE-CONTROL ENTRIES FOR THE SEQUENTIAL FILES: The characteristics of each and every files handled in a program are specified in the ENVIRONMENT DIVISION and DATA DIVISION.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd