COBOL–Working storage variables

Working Storage section comes under DATA division. Different datatypes of COBOL are explained here.

Below sample cobol program declares and Displays a working storage variable named ‘MY-STRING’.

       IDENTIFICATION DIVISION.                        
       PROGRAM-ID.    KARTEST3.                        
      * define and use a working storage variable      
       ENVIRONMENT DIVISION.                           
       DATA DIVISION.                                  
       WORKING-STORAGE SECTION.                        
        01 MY-STRING  PIC X(20) VALUE 'HELLO WORLD ! '.
       PROCEDURE DIVISION.                             
           DISPLAY MY-STRING.                          

Output of this program will be


Related Posts

blog comments powered by Disqus

There's 0 Comment So Far

Share your thoughts, leave a comment!