Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Delimited by size

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Mon Jun 15, 2009 11:38 am    Post subject: Delimited by size
Reply with quote

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
View user's profile Send private message

itjagadesh

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Mon Jun 15, 2009 12:09 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1224
Location: Israel

PostPosted: Mon Jun 15, 2009 6:58 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts Increase the screen size after split mistah kurtz TSO/ISPF 2 Fri Sep 02, 2016 6:39 pm
No new posts Creating a pipe delimited file from C... dmanwi COBOL Programming 1 Sat Mar 19, 2016 10:40 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us