Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 47 Fri Sep 29, 2017 1:08 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts exec macro in the end of edit anatol CLIST & REXX 8 Fri Sep 22, 2017 5:10 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us