Page 1 of 2

Need to submit a series of JCL Jobs using REXX

PostPosted: Tue May 13, 2014 11:07 pm
by pramodnagesh73
Hello All ,

Thanks for giving me access to this forum ! Looks awesome to be part with the discussions you are having .need a help !
I a newbe in REXX .My assignment is as below

I have got around 60 Jobs in a library which is a simulation of production cycle but will be run in our Test Environment
whenever i run each job , i need to change the process date which is a symbolic variable. I have created the TEST JCL's .
but I want to automate the Jobs . i can do it using Internal Reader where i can do a mass change of the Process date
BUT i want to use REXX and develop this automation . hence going through the discussion in the forum I played my hand on a sample REXX routine
which is not working :-) .The code is as below

when I am trying to execute it ... its giving me the Variable XINPARM and when i enter its going RC = 0 but the Job is not getting submitted in SPOOL
Please advice what wrong I am doing

000001 /*Rexx Program name : SUBMITTING THRU JCL                               
000002   description       : MY JCL PARM PASING BY USER                       
000003   author            : Nagesh                                           
000004   date              : 05-12-2014                                       
000005 */                                                                     
000006 SAY XINPARM                                                             
000007 ADDRESS TSO "NEWSTACK"                                                 
000008 QUEUE"//EDNSRICO JOB (EMOPB1000T,EAD2,2,99),'E GAHAN 79-4',"           
000009 QUEUE"//    MSGCLASS=X,NOTIFY=EDNSRI,TIME=2 "                           
000010 QUEUE"/*ROUTE PRINT DISCARD"                                           
000011 QUEUE"/*WHILE NET07"                                                   
000012 QUEUE"//STEP040  EXEC PGM=IDCAMS,"                                     
000013 QUEUE"//             REGION=1024K"                                     
000014 QUEUE"//INPUT01   DD DSN=EDNSRI.TEST.PPR,"                             
000015 QUEUE"//             DISP=OLD"                                         
000016 QUEUE"//OUTPUT01  DD DSN=EDVSAM1.UIS.CIYFR4.CCR.MIGRCLMS.CLUSTER,"     
000017 QUEUE"//             DISP=OLD"                                         
000018 QUEUE"//SYSPRINT  DD SYSOUT=(,)"                                       
000019 QUEUE"//SYSIN    DD  DSN=ED.EDNSRI.JCL.NAGESH("XINPARM"),"           
000020 QUEUE"//             DISP=SHR"                                         
000021 ADDRESS TSO  "DELSTACK"

Re: Need to submit a series of JCL Jobs using REXX

PostPosted: Wed May 14, 2014 12:52 am
by enrico-sorichetti
better to use the ISPF SKELETON approach
I posted both here and on the sibling forum ( http://ibmmainframes.com )
quite a few examples ( TESTED )

Re: Need to submit a series of JCL Jobs using REXX

PostPosted: Wed May 14, 2014 2:55 am
by NicC
Your first executable statement is
SAY XINPARM

As you have not assigned any value to XINPARM I presume that that statement produces
XINPARM
on your screen. The name implies that it may be an input parameter but to get your input parameters you either have to prompt for them or parse them. You should also trace your execution to show you what is happening as your exec processes.
Also, please use the code tags when posting code and data. I will fix up your post in a moment.

Re: Need to submit a series of JCL Jobs using REXX

PostPosted: Wed May 14, 2014 3:41 am
by pramodnagesh73
Thanks Enrico and Nic ! just one question it might be silly ... but please let me know where to put teh Trace in my code I put ti at the start and i got a error when i EXEC it
I am going through Enrico post of ISPF skeleton and will seek your guidance if i face any roadblocks

between Nic , please let me know how to use the code tags as i googled and couldn't find and also i am new to the forum discussions wlthough i worked in mainframe for the past 12 + years
sorry for the above

Re: Need to submit a series of JCL Jobs using REXX

PostPosted: Wed May 14, 2014 5:53 am
by dick scherrer
Hello,

To use the Code tag, you need to be in the "reply editor", not the "quickj reply".

Above the typing area you will see a list of clickables (which are the tags). The one labeled Code is the code tag. This will allow your post to retain alignment and be more readable.

Highlight the text to be "Code'd" and click the Code in the box.

You can experiment using Preview to see your post as the forum will see it. Modify your post until it appears as you want, then Submit. If you don't submit, the post is lost!

Suggest you put the trace immediately before the first executable statement (SAY).

Re: Need to submit a series of JCL Jobs using REXX

PostPosted: Wed May 14, 2014 6:08 am
by pramodnagesh73
Hello Dick ,
Thanks !
Please find below I used the Trace option here and also used the Code Tag
the TRACE I option which i have used is not working as I am putting a EXEC and its ending with a RC=0

Sorry if I am bothering you folks ... In our floor there is no one who knows REXX


000001 /*Rexx Program name : SUBMITTING THRU JCL                       
000002   description       : MY JCL PARM PASING BY USER                       
000003   author            : Nagesh                                         
000004   date              : 05-12-2014                                       
000005 */                                                                   
000006 /*TRACE I*/                                                   
000007 SAY XINPARM                                                         
000008 ADDRESS TSO "NEWSTACK"                                               
000009 QUEUE"//EDNSRICO JOB (EMOPB1000T,EAD2,2,99),'E GAHAN 79-4',"           
000010 QUEUE"//    MSGCLASS=X,NOTIFY=EDNSRI,TIME=2 "                       
000011 QUEUE"/*ROUTE PRINT DISCARD"                                       
000012 QUEUE"/*WHILE NET07"                                                 
000013 QUEUE"//STEP040  EXEC PGM=IDCAMS,"                                 
000014 QUEUE"//             REGION=1024K"                               
000015 QUEUE"//INPUT01   DD DSN=EDNSRI.TEST.PPR,"                   
000016 QUEUE"//             DISP=OLD"                                       
000017 QUEUE"//OUTPUT01  DD DSN=EDVSAM1.UIS.CIYFR4.CCR.MIGRCLMS.CLUSTER,"     
000018 QUEUE"//             DISP=OLD"                                       
000019 QUEUE"//SYSPRINT  DD SYSOUT=(,)"               

Re: Need to submit a series of JCL Jobs using REXX

PostPosted: Wed May 14, 2014 12:36 pm
by Blackthorn
You have the TRACE statement commented out.

Re: Need to submit a series of JCL Jobs using REXX

PostPosted: Wed May 14, 2014 1:31 pm
by NicC
Also, if you are running in foreground then your trace will just fill the screen and you will not easily follow it. Use '?i' instead.
When appling the code tags you do not need to apply to each line - highlight the entire block to be 'coded' and then click the Code button. A start tag will be applied at the start of the block and an end tag at the end. Other tags cannot be used within code tags.
Your job is not being submitted because you have not submitted it! You have only put it on the Rexx queue and there it will stay until you PULL it off, SUMIT it or destroy the queue. Here is a snippet from one of my execs showing me loading the queue and submitting the queue.
Do i = 1 To output_jcl.0
   Queue output_jcl.i
End
Queue
o = Outtrap("output.",,"CONCAT")
"SUBMIT *"
o = Outtrap(OFF)
/*
Do i = 1 To output.0
   Say output.i
End
*/

Re: Need to submit a series of JCL Jobs using REXX

PostPosted: Wed May 14, 2014 7:43 pm
by Pedro
the Job is not getting submitted in SPOOL

I do not recall that the stack is the same as the internal reader. If you want to submit a job to the internal reader, you need to use the SUBMIT command.

Right now, you create a new stack, put stuff into the stack, then delete the stack without taking any action. Issue the SUBMIT * command before deleting the stack.

Re: Need to submit a series of JCL Jobs using REXX

PostPosted: Wed May 14, 2014 11:25 pm
by pramodnagesh73
Hi Pedro ,

I did the below as per your advice


My code :

/*Rexx Program name : SUBMITTING THRU JCL                               
  description       : MY JCL PARM PASING BY USER                       
  author            : Nagesh                                           
  date              : 05-12-2014                                       
*/                                                                     
TRACE ?I                                                               
SAY XINPARM                                                             
ADDRESS TSO "NEWSTACK"                                                 
QUEUE"//EDNSRICO JOB (EMOPB1000T,EAD2,2,99),'E GAHAN 79-4',"           
QUEUE"//    MSGCLASS=X,NOTIFY=EDNSRI,TIME=2 "                           
QUEUE"/*ROUTE PRINT DISCARD"                                           
QUEUE"/*WHILE NET07"                                                   
QUEUE"//STEP040  EXEC PGM=IDCAMS,"                                     
QUEUE"//             REGION=1024K"                                     
QUEUE"//INPUT01   DD DSN=EDNSRI.TEST.PPR,"                             
QUEUE"//             DISP=OLD"                                         
QUEUE"//OUTPUT01  DD DSN=EDVSAM1.UIS.CIYFR4.CCR.MIGRCLMS.CLUSTER,"     
QUEUE"//             DISP=OLD"                                         
QUEUE"//SYSPRINT  DD SYSOUT=(,)"                                       
QUEUE"//SYSIN    DD  DSN=ED.EDNSRI.JCL.NAGESH("XINPARM"),"             
QUEUE"//             DISP=SHR"                                         
SUBMIT *                                                               
ADDRESS TSO  "DELSTACK"       




RESULT :

        >L>   "//             DISP=SHR"                                 
                                                                         
     22 *-* SUBMIT *                                                     
        >L>   "SUBMIT"                                                   
     22 +++ SUBMIT *                                                     
 Error running PASSJCL1, line 22: Invalid expression                     
 A command entered or contained in a CLIST has invalid syntax.       

***

Kindly advice and also please let me know another issue also

SAY XINPARM

No if I have to get the XINPARM value inside the STACK which command i need to give ?

Hoping to knock this down and say Hurrah ! :-)

Cheers
Nag