View previous topic :: View next topic
|
Author |
Message |
ravikanth
New User
Joined: 12 Jan 2006 Posts: 29
|
|
|
|
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 |
|
|
antonrino.b
New User
Joined: 10 Jan 2006 Posts: 76 Location: Germany
|
|
|
|
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 |
|
|
brgr88
New User
Joined: 05 Mar 2006 Posts: 6
|
|
|
|
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 |
|
|
brgr88
New User
Joined: 05 Mar 2006 Posts: 6
|
|
|
|
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 |
|
|
|