IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Usage of Stem var in REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ravikanth

New User


Joined: 12 Jan 2006
Posts: 29

PostPosted: Sat Mar 04, 2006 4:23 pm
Reply with quote

Hi,

After reading into a stem variable. How can we copy the entire stem variable to another stem variable. i.e for example if we execute
"EXECIO * DISKR INJCL (STEM INJCL. FINIS)"
"FREE F(INJCL)"
and i want to copy Variable INJCL to JCLLINE, is it sufficient if we use the base alone as shown below.
JCLLINE. = INJCL.
Also if we want to pass the stem variable to a called program how could we do this?

Thanks in advance,
Ravi
Back to top
View user's profile Send private message
antonrino.b

New User


Joined: 10 Jan 2006
Posts: 76
Location: Germany

PostPosted: Sat Mar 04, 2006 5:23 pm
Reply with quote

Hi ravikanth,

Quote:
is it sufficient if we use the base alone as shown below.


I think that should be sufficient.

Regards,
Antu
Back to top
View user's profile Send private message
brgr88

New User


Joined: 05 Mar 2006
Posts: 6

PostPosted: Sun Mar 05, 2006 5:08 am
Reply with quote

Ravi,

Example1:
DO i = 1 TO injcl.0
jclline.i = injcl.i
END i
jclline.0 = injcl.0


Example2:
"EXECIO * DISKR INJCL (STEM jclline. FINIS)"


Example3:
"EXECIO * DISKR INJCL (STEM injcl. FINIS)"
"EXECIO * DISKR INJCL (STEM jclline. FINIS)"


In Example1, whenever you read a file with EXECIO into a stemvar, your 'stemvarname.0' variable will contain the number of lines read. Then use a DO loop to copy each stem one by one.

In Example2, you could just use a different stemvarname in the EXECIO parameters, unless you wanted two seperate stems to work from.

In Example3, if you need two seperate stems to work from, use a seperate EXECIO for each stemvarname that you want.

In an EXECIO statement, the stemvarname doesn't have to be the same as the DD name of the dataset.
Back to top
View user's profile Send private message
brgr88

New User


Joined: 05 Mar 2006
Posts: 6

PostPosted: Sun Mar 05, 2006 5:13 am
Reply with quote

Ravi, I forgot to mention... you cannot copy stems by using the base only:
JCLLINE. = INJCL.

will set it up so that any "JCLLINE.x" variable defaults to the text string "INJCL."

If you would like to test this out:
/* rexx */
injcl.1 = "line1" ; injcl.2 = "line2" ; injcl.3 = "line3"
jclline. = injcl.
say jclline.1 jclline.2 jclline.3

The output would be the following text string:
INJCL. INJCL. INJCL.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts REXX/CMS How to place command console... CLIST & REXX 4
No new posts Help needed in automation cics transa... CLIST & REXX 1
No new posts Reroute print output via REXX/SDSF TSO/ISPF 6
No new posts Get RECORD LENGTH, allocated space of... CLIST & REXX 7
No new posts SDSF and Rexx TSO/ISPF 4
Search our Forums:

Back to Top