Page 1 of 1

To submit JCL via REXX

PostPosted: Thu Oct 17, 2013 10:36 am
by bobguo
/* REXX */                                                     
user = USERID()                                                 
queue "//"user"B JOB 'BOBGUO',CLASS=A,NOTIFY="user",MSGCLASS=A "
queue "//REXX  EXEC PGM=IKJEFT01,     "                         
queue "//          PARM='REXX1'       "                         
queue "//SYSTSPRT DD SYSOUT=*         "                         
queue "//SYSTSIN DD DUMMY             "                         
queue "//SYSPROC DD  DSN=XXXXX.REXX,DISP=SHR   "               
queue "//                             "                         
queue "$$                             "                         
o = OUTTRAP("output.",,"CONCAT")                               
ADDRESS TSO "SUBMIT * END($$)"                                 
o = OUTTRAP(OFF)                                               
say output.1                                                   
say output.2                                                   
RETURN       


i am new to rexx and this is one sample program copied from book. but when i ran it, i got one problem below, can somobody help me to resolve it, thanks.


IKJ56701I MISSING END CHARACTER(S)+
IKJ56701I MISSING ONE OR TWO CHARACTERS (I.E. ALPHABETIC, NUMERIC, OR NATIONAL)
THAT WILL TERMINATE THE INPUT JOB STREAM
A command entered or contained in a CLIST has invalid syntax.
***

Re: To submit JCL via REXX

PostPosted: Thu Oct 17, 2013 4:13 pm
by NicC
I had a bit of trouble doing it like that but after a bit of reading I now use this:
Do i = 1 To output_jcl.0
   Queue output_jcl.i
End
Queue
o = Outtrap("output.",,"CONCAT")
"SUBMIT *"
o = Outtrap(OFF)

But before doing that - do not do the submit but display what you are putting onto the queue to check that it looks OK.

Re: To submit JCL via REXX

PostPosted: Thu Oct 17, 2013 9:15 pm
by Pedro
The help from SUBMIT, re: END parameter:
WHEN TERMINATING THE INPUT JOB STREAM, THE CHARACTER(S)
MUST BEGIN IN COLUMN 1 AND BE THE ONLY DATA ON THE INPUT LINE.


But you also queued many trailing blanks. Try:
queue "$$" 

Re: To submit JCL via REXX

PostPosted: Fri Oct 18, 2013 7:42 am
by bobguo
ADDRESS TSO "SUBMIT *"

it works.

Re: To submit JCL via REXX

PostPosted: Fri Oct 18, 2013 1:21 pm
by NicC
You do not need the ADDRESS TSO - by default your exec executes in the TSO address space.