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

Concept of a two-dimensional table, Concept of a two-dimensional table: ...

Concept of a two-dimensional table: Concept of a two-dimensional table can be easily extended to tables having three or more dimensions. The Handling of tables up to three dim

Indexed tables, INDEXED TABLES: The OCCURS clause that is used to defi...

INDEXED TABLES: The OCCURS clause that is used to define tables can optionally have an INDEXED phrase. This phrase involves the names of data items which are to be used as sub

Blank insertion and zero insertion, B (Blank Insertion) : The occurren...

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:

Write statement - relative files, WRITE Statement:      The WRITE stat...

WRITE Statement:      The WRITE statement for a relative file has the format which is as shown below.          WRITE  record-name   [ FORM   identifier ]

Program for screen section, PROGRAM FOR SCREEN SECTION:  identificatio...

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

Occurs - indexed by program, OCCURS - INDEXED BY PROGRAM: identificati...

OCCURS - INDEXED BY PROGRAM: identification division. program- id. searching. environment division. data division. working-storage section. 01 table1.      0

Plus sign - edit characters for numeric data, Plus Sign - edit characters f...

Plus Sign - edit characters for numeric data: + (Plus Sign) : A plus sign is alike to minus sign except that when the item is positive, +sign will be inserted rather th

Program., calculate simple interest

calculate simple interest

File-control - input-output section, FILE-CONTROL: The FILE-CONTROL pa...

FILE-CONTROL: The FILE-CONTROL paragraph names each and every file and identifies the first medium through file control entries. The basic format of a file control entry is gi

Rules for indexed tables, RULES FOR INDEXED TABLES: The rules of index...

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

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