Need to submit a series of JCL Jobs using REXX



IBM's Command List programming language & Restructured Extended Executor

Need to submit a series of JCL Jobs using REXX

Postby pramodnagesh73 » Tue May 13, 2014 11:07 pm

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"
pramodnagesh73
 
Posts: 5
Joined: Tue May 13, 2014 10:22 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby enrico-sorichetti » Wed May 14, 2014 12:52 am

better to use the ISPF SKELETON approach
I posted both here and on the sibling forum ( http://ibmmainframes.com )
quite a few examples ( TESTED )
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3002
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

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

Postby NicC » Wed May 14, 2014 2:55 am

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

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

Postby pramodnagesh73 » Wed May 14, 2014 3:41 am

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
pramodnagesh73
 
Posts: 5
Joined: Tue May 13, 2014 10:22 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby dick scherrer » Wed May 14, 2014 5:53 am

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).
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

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

Postby pramodnagesh73 » Wed May 14, 2014 6:08 am

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=(,)"               
pramodnagesh73
 
Posts: 5
Joined: Tue May 13, 2014 10:22 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby Blackthorn » Wed May 14, 2014 12:36 pm

You have the TRACE statement commented out.
Blackthorn
 
Posts: 130
Joined: Tue Feb 01, 2011 7:12 pm
Has thanked: 1 time
Been thanked: 9 times

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

Postby NicC » Wed May 14, 2014 1:31 pm

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
*/
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

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

Postby Pedro » Wed May 14, 2014 7:43 pm

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.
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

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

Postby pramodnagesh73 » Wed May 14, 2014 11:25 pm

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
pramodnagesh73
 
Posts: 5
Joined: Tue May 13, 2014 10:22 pm
Has thanked: 0 time
Been thanked: 0 time

Next

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post