Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Some simple REXX - Print a VSAM file then check a column (on ZOS) 1

Status
Not open for further replies.

oucheeeeee

Technical User
Jul 8, 2008
9
Hi,

I'm trying to write a rexx routine (and I've never used REXX before)to simply check col 105 in a one line VSAM file. If col 105 contains a 'P' then end with RC = (say) 01

If col 105 contains 'T' then end return code = 02

This needs to run in JCL so I'm using IKJEFT01

I'd be gratefull if anyone could either a) provide some simple code or b) give me a pointer as to which command(s) I should be using.

Many thanks,

Rob
 

There is no native VSAM support in REXX (obviously on TSO/MVS). There is RXVSAM, but the learning curve can be pretty steep, especially for someone new to both REXX and RXVSAM.

Your easiest solution is to REPRO the VSAM file to a sequential file and use EXECIO. Alternatively, you can PRINT a specific key or key-range and parse the SYSPRINT.


Frank Clarke
--Is it time for another Boston Tea Party?
 
Hi,

Unfortunately, I hadn't noticed the lack of support for VSAM files at the time I wrote the initial question. I did find that out around 30 minutes later - I have repro'd the file to a flat file.

How would I read that file and set a return code dependannt on the value in col 105.

I can do this with my eyes closed in SAS. Unfortunately, the client doesn't have a licence for SAS.

Many thx,

Rob
 
Code:
parse var record . 105 data 106 .
if Pos( data,"AEIOUY" ) > 0 then rc = 3
                            else rc = 0 
exit rc
The only problem may be that some IKJ.. routines mask the RC from REXX/CLIST substituting their own. You'll have to experiment.

Frank Clarke
--Is it time for another Boston Tea Party?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top