Invoke JCL program thru rexx



IBM's Command List programming language & Restructured Extended Executor

Invoke JCL program thru rexx

Postby arya_starc » Thu Oct 25, 2018 11:48 am

Hi All,


I am trying to invoking a jcl program which I passed in my rexx code.
I am trying to achieving this by using "QUEUE" command, but it not working. Below is the snippet

ADDRESS TSO                                                        
SAY "PLEASE ENTER NUMBER"                                          
PULL NUM                                                          
IF NUM ==  1 THEN DO                                              
SIGNAL SUBMIT                                                      
END                                                                
EXIT                                                              
 SUBMIT:                                                          
ADDRESS TSO                                                        
"DELSTACK"                                                        
 QUEUE "//SAMPJCL1 JOB (0000,XXXX),'JCL_INVOKER',                "
 QUEUE "//       CLASS=Z,                                        "
 QUEUE "//       MSGCLASS=9,                                     "
 QUEUE "//       REGION=0M                                       "
 QUEUE "//*                                                      "
 QUEUE "//*---------- SERVICE EXCI TEST PROCESS -----------------"
 QUEUE "//*                                                      "
 QUEUE "//DELSVCO EXEC PGM=IEFBR14                               "
 QUEUE "//FIL11 DD DSN=MYFILE.TEST1.DEL.SE,                     "
 QUEUE "//       DISP=(MOD,DELETE,DELETE),                       "
 QUEUE "//       SPACE=(TRK,0)                                   "
 QUEUE "//*                                                      "
 QUEUE "/*                                                       "
 QUEUE "$$"                                                        
EXIT                                                              
 


I am executing this rexx by giving 'ex' command infront of the member name.
arya_starc
 
Posts: 136
Joined: Mon Sep 21, 2015 1:39 pm
Has thanked: 5 times
Been thanked: 0 time

Re: Invoke JCL program thru rexx

Postby NicC » Thu Oct 25, 2018 12:40 pm

Many mistakes here:
1 - no such thing as a "JCL program" - JCL describes a job specification including programs to be executed
2 - saying it is not working means absolutely nothing. You MUST say how it is not working (what you expect to happen and what did happen)
3 - You are not submitting anything just putting items on the queue
4 - make submit a procedure and CALL it.
5 - only need 1 EXIT - the second, once you change SIGNAL to CALL should be a RETURN
6 - Read the Rexx manual from start to finish - in particular the keywoerds that you have used.
7 - search the forum for how to properly submit a job via the queue.
8 - TSO is the default address space so you do not need to use ADDRESS TSO
9 - "IF x THEN y" not "IF x THEN DO y END"
10 - "IF x THEN DO y; z; END"
That is enough tutoring.
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: Invoke JCL program thru rexx

Postby expat » Thu Oct 25, 2018 1:00 pm

Why oh why do people insist on writing instream JCL statements to submit.
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

Re: Invoke JCL program thru rexx

Postby NicC » Thu Oct 25, 2018 1:25 pm

Because they can - or cannot, in this case!
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: Invoke JCL program thru rexx

Postby arya_starc » Thu Oct 25, 2018 1:29 pm

Thanks NicC,

I am working on points.

Hi Expat,

In my case, I am instream jcl because I need to pass parameter in my jcl which should append in my jcl statement and then it will execute.
arya_starc
 
Posts: 136
Joined: Mon Sep 21, 2015 1:39 pm
Has thanked: 5 times
Been thanked: 0 time

Re: Invoke JCL program thru rexx

Postby expat » Thu Oct 25, 2018 2:06 pm

Which is easily accomplished using ISPF file tailoring too
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

Re: Invoke JCL program thru rexx

Postby willy jensen » Thu Oct 25, 2018 2:16 pm

The recommended method for generating jobs is ISPF skeleton services. Having said that, I don't have a problem with people generating JCL inline in the program and submitting directly, as usual it depends on the situation.
And now to the program in question, it can be simplified to something like this:

 say "Please enter number"        
 pull num                          
 if num <> 1 then exit            
 "delstack"                        
 queue  .....your JCL....          
 queue  "$$"                      
 "submit * end($$)"                
 "delstack"    /* just in case */  

But you really need to work your way through the REXX reference and the TSO command reference manuals.
willy jensen
 
Posts: 467
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 70 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post