View previous topic :: View next topic
|
Author |
Message |
kisstian
New User
Joined: 06 Sep 2006 Posts: 6
|
|
|
|
Hi. What I'm trying to do is execute a macro that will open a piece of skeleton JCL in view mode, execute a few ISPF edit commands on it and then save the member under a new name. A snippet of the code I have is as follows:
Code: |
/* REXX -- CHANGE STRINGS */
"ISREDIT MACRO"
"ISPEXEC VIEW DATASET(AAA.BBB.CCC(MEMBER)')"
"ISREDIT CUT 24 31"
"ISREDIT PASTE AFTER .zlast"
"ISREDIT CRE 'DDD.EEE.FFF(MEMBER)' .zf .zl" |
The problem is that the desired skeleton is opened up, but the macro does not perform anything else. It ends at that point. I have not been able to figure out how to get around this. Thanks. |
|
Back to top |
|
|
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
You have a single quote on this line:
"ISPEXEC VIEW DATASET(AAA.BBB.CCC(MEMBER)')"
Does removing it make a difference? |
|
Back to top |
|
|
kisstian
New User
Joined: 06 Sep 2006 Posts: 6
|
|
|
|
No, that didn't help. That was just a typo on my part while I was testing some variations. |
|
Back to top |
|
|
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
If you use the following REXX:
Code: |
/* REXX -- CHANGE STRINGS */
"ISREDIT MACRO"
"ISREDIT (CURRMBR) ="MEMBER
"ISREDIT CUT 24 31"
"ISREDIT PASTE AFTER .ZLAST"
"ISREDIT CRE 'DDD.EEE.FFF("||CURRMBR||")' .ZF .ZL"
"ISREDIT CANCEL"
EXIT
|
This REXX should be stored in an authorized library with a specific name (like MACREXX).
Edit the library member the REXX should run against:
AAA.BBB.CCC(MEMBER)
Type MACREXX on the command line and press enter. Do not prefix with TSO. It should execute, create your new member, and cancel out of the original member without changing anything. |
|
Back to top |
|
|
kisstian
New User
Joined: 06 Sep 2006 Posts: 6
|
|
|
|
Looks good, but how can I invoke the macro outside of the member? |
|
Back to top |
|
|
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
ISPEXEC and ISREDIT host command environments are only available to REXX execs that execute in ISPF.
In order to execute a MACRO with ISPEXEC and ISREDIT, you need to be in a member or dataset under ISPF.
If you do a "ISPEXEC EDIT DATASET('AAA.BBB.CCC(MEMBER)')", it places you in the right member, but you have to press END to have the REXX continue with its instructions. It fails because you are no longer in the member to do CUT/PASTE/etc.
So you can run your REXX while editing the target member or re-write your REXX to bring the contents of MEMBER into a STACK or STEM, use REXX logic to adjust it, and write the contents of your STACK or STEM back out to an alternate PDS. |
|
Back to top |
|
|
|