Passing output to job using rexx
Posted: Fri Dec 20, 2013 11:53 am
I am using rexx in job and the rexx is producing one filename qualifier. I want to use this file name qualifier furher in job to produce new filename in subsequent steps. I am able to genearte the filename qualifier in rexx but don't know how to pass this output back to job so that job can use this file name qualifier furher in job to produce new filename in subsequent steps.Please advise. Below are job step and called rexx:-
Job step:-
REXX:-
I want to use f1 value in job to produce new filename. Please let me know how to achieve this.
Job step:-
//PS015 EXEC PGM=IKJEFT01,PARM='CDESTRFN &FNM1'
//SYSEXEC DD DSN=THI.REXX.LIB,DISP=SHR
//SYSTSPRT DD SYSOUT=&SOUTA
//SYSTSIN DD DUMMY
//SYSEXEC DD DSN=THI.REXX.LIB,DISP=SHR
//SYSTSPRT DD SYSOUT=&SOUTA
//SYSTSIN DD DUMMY
REXX:-
arg infile
call ENC_Infile_Strip
call say_messages
exit rc
ENC_Infile_Strip:
x=outtrap(on.)
x=outtrap(rec1.)
Address "TSO"
"LISTC ENT('"infile"')"
if rc ¬= 0 then exit rc
x=outtrap(off)
do x = 1 to rec1.0
if pos("NONVSAM",rec1.x) > 0
then do
f1 = substr(rec1.x,36,15)
end
end
return
say_messages:
say " "
say " Filename string passed to job: "f1
say " "
return
call ENC_Infile_Strip
call say_messages
exit rc
ENC_Infile_Strip:
x=outtrap(on.)
x=outtrap(rec1.)
Address "TSO"
"LISTC ENT('"infile"')"
if rc ¬= 0 then exit rc
x=outtrap(off)
do x = 1 to rec1.0
if pos("NONVSAM",rec1.x) > 0
then do
f1 = substr(rec1.x,36,15)
end
end
return
say_messages:
say " "
say " Filename string passed to job: "f1
say " "
return
I want to use f1 value in job to produce new filename. Please let me know how to achieve this.