Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Pass Parms from REXX to the JOB

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 85
Location: Bangalore

PostPosted: Mon Feb 05, 2007 10:49 am    Post subject: Pass Parms from REXX to the JOB
Reply with quote

HI all,
Intially I execute a rexx exec and get the list of datsets ( say 10).

Now for each dataset I have to submit a job with the parms corresponding that dataset. ( so I have to submit the job 10 times with 10 different parms).

I wanted to know as how can we submit a job through REXX and pass the parameters to the JOB
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Mon Feb 05, 2007 11:58 am    Post subject:
Reply with quote

Job are written in JCL, which is a CONTROL language, and as such it wasn't designed to accept parameters in the "normal" way.

Why can't you invoke the jobs directly from within your REXX?

O.
Back to top
View user's profile Send private message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 85
Location: Bangalore

PostPosted: Mon Feb 05, 2007 12:03 pm    Post subject:
Reply with quote

Hi Ofer
I know that...

The problem with me is I want to invoke the Job from within the rexx but each time I invoke the Job I want to pass a different parameter to it...

How do I do that
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Mon Feb 05, 2007 2:14 pm    Post subject:
Reply with quote

You can generate the JCL lines within your REXX, then simply SUBMIT them....

O.
Back to top
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 85
Location: Stockholm, Sweden

PostPosted: Mon Feb 05, 2007 3:02 pm    Post subject: Re: Pass Parms from REXX to the JOB
Reply with quote

There are two ways to do this, this exec demonstrates...
Code:

/*REXX*/                                                               
/* build your JCL                                                    */
job.1 = "//SE16661G JOB (DUMMY),'IEBGENER',MSGCLASS=H,CLASS=A "       
job.2 = "//S010     EXEC PGM=IEBGENER "                               
job.3 = "//SYSPRINT DD SYSOUT=* "                                     
job.4 = "//SYSUT1   DD * "                                             
job.5 = "Hello World "                                                 
job.6 = "//SYSUT2   DD SYSOUT=* "                                     
job.7 = "//SYSIN    DD DUMMY "                                         
job.8 = "// "                                                         
job.0 = 8                                                             
                                                                       
/* EITHER - if you DON'T want to trap jobnames/jesnumbers            */
"ALLOC DD(SYSJOB) SYSOUT(A) WRITER(INTRDR) REUSE"                     
"EXECIO" job.0 "DISKW SYSJOB (STEM job. FINIS"                         
                                                                       
/* OR - if you DO want to trap jobnames/jesnumbers                   */
CALL MSG "OFF"                                                         
"DELETE TEMP.JOB"                                                     
"ALLOC DD(SYSJOB) DS(TEMP.JOB) NEW REUSE",                             
                  "UNIT(VIO) LRECL(80) RECFM(F B) SPACE(1)TRACKS"     
"EXECIO" job.0 "DISKW SYSJOB (STEM job. FINIS"                         
CALL MSG "ON"; CALL OUTTRAP "O."                                       
"SUBMIT TEMP.JOB"                                                     
CALL MSG "OFF"; CALL OUTTRAP "OFF"                                     
DO i = 1 TO o.0                                                       
   PARSE VAR o.i WITH . "JOB" jobname.i"("jesnum.i")" .               
END                                                                   
DO i = 1 TO o.0                                                       
   SAY "IKJ56250I JOB"jobname.i"("jesnum.i") SUBMITTED "
END                                                     
"DELETE TEMP.JOB"                                       
Back to top
View user's profile Send private message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 85
Location: Bangalore

PostPosted: Mon Feb 05, 2007 4:06 pm    Post subject:
Reply with quote

Hi Steve Coalbran
Thanks a lot for immediate reply

I just wanted to confirm as can I give the parms in the exec...

I want to submit this JCL say 10 times and every tie I need to change the parm..
Back to top
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 85
Location: Stockholm, Sweden

PostPosted: Mon Feb 05, 2007 8:37 pm    Post subject: Re: Pass Parms from REXX to the JOB
Reply with quote

What parameters do you want to generate?
You can do just about anything in a REXX exec you know! icon_biggrin.gif

Here's some unlikely but feasible things one could do. Change the 'build your JCL' block to read this, run it..
Code:

/* build your JCL                                                    */
tmpds  = MVSVAR('SYMDEF','JOBNAME'),                                   
     ||".J"MVSVAR('SYMDEF','LYR4')MVSVAR('SYMDEF','LJDAY'),           
     ||".T"MVSVAR('SYMDEF','LHHMMSS'),                                 
     ||".S"SUBSTR(TIME("L"),10)                                       
parms  = SYSVAR("SYSNODE")","SYSVAR("SYSTERMID")                       
job.1  = "//SE16661G JOB (DUMMY),'IEBGENER',MSGCLASS=H,CLASS=A "       
job.2  = "//         SET MD='(MOD,DELETE),SPACE=(TRK,0)' "             
job.3  = "//         SET NC='(,CATLG,DELETE),SPACE=(TRK,(5,5))' "     
job.4  = "//         SET FB80='LRECL=80,RECFM=FB' "                   
job.5  = "//CLEANUP  EXEC PGM=IEFBR14 "                               
job.6  = "//DELTEMP  DD DISP=&MD,DSN="tmpds                           
job.7  = "//SPLATTT  EXEC PGM=IKJEFT1A,"                               
job.8  = "//         PARM=('SPLATTT "parms"') "                       
job.9  = "//SYSEXEC  DD DISP=SHR,DSN=&SYSUID..USER.EXEC"               
job.10 = "//SYSTSPRT DD SYSOUT=* "                                     
job.11 = "//SYSTSIN  DD DUMMY "                                       
job.12 = "//SYSUT2   DD DISP=&NC,DSN="tmpds","                         
job.13 = "//            &FB80 "                                       
job.14 = "// "                                                         
job.0  = 14                                                           

generating this job...
(the SPLATT exec just writes the parm to SYSUT2 and SAYs it)
Code:

SDSF OUTPUT DISPLAY SE16661G JOB09648  DSID     2 LINE 19      COLUMNS 02- 81 
COMMAND INPUT ===>                                            SCROLL ===> CSR 
        0.00 MINUTES EXECUTION TIME                                           
       1 //SE16661G JOB (DUMMY),'IEBGENER',MSGCLASS=H,CLASS=A                 
       2 //         SET MD='(MOD,DELETE),SPACE=(TRK,0)'                       
       3 //         SET NC='(,CATLG,DELETE),SPACE=(TRK,(5,5))'                 
       4 //         SET FB80='LRECL=80,RECFM=FB'                               
       5 //CLEANUP  EXEC PGM=IEFBR14                                           
       6 //DELTEMP  DD DISP=&MD,DSN=SE16661.J2007036.T160027.S576039           
         IEFC653I SUBSTITUTION JCL - DISP=(MOD,DELETE),SPACE=(TRK,0),DSN=SE1666
       7 //SPLATTT  EXEC PGM=IKJEFT1A,                                         
         //         PARM=('SPLATTT MOPZT00,TCP00037')                         
       8 //SYSEXEC  DD DISP=SHR,DSN=&SYSUID..USER.EXEC                         
         IEFC653I SUBSTITUTION JCL - DISP=SHR,DSN=SE16661.USER.EXEC           
       9 //SYSTSPRT DD SYSOUT=*                                               
      10 //SYSTSIN  DD DUMMY                                                   
      11 //SYSUT2   DD DISP=&NC,DSN=SE16661.J2007036.T160027.S576039,         
         //            &FB80                                                   
         IEFC653I SUBSTITUTION JCL - DISP=(,CATLG,DELETE),SPACE=(TRK,(5,5)),DSN
         LRECL=80,RECFM=FB                                                     
STMT NO. MESSAGE                                                               
Back to top
View user's profile Send private message
mnarvaja

New User


Joined: 04 May 2006
Posts: 1

PostPosted: Wed Feb 21, 2007 2:24 am    Post subject: Re: Pass Parms from REXX to the JOB
Reply with quote

Awesome Steve! icon_idea.gif
Back to top
View user's profile Send private message
sudhee_rb

New User


Joined: 29 Mar 2006
Posts: 34

PostPosted: Wed Jan 23, 2008 3:59 pm    Post subject: Re: Pass Parms from REXX to the JOB
Reply with quote

I need your help on the same situation.This my first rexx code ever.

I am working on one task(i need to add some logic).

My rexx pgm recalls (mass) the migrated VSAM files.
Now i wanted to change my code from MASS recall to one after one for this i added "HRECALL '" || dsnm || "' WAIT".

I have to add one more logic (logic to program/JCL. Pass number to program to do recalls starting with nth record of the input file ),don't now how to pass the nth record.Can u please give me an idea on this.

Here i am sending the some of the code.

do until RC <> 0
"EXECIO 1 DISKR in01"
if RC = 2 then
Iterate

if RC ¬= 0 then do
Say "Read Error on in01. RC:"RC
Exit (16)
end

pull in_rcd
rcd_in = rcd_in + 1
dbnm = Substr(in_rcd,216,12)
tsnm = Substr(in_rcd,229,12)
dbnm = Strip(dbnm)
tsnm = Strip(tsnm)
if dbnm = "DUMMYJOB" then
Iterate
owner = Substr(in_rcd,242,12)
tbnm = Substr(in_rcd,268,128)
owner = Strip(owner)
tbnm = Strip(tbnm)

if dbnm ¬= save_dbnm ,
| tsnm ¬= save_tsnm then
call check_migrate /* Check if vsam file(s) migrated */

if dbnm ¬= save_dbnm ,
| tsnm ¬= save_tsnm ,
| save_owner ¬= owner ,
| save_tbnm ¬= tbnm then
call fmt_sql

save_dbnm = dbnm
save_tsnm = tsnm
save_owner = owner
save_tbnm = tbnm

END /* do until eof in01 */


check_migrate:
/* Check if vsam file has been migrated */
/* If it has, issue HRECALL */
do v = 1 to vsamlist.0
If Pos(dbnm,vsamlist.v) > 0 then do
& Pos(tsnm,vsamlist.v) > 0 then do
dsnm = Strip(vsamlist.v)
"HRECALL '" || dsnm || "' WAIT"
total_recall = total_recall + 1
say '* Recall ' dsnm
end
end
Return


Please help me on this.

Thanks in advance.
Sudheer
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10308
Location: italy

PostPosted: Wed Jan 23, 2008 4:04 pm    Post subject: Reply to: Pass Parms from REXX to the JOB
Reply with quote

Quote:
Now i wanted to change my code from MASS recall to one after one for this i added "HRECALL '" || dsnm || "' WAIT".


why would You want to destroy all the optimization which will be carried on by HSM

it might be irrlevant when recalling from dasd, but when recalling from tape
hsm will group recalls by tape volumes
( it will recall all the datasets on the same tape with just one tape mount )

Your way will result in a longer elapsed, more tape mounts, more tape units being used!

Overall the worst performance by any point of view
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Jan 24, 2008 12:04 am    Post subject:
Reply with quote

As Enrico has said, and I myself in a previous post. Don't use sequential recalls, for precisely the reasons stated.

If I see anyone doing that in a shop where I am the storage guy a very swift S222 abend is gifted to the offending job.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts Creating ISPF Screens with Scrname vi... Albireo20 TSO/ISPF 9 Tue Sep 05, 2017 4:24 pm
No new posts How to Run Rexx Macro? Kalaivignesh CLIST & REXX 5 Fri Sep 01, 2017 9:08 pm
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us