Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1243
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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts Sort Card to Remove Duplicate records... raj4neo SYNCSORT 2 Wed Jan 25, 2017 4:44 am
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 6 Sun Nov 06, 2016 8:11 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us