View previous topic :: View next topic
|
Author |
Message |
Satish5
New User
Joined: 12 Nov 2007 Posts: 38 Location: Texas, USA
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
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 |
|
|
genesis786
Active User
Joined: 28 Sep 2005 Posts: 210 Location: St Katherine's Dock London
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
Satish5
New User
Joined: 12 Nov 2007 Posts: 38 Location: Texas, USA
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
What's the relationship between the two DD's "IODD" and "INOD"?
Also, POS is preferred over INDEX. |
|
Back to top |
|
|
Satish5
New User
Joined: 12 Nov 2007 Posts: 38 Location: Texas, USA
|
|
|
|
I am sorry, IOND is typo. It is IODD. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
Satish5
New User
Joined: 12 Nov 2007 Posts: 38 Location: Texas, USA
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
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 |
|
|
hchinnam
New User
Joined: 18 Oct 2006 Posts: 73
|
|
|
|
Agree with Pedro.
If it doesn't work, try this
Code: |
"ALLOC DDN(IODD) DSN('SYSDEV.IDABC.IDABCTRN.REXX') SHR REUSE"
|
|
|
Back to top |
|
|
Satish5
New User
Joined: 12 Nov 2007 Posts: 38 Location: Texas, USA
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
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 |
|
|
|