Page 1 of 1

Rexx code

PostPosted: Thu Jan 24, 2013 4:13 pm
by Sonal C
Hi, Can you please let me know how to run a obl through rexx??? I know I am supposed to use the Submit command to perform that action, but not getting what mistake i am doing in my below code. can someone please help me in debugging

(My requirement here is I am suppose to read the member name from a PDS and edit my jcl steps to run a bind job through the same rexx on all the elements present in the PDS.)

below is my code
/* REXX PDS */
THEPDS = "'MSP2148.TEST.DBRM'"
QUEUE "//MSP2148  JOB D20081000000,'BIND         ',CLASS=C,MSGCLASS=C,"
QUEUE "// NOTIFY=&SYSUID                                       "
X = OUTTRAP('ML.')
"LISTDS "THEPDS" MEMBERS"
X = OUTTRAP('OFF')
DO N = 7 TO ML.0 
  PARSE VAR ML.N MEMBER
  MEMBER=STRIP(MEMBER)
  QUEUE "//************************************************************"
  QUEUE "//BIND EXEC PGM=IKJEFT01"         
  QUEUE "//SYSTSPRT  DD SYSOUT=*"     
  QUEUE "//SYSPRINT  DD SYSOUT=*"         
  QUEUE "//DBRMLIB DD  DISP=SHR,DSN=XY.A.FFFF.DBRM"     
  QUEUE "//        DD  DISP=SHR,DSN=XY.PDB2B.FFFF.DBRM"     
  QUEUE "//        DD  DISP=SHR,DSN=XY.PDB2B.SHARED.DBRM" 
  QUEUE "//SYSIN     DD DUMMY "             
  QUEUE "//SYSTSIN   DD * " 
  QUEUE "DSN SYSTEM(DB2E) "     
  QUEUE " BIND PACKAGE  (CFFAAAU1)                   - "   
  QUEUE "  OWNER       (DB2AAAU1)                   - "   
  QUEUE "  QUALIFIER   (DB2AAAU1)                   - "   
  QUEUE "  MEMBER      ("MEMBER")                    - "   
  QUEUE "  ACTION      (REPLACE)                    - "   
  QUEUE "  VALIDATE    (BIND)                       - " 
  QUEUE "  ISOLATION   (UR)                         - "   
  QUEUE "  CURRENTDATA (NO)                         - "
  QUEUE "  RELEASE     (COMMIT)                     - " 
  QUEUE "  EXPLAIN     (YES) " 
  QUEUE "$$"   
  O=OUTTRAP("OUTPUT.",,"CONCAT")   
  "SUBMIT * END ($$)"   
  O=OUTTRAP(OFF)
  SAY "MEMBER NAME IS ==>" MEMBER 
END 
EXIT



Error I am getting on executing the rexx

A command entered or contained in a CLIST has invalid syntax.

***

Re: Rexx code

PostPosted: Thu Jan 24, 2013 4:56 pm
by MrSpock
For one thing, you have the SUBMIT command mis-placed. If I'm understanding your intent correctly, you create a JCL jobcard first. Then, you want to generate a BIND step for each member of the PDS. Then, you want to submit the job. So, you need to move the SUBMIT statement to outside of the DO-END loop.

Re: Rexx code

PostPosted: Thu Jan 24, 2013 7:10 pm
by Pedro
Show us the trace.

Re: Rexx code

PostPosted: Thu Jan 24, 2013 8:49 pm
by Akatsukami
The problem, Sonal, is that all those lines that you are queueing are not drained by your SUBMIT command; therefore this exec submits no real jobs, and all the data in the queue is passed to TSO when the exec ends, thus the error message.

I recommend that you use ISPF file-tailoring services to create your JCL and submit that.

Re: Rexx code

PostPosted: Fri Jan 25, 2013 2:01 am
by steve-myers
If I read the initial post correctly, what is intended amounts to a very slow copy. Worse, if it is not done correctly the output members will not be usable. To do this correctly -
  • The major module attributes (RENT, REFR, REUS) must be identified from the directory and passed to the Binder. In theory, this can be done in Rexx, but it is quite difficult.
  • If the source is in planned overlay, the overlay structure must be deduced and the appropriate Binder control statements must be generated. In theory, the overlay structure can be deduced from the source, but doing it in Rexx is extremely non-trivial.
  • The module entry point must be deduced from the load module and directory, and the appropriate Binder control statement must be generated. In theory, this can be done in Rexx, but it is quite difficult.
  • Alias names must be deduced and the appropriate Binder control statements must be generated. The module aliases can be obtained from LISTDS.
I did something like this back in the 1970s, using Assembler and the Linkage Editor. The first bullet was not a major problem because of the way the Linkage Editor worked, but it must be done when using the Binder.

Still, what is the point of this exercise? Why are you doing this?

Re: Rexx code

PostPosted: Fri Jan 25, 2013 2:13 am
by NicC
how to run a obl through rexx?

What is an "obl"?

Steve, I believe it is a DB2 bind not a bind of object modules into a load module!

Re: Rexx code

PostPosted: Fri Jan 25, 2013 11:07 am
by Sonal C
Thanks all for your suggestions. n sorry its JCL not "obl" in my query. MrSpock i tried placing the submit job after the do loop, but no luck, still facing the same error. I am repeating my query- "i need to read the members of PDS and execute the db2 Bind step on every member of the PDS through REXX"... If my code above is not relaiable , then can you please suggest me some other alternative to achieve the goal.

Re: Rexx code

PostPosted: Fri Jan 25, 2013 7:36 pm
by Pedro
Repeat:
Show us the trace.

Re: Rexx code

PostPosted: Fri Jan 25, 2013 8:24 pm
by Akatsukami
Sonal C wrote:I am repeating my query- "i need to read the members of PDS and execute the db2 Bind step on every member of the PDS through REXX"... If my code above is not relaiable , then can you please suggest me some other alternative to achieve the goal.

And I am repeating my recommendation: create a JCL skeleton and use ISPF file-tailoring to create a job with many steps or many jobs with one step, and submit those.

Re: Rexx code

PostPosted: Sat Jan 26, 2013 2:14 am
by Pedro
If my code above is not relaiable


add as second line:
a= TRACE('R')

You will get some error messages at the point where the syntax error occurs. The trace will show you which command has a syntax error. And knowing which command has a syntax error, you can look at the TSO Command Reference for the correct syntax.

hint: the command looks pretty correct but not exactly correct.