Skip to Content
Custom Search

DIFFERENCE BETWEEN STRING and MOVE

 

DIFFERENCE BETWEEN STRING and MOVE
 
The following COBOL program depicts the use of 
difference between STRING and MOVE command
 
 
       IDENTIFICATION DIVISION.
       PROGRAM-ID. PGM041.
       AUTHOR. MAINFRAMEWIZARD.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 WS-STRING1    PIC X(19) VALUE 'MAINFRAMEWIZARD.COM'.
       01 WS-STRING2    PIC X(19) VALUE 'MAINFRAMEWIZARD.COM'.
       PROCEDURE DIVISION.
       10000-MAIN-PARA.
             MOVE  'COBOLLANG' TO WS-STRING1
             DISPLAY 'RESULT OF MOVE STATEMENT:-' WS-STRING1
             STRING 'COBOLLANG' DELIMITED BY SIZE
                    INTO  WS-STRING2
             DISPLAY 'RESULT OF STRING STATEMENT:-' WS-STRING2
             STOP RUN.
 
 
Output of the above program is
 
 
RESULT OF MOVE STATEMENT:-COBOLLANG                                                                                      
RESULT OF STRING STATEMENT:-COBOLLANGWIZARD.COM                                                                          
  

Comments

Post new comment

  • Allowed HTML tags: <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

Click the +1 button  below to share it with your friends and colleagues

 

Share this if you liked it!

 

Disclaimer



Who's online

There are currently 0 users and 27 guests online.
Dr. Radut | page