Rexx code



IBM's Command List programming language & Restructured Extended Executor

Rexx code

Postby Sonal C » Thu Jan 24, 2013 4:13 pm

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.

***
Sonal C
 
Posts: 17
Joined: Wed Nov 07, 2012 12:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Rexx code

Postby MrSpock » Thu Jan 24, 2013 4:56 pm

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.
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: Rexx code

Postby Pedro » Thu Jan 24, 2013 7:10 pm

Show us the trace.
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: Rexx code

Postby Akatsukami » Thu Jan 24, 2013 8:49 pm

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.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Rexx code

Postby steve-myers » Fri Jan 25, 2013 2:01 am

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?
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Rexx code

Postby NicC » Fri Jan 25, 2013 2:13 am

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!
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: Rexx code

Postby Sonal C » Fri Jan 25, 2013 11:07 am

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.
Sonal C
 
Posts: 17
Joined: Wed Nov 07, 2012 12:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Rexx code

Postby Pedro » Fri Jan 25, 2013 7:36 pm

Repeat:
Show us the trace.
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: Rexx code

Postby Akatsukami » Fri Jan 25, 2013 8:24 pm

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.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Rexx code

Postby Pedro » Sat Jan 26, 2013 2:14 am

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.
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


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post