View previous topic :: View next topic
|
Author |
Message |
itjagadesh
New User
Joined: 05 Dec 2006 Posts: 89 Location: chennai
|
|
|
|
Could you please any one tell me what will happen if we use the folowing piece of code in COBOL
String IN-DESC delimited by space into OUT-DESC.
Input :
IN-DESC pic X(40).
Output :
OUT-DESC pic X(30). |
|
Back to top |
|
|
itjagadesh
New User
Joined: 05 Dec 2006 Posts: 89 Location: chennai
|
|
|
|
Sorry Small correction in the code, just want to know what will happen if we use the following code in COBOL,
String IN-DESC delimited by space,
WS-NUM delimited by size,
WS-name delimited by size into OUT-DESC.
INput :
IN-DESC PIC X(10)
WS-NUM PIC X(05)
WS-NAME PIC X(10)
Output:
OUT-DESC PIC X(50) |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
This is the kind of question that you should answer by yourself.
Write a small program with 4 lines in the DATA DIVISION:
Code: |
01 IN-DESC PIC X(10).
01 WS-NUM PIC X(05).
01 WS-NAME PIC X(10).
01 OUT-DESC PIC X(25). |
and 5 sentences in PROCEDURE DIVISION:
Code: |
MOVE 'DESC ONE' TO IN-DESC
MOVE '1234' TO WS-NUM
MOVE 'NAME TWO' TO WS-NAME
String IN-DESC delimited by space,
WS-NUM delimited by size,
WS-name delimited by size into OUT-DESC
DISPLAY 'OUT-DESC =<' OUT-DESC '>' |
Duplicate this block of lines a few times and try different values for the 3 input fields.
Compile, run and get your answer.
Don't rely on us, rely on yourself! |
|
Back to top |
|
|
|