MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Record layouts of REXX input files

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
John Corbin
Beginner


Joined: 23 Jan 2004
Posts: 38
Topics: 21

PostPosted: Mon May 01, 2006 9:55 am    Post subject: Record layouts of REXX input files Reply with quote

HI..

I know in REXX that I have done my input files are structured so that a record has its individual parts separated by a ','.

Thus in your REXX you can code something like this:

DO K = 1 to RECCOUNT
PARSE VAR KF1240IN.K,
GSTACNT.K','DCMTLOCNBR.K','AMOUNT.K
etc
etc

What happens when there are no commas separating the record elements ?

I do have access to the record layout via DCLGENs but am not sure how to use this info in REXX
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Mon May 01, 2006 10:06 am    Post subject: Reply with quote

You can use the SUBSTR function to pull-out specific fields.

GSTACNT.K = SUBSTR(KF1240IN.K,1,10)
DCMTLOCNBR.K = SUBSTR(KF1240IN.K,30,70)
AMOUNT.K = SUBSTR(KF1240IN.K,100,30)

You can PARSE using spaces as the field delimiter, or any other character as the field delimiter.

PARSE VAR KF1240IN.K,
GSTACNT.K DCMTLOCNBR.K AMOUNT.K
PARSE VAR KF1240IN.K,
GSTACNT.K';'DCMTLOCNBR.K';'AMOUNT.K

You can PARSE using specific column locations

PARSE VAR KF1240IN.K,
1 GSTACNT.K 30 DCMTLOCNBR.K 100 AMOUNT.K

PARSE VAR 1 KF1240IN.K,
1 GSTACNT.K +30 DCMTLOCNBR.K +70 AMOUNT.K
Back to top
View user's profile Send private message
John Corbin
Beginner


Joined: 23 Jan 2004
Posts: 38
Topics: 21

PostPosted: Mon May 01, 2006 10:16 am    Post subject: Reply with quote

I should have thought of that.. thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group