edit macros and undo



TSO Programming, ISPF, SDF, SDSF and PDF, FTP, TCP/IP Concepts, SNA & SNA/IP etc...

edit macros and undo

Postby southskies » Wed Jan 19, 2011 8:00 pm

Hi,

Can anyone assist me with the use of the UNDO command in an edit macro?

I am trying to do this in REXX

Address ISREDIT
"macro"
"setundo on"
"change all a b"
"undo"
"change all a c"

The last undo command will not work - it comes up with an error stating that the Command is unrecognised. I've tried the other SETUNDO settings and the RECOVERY command, but UNDO will never work as a macro command. I am still able to use UNDO on the command line however.

The following also works, but the use of the UNDO would make it much neater.

Address ISREDIT
"macro"
"cut"
"change all a b"
"delete all"
"paste"
"change all a c"

Has anyone managed to get UNDO working within a macro?

Thanks,

Steve
southskies
 
Posts: 2
Joined: Tue Dec 14, 2010 12:24 pm
Has thanked: 0 time
Been thanked: 0 time

Re: edit macros and undo

Postby Pedro » Wed Jan 19, 2011 8:35 pm

UNDO is not in the editor manual as a macro statement.

But it is not clear what you are trying to do. UNDO literally undoes the last change statement in your example. If you want to undo it using program logic, why do you not just avoid the change statement using the same logic?
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: edit macros and undo

Postby prino » Wed Jan 19, 2011 11:26 pm

southskies wrote:...

Has anyone managed to get UNDO working within a macro?

An edit macro is supposed to contain a set of canned commands that are to be executed repeatedly. Why would you want to UNDO something in such a set of commands :?: :?: :?: :?: :?:
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 29 times

Re: edit macros and undo

Postby NicC » Thu Jan 20, 2011 12:44 am

If the code posted is the actual macro then I guess the TS is playing and trying to learn how to write macros. Whatever, if the command is not in the manual it is not supported. He needs to browse the ISPF EDIT and EDIT MACROS manual. The version I have is SC34-4820-04 which is for z/OS V1 Release 7.0 but leave off the 04 when doing a search and you should get a list that includes the latest.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: edit macros and undo

Postby southskies » Thu Jan 20, 2011 5:49 pm

There is other code that goes between the undo and the second change statement. The code snippert was just to illustrate what I was trying to achieve, namely in having a simple macro solution that would allow for a text restore back to a prior base point before continuing, whilst still keeping control within the macro.

I've searched through the manual prior to posting, and was just hoping that there was something I'd missed.

Thanks for all the responses.

Steve
southskies
 
Posts: 2
Joined: Tue Dec 14, 2010 12:24 pm
Has thanked: 0 time
Been thanked: 0 time

Re: edit macros and undo

Postby stevexff » Fri Jan 21, 2011 2:31 pm

I guess the argument goes: if your macro is smart enough to realise it needs to perform an UNDO, it can use the same logic to avoid making the change in the first place.

If you need to (say) make some changes to JCL with the macro and then submit it, you can avoid saving the changes by issuing a CANCEL as the last step in the macro. From Edit and Edit Macros
CANCEL is especially useful if you have changed the wrong data, or if the changes themselves are incorrect. See the DATA_CHANGED, AUTOSAVE, and END commands for more information about saving data.
Steve
stevexff
 
Posts: 56
Joined: Wed Nov 10, 2010 7:48 pm
Has thanked: 0 time
Been thanked: 0 time


Return to TSO & ISPF

 


  • Related topics
    Replies
    Views
    Last post