Skip to Content
Custom Search

STRING DELIMITED BY LITERAL

 

STRING DELIMITED BY LITERAL
 
The following COBOL program depicts the use of 
STRING DELIMITED BY LITERAL  
 
 
       IDENTIFICATION DIVISION.
       PROGRAM-ID. PGM038.
       AUTHOR. MAINFRAMEWIZARD.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 WS-TITLE      PIC X(3)  VALUE SPACES.
       01 WS-FIRST-NAME PIC X(20) VALUE SPACES.
       01 WS-LAST-NAME  PIC X(20) VALUE SPACES.
       01 WS-FULL-NAME  PIC X(43) VALUE SPACES.
       PROCEDURE DIVISION.
       10000-MAIN-PARA.
             MOVE 'MR.'             TO WS-TITLE
             MOVE 'MAINFRAMEWIZARD' TO WS-FIRST-NAME
             MOVE '.COM'            TO WS-LAST-NAME
             STRING WS-TITLE     DELIMITED BY '.'
                    WS-FIRST-NAME DELIMITED BY ' '
                    WS-LAST-NAME  DELIMITED BY '.'
                    INTO WS-FULL-NAME
             DISPLAY 'RESULTANT STRING IS  = '
               WS-FULL-NAME
             STOP RUN.
 
 
 
The output of the program is 
 
RESULTANT STRING IS  = MRMAINFRAMEWIZARD                                                                                 
 
 
 
 
 

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 28 guests online.
Dr. Radut | page