Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Passing symbolic parm values to JCL thru REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Satish5

New User


Joined: 12 Nov 2007
Posts: 38
Location: Texas, USA

PostPosted: Tue Sep 23, 2008 5:20 pm    Post subject: Passing symbolic parm values to JCL thru REXX
Reply with quote

Hi,
I am submitting a JCL(written in a sequential file) multiple times using REXX.
/******************* REXX *******************/
COUNT=1
ADDRESS TSO
DO UNTIL(COUNT=3)
"SUBMIT ('SYSDEV.IDXXX.REXX')"
COUNT=COUNT+1
END


In the JCL I am calling a proc and overriding parms

//PROC0010 EXEC TEST,
// GEN=(-5),

Now I want to change value of GEN for each run. Please suggest how I can do that.

Thanks,
Satish
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Tue Sep 23, 2008 5:35 pm    Post subject: Reply to: Passing symbolic parm values to JCL thru REXX
Reply with quote

the rexx will just submit each member

You need to implement a member change script,
could be an edit macro
or a script to read the member, change the appropriate lines
writing them to a temporary dataset and submit the temporary dataset
Back to top
View user's profile Send private message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Tue Sep 23, 2008 5:39 pm    Post subject:
Reply with quote

i don't think using SUBMIT command u can pass any parameters (variables) to the JCL..

but you can try file tailoring..

1. make a skeleton jcl (with ur variables etc properly written), and keep it in your ISPSLIB

2. write your rexx code giving values to all the variables you want to be passed to your jcl

3. write your file tailoring commands

Code:

ADDRESS ISPEXEC "FTOPEN TEMP"     
ADDRESS ISPEXEC "FTINCL URSKEL"
ADDRESS ISPEXEC "FTCLOSE"         


4. then submit the jcl
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Tue Sep 23, 2008 5:50 pm    Post subject: Reply to: Passing symbolic parm values to JCL thru REXX
Reply with quote

Or you can have the REXX code write the JCL code and then submit the JCL from the data stack rather than from a dataset.

See SUBMIT Command for more details.
Back to top
View user's profile Send private message
Satish5

New User


Joined: 12 Nov 2007
Posts: 38
Location: Texas, USA

PostPosted: Wed Sep 24, 2008 5:19 pm    Post subject: Passing symbolic parm values to JCL thru REXX
Reply with quote

Hi,
Thanks for suggestions. This is first time I am writing a REXX.
I copied my JCL to a file. Now I am trying to read record one by one from file, search for string in record, if found then change that record and write it back to same file. Then close this file and in next step submit the JCL.

Code:

"ALLOC DA ('SYSDEV.IDABC.IDABCTRN.REXX') F(IODD) OLD REUSE"
"EXECIO * DISKRU INOD (STEM Y. FINIS)"                     
STR1='GEN1'               /*UR SEARCH STRING HERE*/       
STR2='GEN2'               /*UR SEARCH STRING HERE*/       
                                                           
X=0                                                       
DO LIN1 = 1 TO Y.0                                         
     PARSE UPPER VAR Y.LIN1 FREC                             
     IF INDEX(FREC,STR1) > 0 THEN                           
        DO                                                   
          PULL THE_REC                                       
          THE_RECORD="GEN1=(-7)"                             
          PUSH THE_REC                                       
          "EXECIO * DISKW INOD (STEM Y. FINIS)"             
          X = X + 1                                         
        END                                                 
     ELSE NOP                                               
END                                                       
SAY X                                                     


When I EXEC this rexx I recieve following message

EXTRANEOUS INFORMATION WAS IGNORED: OLD REUSE
1
A command entered or contained in a CLIST has invalid syntax.
***


Record in file is not replaced.
Please suggest a solution.

Thanks,
Satish
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Wed Sep 24, 2008 5:50 pm    Post subject: Reply to: Passing symbolic parm values to JCL thru REXX
Reply with quote

What's the relationship between the two DD's "IODD" and "INOD"?

Also, POS is preferred over INDEX.
Back to top
View user's profile Send private message
Satish5

New User


Joined: 12 Nov 2007
Posts: 38
Location: Texas, USA

PostPosted: Wed Sep 24, 2008 7:52 pm    Post subject: Reply to: Passing symbolic parm values to JCL thru REXX
Reply with quote

I am sorry, IOND is typo. It is IODD.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Wed Sep 24, 2008 8:10 pm    Post subject: Reply to: Passing symbolic parm values to JCL thru REXX
Reply with quote

OK. So IODD is the ddname for the dataset. You'll use the same dataset for both read and write.

You're reading the dataset into the stem variable Y.

You're going to loop through the stem variable Y. and use POS (see my note about the preferred function) to search for the value 'GEN1' anywhere on the record. If found, you want to update the entire record to the value 'GEN1=(-7)'. You also want to keep a counter X of the number of hits found.

Then, you want to re-write the dataset with all of the updated records contained in the stem variable Y.

Is that the process?
Back to top
View user's profile Send private message
Satish5

New User


Joined: 12 Nov 2007
Posts: 38
Location: Texas, USA

PostPosted: Wed Sep 24, 2008 8:48 pm    Post subject: Passing symbolic parm values to JCL thru REXX
Reply with quote

You are right Superk. I want to open the dataset, find the variable I want to change(actually it will be a complete record as the dataset contains job statements), change the variable, close the dataset. Then submit the jcl in that dataset. This will be done recursively. I do not know much about REXX, I am using the code posted on this forum.
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2038
Location: Silicon Valley

PostPosted: Wed Sep 24, 2008 9:15 pm    Post subject: Reply to: Passing symbolic parm values to JCL thru REXX
Reply with quote

The message says you have a syntax error in:
Code:

"ALLOC DA ('SYSDEV.IDABC.IDABCTRN.REXX') F(IODD) OLD REUSE"

Likely, it does not like the space after 'DA'.

And you probably need /*rexx*/ on first line.
Back to top
View user's profile Send private message
hchinnam

New User


Joined: 18 Oct 2006
Posts: 73

PostPosted: Wed Sep 24, 2008 10:05 pm    Post subject:
Reply with quote

Agree with Pedro.

If it doesn't work, try this

Code:


"ALLOC DDN(IODD) DSN('SYSDEV.IDABC.IDABCTRN.REXX') SHR REUSE"

Back to top
View user's profile Send private message
Satish5

New User


Joined: 12 Nov 2007
Posts: 38
Location: Texas, USA

PostPosted: Wed Oct 08, 2008 5:29 pm    Post subject: Reply to: Passing symbolic parm values to JCL thru REXX
Reply with quote

Thanks to all of you for help.
I have written MACROs and my REXX is doing what I wanted it to do except following problems.

1. I wrote a REXX to allocate user REXX library to SYSEXEC. Now everytime I login into TSO I have to execute "TSO EX REXX.EXEC(SETUP) EX"

2. My REXX begins as follows
/*REXX*/
LOGINID = USERID()
OUTDATA = LOGINID||".TRANOUT.TMP"
IF LISTDSI(OUTDATA) = 0 THEN
DELETE OUTDATA
SAY " "
SAY " "
SAY "ENTER SYSTEM NUMBER"
SAY " "
PULL SYSNUM
SAY " "
SAY "ENTER BRANCH LOCATION"
PULL BRANCH
SAY " "
SAY "ENTER 'FROM' GEN NUMBERS,e.g. -1,-2 ETC."
PULL GENFROM
SAY " "
SAY "ENTER 'TO' GEN NUMBERS,e.g. -1,-2 ETC."


Now when message is displayed after deleting OUTDATA file, value entered by user after SAY "ENTER SYSTEM NUMBER" is not recieved in SYSNUM.

Please suggest a solution for above problems.

Thanks
Satish
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2038
Location: Silicon Valley

PostPosted: Thu Oct 09, 2008 12:57 am    Post subject: Reply to: Passing symbolic parm values to JCL thru REXX
Reply with quote

Quote:
when message is displayed after deleting OUTDATA file...


It sounds like you are getting garbage in the data stack. See REXX Reference manual for usage of NEWSTACK and DELSTACK commands.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Running an REXX EXEC implicitly sho7hills CLIST & REXX 3 Thu Apr 20, 2017 8:14 am
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
No new posts LISTCAT on a dataset with symbolic pa... shreya19 JCL & VSAM 5 Fri Apr 07, 2017 5:43 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us