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 find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
No new posts execute APP if they are not ADDRESS T... italo_pm CLIST & REXX 3 Fri Aug 12, 2016 2:15 am
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 pm
No new posts FTOPEN TEMP is failing due to dataset... mbenaud TSO/ISPF 7 Thu Jul 28, 2016 4:28 pm


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