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
 

 

Open PDS Member in View Mode and Execute Macro

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
kisstian

New User


Joined: 06 Sep 2006
Posts: 6

PostPosted: Tue Oct 10, 2006 10:13 pm    Post subject: Open PDS Member in View Mode and Execute Macro
Reply with quote

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
View user's profile Send private message

cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Tue Oct 10, 2006 11:12 pm    Post subject: Re: Open PDS Member in View Mode and Execute Macro
Reply with quote

You have a single quote on this line:

"ISPEXEC VIEW DATASET(AAA.BBB.CCC(MEMBER)')"

Does removing it make a difference?
Back to top
View user's profile Send private message
kisstian

New User


Joined: 06 Sep 2006
Posts: 6

PostPosted: Tue Oct 10, 2006 11:33 pm    Post subject:
Reply with quote

No, that didn't help. That was just a typo on my part while I was testing some variations.
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Wed Oct 11, 2006 12:18 am    Post subject: Re: Open PDS Member in View Mode and Execute Macro
Reply with quote

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
View user's profile Send private message
kisstian

New User


Joined: 06 Sep 2006
Posts: 6

PostPosted: Wed Oct 11, 2006 12:50 am    Post subject:
Reply with quote

Looks good, but how can I invoke the macro outside of the member?
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Wed Oct 11, 2006 1:13 am    Post subject: Re: Open PDS Member in View Mode and Execute Macro
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts REXX to view the PGM or PROC jackzhang75 CLIST & REXX 11 Tue Jun 20, 2017 1:20 am
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts How to see VIEW definition from BMC c... rohanthengal DB2 1 Thu May 04, 2017 1:50 pm
No new posts RC 20 for Address ISPEXEC "ISRED... pkmurali CLIST & REXX 3 Sun Apr 16, 2017 11:30 pm
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm


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