COBOL Alphabetic Data type

COBOL Numeric Data Type COBOL Alphanumeric Data Type

Advertisements


Alphabetic data type name is self explanatory which will allow storing a combination of A to Z characters.

If any data item declared as ALPHABETIC, then it will store the data which included A-Z characters that are used in the program.

Numeric data type uses A to declare the Alphabetic data item.

The max length of Alphabetic data type is 256.

Alphabetic data type declaration will not come with a combination of any other data types.

DISPLAY USAGE clause is applicable for Alphabetic data type.


Below example to display the constant value with two variable of smaller length and larger length than actual constant length


Practicle Example:


Code:


 IDENTIFICATION DIVISION.                                         
 PROGRAM-ID. ALPHAJUS.                                            
 DATA DIVISION.                                                   
 WORKING-STORAGE SECTION.                                         
 01 ALPHA-J1              PIC A(10).                              
 01 ALPHA-J2              PIC A(20).                              
 PROCEDURE DIVISION.                                              
     MOVE 'MAINFRAMESTECHHELP' TO ALPHA-J1                        
                                  ALPHA-J2.                       
     DISPLAY '                    ***ALPHABETIC DISPLAY***'       
     DISPLAY 'ALPHA-J1    : 'ALPHA-J1.                            
     DISPLAY 'ALPHA-J2    : 'ALPHA-J2.                            
     STOP RUN.                                                    
           

COBOL Numeric Data Type COBOL Alphanumeric Data Type

Advertisements