Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to invoke ISPEXEC EDIT without displaying the panels 1

Status
Not open for further replies.

trlowe

Programmer
Jul 26, 2006
4
US
I have been searching for this answer and decided to just ask. I have a REXX exec that I am using to process every member of a PDS to do search and replace. However, when I invoke the EDIT command so I can run the edit macros (and change commands) the EDIT panel shows and waits until I press PF3 to exit. I want to EDIT behind the scenes without the panel being displayed. Can someone tell me how? Nothing I have tried works.

ADDRESS ISPEXEC "CONTROL NONDISPL"
ADDRESS ISPEXEC "EDIT DATAID("FILEID") MEMBER("MEMBER")"
IF RC = 0 THEN
DO
SAY editting MEMBER
address ispexec "ISREDIT FIND ' JOB '"
. . .
 
Make sure you specify an EDIT MACRO in your "EDIT DATAID..." Like

Address ISPEXEC "EDIT DATAID("FILEID") MEMBER("MEMBER") MACRO("macname")"

After you've done all your changes, the macro should contain either a:
Address ISREDIT "END" /*To save the changes */
or
Address ISREDIT "CANCEL" /*to cancel the changes */

Hope this helps.

Denis
 
Forgot to mention, the MACRO you call is actually another REXX program.

You put all your ISREDIT commands in there.

Denis
 
Thanks DProv.

I have the macro name in there as you suggest and that part is working. What I would like to do though is have the member be editted with the macro but without the EDIT session being seen on the screen by the user. Basically behind the scenes. Can you tell me how to accomplish that? Thanks again.

 
Macname is just a name...Like I said, this is another REXX pgm.

"macname" could look like this :

/* REXX */
Address ISREDIT "MACRO (PARM)"
Address ISPEXEC "CONTROL ERRORS RETURN"

address ispexec "ISREDIT FIND ' JOB '"
etc...
Address ISREDIT "END" /* to save the member */
exit
/* end of macro */

The ISREDIT "END" statement will cause your edit screen not to be shown.

Are you using LMINIT/LMOPEN and LMMLIST services to process each member?
 

>>Are you using LMINIT/LMOPEN and LMMLIST services to process each member?<<

Yes. I am by no means an expert in REXX and I found a sample online that had that logic in it and I just made my changes around it. I would suspect there are better ways to loop through the PDS directory and do change commands on each one (or only selected ones) but I don't know it. I have seen some that use an EXECIO command but I have never used that one. I VERY open to suggestions from you guys.

Terry
 
Using LM functions and EDIT macros allow you to issue ISPF edit commands like FIND CHANGE etc... you can also use EXECIO to edit any dataset but your code will be completely different.

Can you list both programs? THis will give me a better idea of what's not working.



BTW, I made a slight mistake:


Address ISPEXEC "EDIT DATAID("FILEID") MEMBER("MEMBER") MACRO("macname")"
should read:
Address ISPEXEC "EDIT DATAID("FILEID") MEMBER("MEMBER") MACRO(macname)"
 
I to am having problems with a similar program & macro. The list panel displays and I have to make a selection after the LMLIST statement before the macro is even called.

Here is the basic code:
/* REXX PROGRAM EDITPDS */
DATASET = "my.pds.dataset"
ADDRESS 'ISPEXEC'
"LMINIT DATAID(INPUTDD) DATASET('"DATASET"') ENQ(SHRW)"
"LMOPEN DATAID("INPUTDD") OPTION(INPUT)"

MBR = ' '
SAVERC = 0

DO WHILE (SAVERC = 0) & (ENDNOW \= 'Y')
"LMMLIST DATAID("INPUTDD") MEMBER("MBR") OPTION(LIST) STATS (NO)"
SAVERC = RC

SAY "CALLING CHGALL MACRO"
"EDIT DATAID("INPUTDD") MEMBER("MBR") MACRO(CHGALL)"
/* while testing - ensure an exit to the loop */
SAY "TYPE 'Y' TO QUIT"
PULL ENDNOW
END /* end do */
"LMCLOSE DATAID("INPUTDD")"
"LMFREE DATAID("INPUTDD")"



/* REXX MACRO PROGRAM CHGALL */
SAY "CHGALL MACRO ENTERED"
"ISREDIT MACRO PROCESS"
"ISREDIT X ALL"
"ISREDIT C 'BN' 'B1' FIRST"
"ISREDIT END"
ADDRESS 'ISPEXEC'
RETURN



I get the "CALLING CHGALL MACRO" message and then a List Panel comes up. Once I exit from the List Panel then the macro starts and I get the "CHGALL MACRO ENTERED" message.

I just want to step through each member of the PDS running the change macro against each member without having any Panels appear. What am I doing wrong? Any help would be very greatly appreciated.

Kirby
 
All you have to do is remove the double quotes around MBR on your LMMLIST statement

"LMMLIST DATAID("INPUTDD") MEMBER("MBR") OPTION(LIST) STATS (NO)"

Should be
"LMMLIST DATAID("INPUTDD") MEMBER(MBR) OPTION(LIST) STATS (NO)"

Hope this helps
 
That was the problem. Now it works like a champ.

Thanks DProv!!
 
Thanks for the help DProv. I love talking to smart people.

Mine is working as it should now. I think I will expand it now to display the member list and allow the user to select from the list and then process those members. Also, I may try the EXECIO so I can have a little bit more control over the changes instead of using an edit macro. Do you know of any code samples you could recommend that might help me?

Oh if only I could get the boss to buy File-Aid!!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top