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
 

 

REXX-Undo Expanded copybooks statements in edit mode

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
ezhavendhan

New User


Joined: 27 Mar 2013
Posts: 11
Location: India

PostPosted: Mon Aug 19, 2013 7:52 pm    Post subject: REXX-Undo Expanded copybooks statements in edit mode
Reply with quote

Hi,

This is a requirement in rexx macro, where the user goes in edit mode and expand the copybooks and include statements and give PF3 to exit.

Req-1: Here expanded copybooks should not get saved along with the changes made to the code, once the user press PF3.

Req-2: If the user gives cancel in edit mode, none of the changes done to the program saves. ( Note: lines of code too!)

Could somebody suggest the macro command to save only the user's changes and not the expanded copybook lines.

Add-Info: I am tagging the expanded copybooks with tags.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Aug 19, 2013 7:56 pm    Post subject:
Reply with quote

You will need to code the program to do this yourself in all likelyhood.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Aug 19, 2013 7:56 pm    Post subject: Reply to: REXX-Undo Expanded copybooks statements in edit mo
Reply with quote

expand the copybooks as message/note lines
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Mon Aug 19, 2013 11:28 pm    Post subject: Reply to: REXX-Undo Expanded copybooks statements in edit mo
Reply with quote

Quote:
goes in edit mode and expand the copybooks


Assuming the expand is done through an editor macro,
and assuming PF3 is set to EXIT...

Add some DEFINE macro statements to your expand editor macro:
Code:
Address ISREDIT "DEFINE exit ALIAS myprog"
Address ISREDIT "DEFINE save ALIAS myprog"


When the user presses F3, the ISPF editor will invoke your editor macro, 'myprog'.

'myprog' is another editor macro that scans the entire file and removes the expanded copybook statements. After removing the unwanted lines, 'myprog' should issue:

Code:
Address ISREDIT "BUILTIN exit"
or
Address ISREDIT "BUILTIN save"
Back to top
View user's profile Send private message
Ranjithkumar

New User


Joined: 10 Sep 2008
Posts: 94
Location: India

PostPosted: Tue Aug 20, 2013 2:55 pm    Post subject: Reply to: REXX-Undo Expanded copybooks statements in edit mo
Reply with quote

Expand the copybooks using infoline command. This way user changes only will be retained.
Back to top
View user's profile Send private message
ezhavendhan

New User


Joined: 27 Mar 2013
Posts: 11
Location: India

PostPosted: Tue Aug 20, 2013 5:50 pm    Post subject: enrico and Ranjithkumar => With Msgline/Infolines i will
Reply with quote

Thank you enrico,Pedro and Ranjithkumar =>

With Msgline/Infolines i will not be able to use find command to search the copybook variables.

Need a datalines to do that. If i use datalines, am unable to delete all the newly tagged lines icon_cry.gif
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Tue Aug 20, 2013 6:33 pm    Post subject: Reply to: REXX-Undo Expanded copybooks statements in edit mo
Reply with quote

Quote:
If i use datalines, am unable to delete all the newly tagged lines


Did you try the DEFINE macro instruction as I described earlier?
Back to top
View user's profile Send private message
ezhavendhan

New User


Joined: 27 Mar 2013
Posts: 11
Location: India

PostPosted: Wed Aug 21, 2013 7:58 pm    Post subject: Sorry for the delayed reply
Reply with quote

Hi Pedro,

Sorry for the delayed reply.

I have defined the macro at the top of my expand macro as
Code:

ADDRESS ISREDIT                             
"MACRO"                                     
ADDRESS ISREDIT "DEFINE EXIT ALIAS CLRCOP" 
ADDRESS ISREDIT "DEFINE SAVE ALIAS CLRCOP" 


A good news is the CLRCOP is working the required function,when executed seperately after my macro's execution.

Code:

/*REXX*/                               
ADDRESS ISPEXEC                       
"ISREDIT MACRO"                       
ADDRESS ISREDIT "X ALL 'XCOPY' 2 6"   
ADDRESS ISREDIT "DELETE ALL X"         
ADDRESS ISREDIT "BUILTIN SAVE"         


Current Problem => I need to execute the CLRCOP macro when the user press F3. As of now am manually executing this macro.

This is my try to execute the macro from within the expand macro, when the user presses F3, which doesn't work either.
Code:

KEYPRES = .PFKEY
IF KEYPRES= "PF03"
THEN DO
ADDRESS ISPEXEC                           
"MACRO(CLRCOP)"


Kindly throw a light on how to execute this macro in the right way.
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Thu Aug 22, 2013 6:33 am    Post subject: Reply to: REXX-Undo Expanded copybooks statements in edit mo
Reply with quote

Sorry, my memory was not accurate. Use END instead of EXIT:
Code:

ADDRESS ISREDIT "DEFINE END ALIAS CLRCOP" 


I do not understand this statement:
Quote:
This is my try to execute the macro from within the expand macro, when the user presses F3, which doesn't work either.

I do think I suggested that the F3 processing be executed from your expand macro. I think it would not be useful to do so. The user would never see the results of expand.

The DEFINE END ALIAS CLROP statement is merely setup for later execution. It tells the editor: "whenever the user enters END, run the CLROP command instead". That includes using PF3 or the user typing END in the primary command line and pressing Enter.

You may need two different macros: one for END and the other for SAVE. Perhaps you can check ZVERB to see which command was entered.
Back to top
View user's profile Send private message
ezhavendhan

New User


Joined: 27 Mar 2013
Posts: 11
Location: India

PostPosted: Thu Aug 22, 2013 6:50 pm    Post subject: Awesome Fix !
Reply with quote

Awesome Fix Pedro!

Kudos to you !! The tool is working fine as expected. icon_smile.gif icon_smile.gif
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Thu Aug 22, 2013 9:32 pm    Post subject: Reply to: REXX-Undo Expanded copybooks statements in edit mo
Reply with quote

You are welcome.

one more suggestion:
Code:
/*REXX*/                               
ADDRESS ISPEXEC                       
"ISREDIT MACRO"                       
ADDRESS ISREDIT "X ALL 'XCOPY' 2 6"   
ADDRESS ISREDIT "DELETE ALL X"         
ADDRESS ISREDIT "BUILTIN SAVE"   

You need to worry about the case where the user has already excluded some lines.
Back to top
View user's profile Send private message
ezhavendhan

New User


Joined: 27 Mar 2013
Posts: 11
Location: India

PostPosted: Fri Aug 23, 2013 3:44 pm    Post subject: That's cool
Reply with quote

Thank you Pedro for correctly point out,
The issue with excluded lines could be overcome with this.

Code:

/*REXX*/                                 
ADDRESS ISPEXEC                           
"ISREDIT MACRO"                           
ADDRESS ISREDIT "RES"                     
ADDRESS ISREDIT "X ALL 'XCOPY' 2 6"       
ADDRESS ISREDIT "DELETE ALL X"           
ADDRESS ISREDIT "BUILTIN SAVE"           
ADDRESS ISREDIT "CAN"                     
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 641
Location: Whitby, ON, Canada

PostPosted: Fri Aug 23, 2013 5:23 pm    Post subject:
Reply with quote

The user might manually type 'XCOPY' in column 2 on a line that was not expanded by the macro. Your cleanup would delete that line.

It may be unlikely, but it is not inconceivable.
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 -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm


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