IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

Execute Partially Edited Rexx Exec from Edit Panel


 
IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
AllenSieracki

New User


Joined: 10 Apr 2020
Posts: 12
Location: USA

PostPosted: Tue Jun 02, 2020 7:56 pm
Reply with quote

I have a requirement to to figure out a way to execute an edited Rexx exec from ISPF Edit. Is this possible to do without saving? The issue is that we need to make changes, execute, make more changes, execute, etc. It would be nice if this could be done with out needed to create and maintain multiple versions.

Thanks very much.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 875
Location: Maryland

PostPosted: Tue Jun 02, 2020 8:37 pm
Reply with quote

AllenSieracki wrote:
I have a requirement to to figure out a way to execute an edited Rexx exec from ISPF Edit. Is this possible to do without saving? The issue is that we need to make changes, execute, make more changes, execute, etc. It would be nice if this could be done with out needed to create and maintain multiple versions.

Thanks very much.


Who provided you with such stupid "requirement"??? icon_pray.gif
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2431
Location: Hampshire, UK

PostPosted: Tue Jun 02, 2020 8:56 pm
Reply with quote

Do it the standard way: make a copy and play with the copy.
Back to top
View user's profile Send private message
AllenSieracki

New User


Joined: 10 Apr 2020
Posts: 12
Location: USA

PostPosted: Tue Jun 02, 2020 9:15 pm
Reply with quote

Thanks Nic. Seems like there isn't a way to do what I'm asking.

So the steps would be:
1. Make a copy
2. Edit the copy
3. Save the copy
4. Execute the copy
5. Delete the copy.
6. Repeat.

Is there a way to streamline this? For instance could we make the edits and then run an ISPF Edit Macro to save as a temp file and execute? The SAVE command doesn't seem to have the option to save to a temp file.

Thanks
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Jun 02, 2020 10:07 pm
Reply with quote

I would not edit the production data set itself because other people might be using it. You are playing with fire.

You need to look at your SYSPROC or SYSEXEC concatenation. You should have a private data set concatenated ahead of your production data set.

The order should be:
1. Copy member from production to private data set
2. Edit the copy
3. Save the copy
4. Execute the copy
5.
6. Repeat 2-4

When you are satisfied with your changes:
1. compare with the production data set member to make sure someone else has not made changes at the same time as you. It happens.
2. optional: have a team member review your changes.
3. rename the old production member so you have a backup. (It is easier to back out your defect-laden changes - spoken from experience)
4. MOVE member from private to production data set.

Of course, it would be better if you used software control program like SCLM to manage all of this.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Jun 02, 2020 10:19 pm
Reply with quote

Quote:
figure out a way to execute an edited Rexx exec from ISPF Edit


Your situation is not clear, but in a similar situation, I learned to use two separate userids that are logged on simultaneously.
1. On one userid, I was editing the macro (and saving)
2. On the second userid, I could edit the target data and could execute the macro. This userid needs to have the macro in the SYSPROC or SYSEXEC concatenation.
Back to top
View user's profile Send private message
AllenSieracki

New User


Joined: 10 Apr 2020
Posts: 12
Location: USA

PostPosted: Tue Jun 02, 2020 10:36 pm
Reply with quote

Thanks Pedro. I'm familiar with our SYSPROC concatenation and have created/edited a few execs. I'm also familiar with production code precautions. In this case, it's not that sensitive.

Would the following make sense or be possible? I'm trying to limit the user steps as much as possible.

1. Rexx Exec executed from member list makes temporary copy
2. Rexx Exec opens copy in Edit mode.
3. User makes edits and saves copy
4. Rexx Exec continues and executes saved copy

Thanks
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Jun 02, 2020 11:01 pm
Reply with quote

I am not sure that your current plan is feasible...

You can start the editor, but your rexx exec does not continue executing until the editor ends.

Your earlier comments said you were editing an ISPF editor macro. It can be done, but executing the macro is another level of complexity that you need to consider.

Some suggestions:
- make the temporary copy only if it does not already exist.

- make one exec that makes the copy and launches the editor

- make a second exec that executes the copy. Actually, it could be the same exec if you have logic to keep track of the status.
Back to top
View user's profile Send private message
AllenSieracki

New User


Joined: 10 Apr 2020
Posts: 12
Location: USA

PostPosted: Tue Jun 02, 2020 11:21 pm
Reply with quote

Thanks again Pedro. In step 4, there is no further editing to be done. The saved copy just needs to be executed. The saved copy is another edit macro but the first exec will have done its job and can exit.

I like your idea of trying to combine this exec with the other exec. Will ponder this some more.

I also found a REPLACE command. From the manual:

The REPLACE primary command replaces a sequential data set, member of a partitioned data set, or z/OSĀ® UNIX file with data you are editing. If a member or z/OS UNIX file you want to replace does not exist, the editor creates it. The editor cannot create a new sequential data set.

This looks like it might do what I need. Will try.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1224
Location: Vilnius, Lithuania

PostPosted: Wed Jun 03, 2020 4:48 am
Reply with quote

AllenSieracki wrote:
Thanks Nic. Seems like there isn't a way to do what I'm asking.

So the steps would be:
1. Make a copy
2. Edit the copy
3. Save the copy
4. Execute the copy
5. Delete the copy.
6. Repeat.

Is there a way to streamline this? For instance could we make the edits and then run an ISPF Edit Macro to save as a temp file and execute? The SAVE command doesn't seem to have the option to save to a temp file.


Flucking 'ell, you're telling what needs to be done. It shouldn't be very hard to actually write an exec or even an edit macro to just this. It would probably take me longer to start up my z/OS system than writing the code...

And why the effing 'ell can't you make all changes in one go?

Maybe next time you should first explain the (il)logic behind such a "requirement", so that we don't have to waste our time figuring out what you want!
Back to top
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 397
Location: Denmark

PostPosted: Wed Jun 03, 2020 1:07 pm
Reply with quote

Actually I don't find that idea stupid at all, I have been doing that for years.
Check out the 'RUN' ISPF edit macro at http://harders-jensen.com/wjtech/zprograms.html
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 350
Location: Bamberg, Germany

PostPosted: Wed Jun 03, 2020 1:16 pm
Reply with quote

@Willy: Please fix the Link destination. It's invalid.
Back to top
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 397
Location: Denmark

PostPosted: Wed Jun 03, 2020 9:23 pm
Reply with quote

This link should work:
Use [URL] BBCode for Links
I had been using the URL tag, must have done something wrong.
Back to top
View user's profile Send private message
AllenSieracki

New User


Joined: 10 Apr 2020
Posts: 12
Location: USA

PostPosted: Wed Jun 03, 2020 9:57 pm
Reply with quote

Thanks very much Willy. I will need to study this more but after a quick review, it looks like it will work very well for my purposes. Thanks very much for posting.

Allen
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Thu Jun 04, 2020 3:53 am
Reply with quote

Quote:
why the effing 'ell can't you make all changes in one go?


I have written some editor macros that were hundreds of lines long. Like any other program, it might take some bit of debugging to get to run to your satisfaction.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> CLIST & REXX
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts Calling Assembler from REXX PL/I & Assembler 5
No new posts REXX/CLIST tool for BCSR and EDSR CLIST & REXX 2
No new posts Calling Rexx program from Cobol CLIST & REXX 12
No new posts REXX script to beautify XML CLIST & REXX 1
No new posts XML-GENERATE to render edited numeric COBOL Programming 0

Back to Top