|
|
| Author |
Message |
Gnanas SNG
Senior Member
Joined: 06 Sep 2007 Posts: 440 Location: India
|
|
|
|
| Code: |
...........
...........
...........
//STEP20 EXEC xxxxxxxxx
// xxxxxxxxxxxxxx
// xxxxxxxxxxxxxx
//xxxxxxx DD DSN=asd.qwe.qwe.NEW,
// DISP=(NEW,CATLG,DELETE),
// DCB=(DSORG=PS,RECFM=FB,LRECL=160,BLKSIZE=0),
// SPACE=(CYL,(250,100),RLSE),VOL=(,,,10),
// UNIT=3390
//aaaaaa DD DSN=asd.qwe.qwe.TARGET,
// DISP=(NEW,CATLG,DELETE),
// DCB=(DSORG=PS,RECFM=FB,LRECL=160,BLKSIZE=0),
// SPACE=(CYL,(250,100),RLSE),VOL=(,,,10),
// UNIT=3390
..........
..........
.......... |
I am asked to use production JCLs for testing purpose
In this JCL, I have change the SPACE parameter of TARGET dataset.
From
SPACE=(CYL,(250,100),RLSE),VOL=(,,,10),to
SPACE=(CYL,(1000,750),RLSE),VOL=(,,,20),
I have started with this code.
| Code: |
/*REXX*/
ADDRESS ISREDIT "MACRO"
ADDRESS ISREDIT "CURSOR = 1"
VAR1 = "STEP20"
VAR2 = "TARGET"
VAR3 = "(CYL,(1000,750),RLSE),VOL=(,,,20)"
ADDRESS ISREDIT " F "VAR1" " |
First I have to find STEP20 and then TARGET dataset and its SPACE parameter and apply the change.
Please help me to complete the macro and let me know if you need any other info. |
|
| Back to top |
|
 |
References
|
|
 |
Moved: Thu Jun 19, 2008 5:13 pm by superk From CLIST & REXX to TSO/ISPF |
UmeySan
Senior Member
Joined: 22 Aug 2006 Posts: 625 Location: Germany
|
|
|
|
Hi Gnanas !
Not really clear to me. Are you told to write EditMacro because there are several members in which this modification must be done. Otherwise a manual change would be ok.
Assuming the first, then there are more questions:
Why allways Step20, why allways the Dsn named TARGET,...and so on.
I think, you have to find out, which dataset is created, so which DD has the adequate DISP and SPACE parameters.
And you have to pay regard to some more occurrences.
So plse clarify the subject. |
|
| Back to top |
|
 |
Gnanas SNG
Senior Member
Joined: 06 Sep 2007 Posts: 440 Location: India
|
|
|
|
Hi UmeySan!
Thanks for your reply.
| Quote: |
| Are you told to write EditMacro because there are several members in which this modification must be done. |
Yes.
We grouped JCLs for specific business requirement/flow.
This particular JCL is used on many groups.
So I have to change the SPACE parameter of TARGET dataset which is coded at STEP20. |
|
| Back to top |
|
 |
Gnanas SNG
Senior Member
Joined: 06 Sep 2007 Posts: 440 Location: India
|
|
|
|
And no need to execute this edit macro manually. After creating JCL, it will be executed on that JCL automatically.
| Code: |
/*REXX*/
ADDRESS ISREDIT "CURSOR = 1"
VAR1 = "STEP20"
VAR2 = "TARGET"
VAR3 = '// SPACE=(CYL,(1000,750),RLSE),VOL=(,,,20),'
ADDRESS ISREDIT " F "VAR1" "
/* ADDRESS ISREDIT" (L1) = CURSOR" */
ADDRESS ISREDIT " F "VAR2" "
/* ADDRESS ISREDIT" (L2) = CURSOR" */
L3 = L3 + 3
ADDRESS ISREDIT DELETE L3
ADDRESS ISREDIT "LINE_BEFORE "L3" = '"VAR3"'" |
Will this work?
And please let me know how to execute on a member to test it ? |
|
| Back to top |
|
 |
Pedro
Senior Member
Joined: 01 Sep 2006 Posts: 526 Location: work
|
|
|
|
You should at least test the macro manually. Then test through batch job (if that is how you want to run it). Edit macros are executed as a command while inside of the editor (or possibly, as the initial macro when getting into the editor).
It is not clear what you mean:
| Quote: |
| After creating JCL, it will be executed on that JCL automatically. |
About your program:
1. you need to start with Address ISREDIT 'MACRO'
2. your solution did not match the requirement! Rather than changing one space value for another, you are replacing the 4th line no matter what was there. After you find STEP10 and after you find TARGET, issue a change command:
| Code: |
Address ISREDIT ,
"C 'SPACE=(CYL,(250,100),RLSE),VOL=(,,,10),' ",
"'SPACE=(CYL,(1000,750),RLSE),VOL=(,,,20),' " |
|
|
| Back to top |
|
 |
Gnanas SNG
Senior Member
Joined: 06 Sep 2007 Posts: 440 Location: India
|
|
|
|
Hello Pedro,
This is the code I have come with.
| Code: |
/*REXX*/
ADDRESS ISREDIT "MACRO PROCESS"
ADDRESS ISREDIT "CURSOR = 1"
/* VAR1 = "STEP20" */
/* VAR2 = "TARGET" */
VAR3 = '// SPACE=(CYL,(2000,750),RLSE),VOL=(,,,20),'
L2 = 0
ADDRESS ISREDIT " F 'STEP20'"
ADDRESS ISREDIT " F 'TARGET'"
ADDRESS ISREDIT" (L2) = CURSOR"
L3 = L2 + 3
ADDRESS ISREDIT DELETE L3
ADDRESS ISREDIT "LINE_BEFORE "L3" = '"VAR3"'" |
Here I am finding STEP20 and TARGET dataset. From there, next to 3 lines, I am deleting a line which has the SPACE parameter and palcing new line with new SPACE parameter.
Let me explain how JCLs are created.
...We have a panel where we can enter business requirement/flow so that it will generate approprite JCLs from production JCLs for testing
...And we have macrolib(edit macros)
...After creation of JCL, it will search for a member in macrolib with the same name of JCL member.
...If it is found, that particular macro will be executed on that JCL member, if no macros found(no member is there in macrolib with same as JCL member), no macros are executed on that member.
...We will create macros with same name of JCL(member) and place it on macrolib so that it will be executed automatically.
Please let me know if any changes can be done to the macro. |
|
| Back to top |
|
 |
Pedro
Senior Member
Joined: 01 Sep 2006 Posts: 526 Location: work
|
|
|
|
Perhaps I am reading too much into your requirement. Your requirement is very specific.
your solution did not match the requirement! Rather than changing one space value for another, you are replacing the 4th line no matter what was there. After you find STEP10 and after you find TARGET, issue a change command:
| Code: |
Address ISREDIT ,
"C 'SPACE=(CYL,(250,100),RLSE),VOL=(,,,10),' ",
"'SPACE=(CYL,(1000,750),RLSE),VOL=(,,,20),' " |
What if the line reads: "(CYL,(50,10),"? your method will still change it, though that was not one of your stated requirements. What if SPACE is on a different line that you thought? |
|
| Back to top |
|
 |
Gnanas SNG
Senior Member
Joined: 06 Sep 2007 Posts: 440 Location: India
|
|
|
|
Hi,
I have noticed SPACE parameter after 2 lines from TARGET dataset. Thats why I coded to delete that line and to add another line with new SPACE parameter!!???
Instead of this, I used your suggestion on my code. It's good. I will get back to you if any issues.
Thanks you very much, Pedro! |
|
| Back to top |
|
 |
Gnanas SNG
Senior Member
Joined: 06 Sep 2007 Posts: 440 Location: India
|
|
|
|
This macro works to some extent.
| Code: |
/*REXX*/
ADDRESS ISREDIT "MACRO PROCESS"
ADDRESS ISREDIT "CURSOR = 1"
VAR1 = "STEP20"
VAR2 = "TARGET"
VAR3 = 'SPACE=(CYL,(250,100),RLSE),VOL=(,,,10),'
VAR4 = 'SPACE=(CYL,(1000,750),RLSE),VOL=(,,,20),'
ADDRESS ISREDIT "F '"VAR1"'"
ADDRESS ISREDIT "F '"VAR2"'"
ADDRESS ISREDIT "C '"VAR3"' '"VAR4"'" |
Default SPACE parameter for TARGET dataset is not same since that JCL can be taken either from production or from our testing library.
| Code: |
| VAR3 = 'SPACE=(CYL,(250,100),RLSE),VOL=(,,,10),' |
Consider this code part of our interest.
| Code: |
//aaaaaa DD DSN=asd.qwe.qwe.TARGET,
// DISP=(NEW,CATLG,DELETE),
// DCB=(DSORG=PS,RECFM=FB,LRECL=160,BLKSIZE=0),
// SPACE=(CYL,(250,100),RLSE),VOL=(,,,10),
// UNIT=3390 |
So I've to find SPACE= keyword and change the parameter to new one upto comma (,).
// SPACE=(CYL,(250,100),RLSE),VOL=(,,,10),
Please help on this. |
|
| Back to top |
|
 |
Pedro
Senior Member
Joined: 01 Sep 2006 Posts: 526 Location: work
|
|
|
|
| Quote: |
| Please help on this. |
It is not clear what you need help with.
It looks good to me; if it does not work, please explain why the result is not good. |
|
| Back to top |
|
 |
|
|
|