EditMacro "ISREDIT END" does not close Member/PS-Dataset



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

Re: EditMacro "ISREDIT END" does not close Member/PS-Dataset

Postby prino » Fri Oct 05, 2012 4:05 am

steinef wrote:Well what I want to do is to change the panel.

I have two panels for ISREDDE4. One is the usual one that everyone knows and the second one has an extended command line over two lines. I want to be able to enable the second panel if required and disable if no longer needed.

Holy fluck, what an imbecile idea. Don't you know that ISPF caches panels?

If you need a long command line, why not let the macro display a pop-up where you can enter your commands, which are subsequently executed by said macro?
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 536
Joined: Wed Mar 11, 2009 12:22 am
Location: Oostende, Belgium
Has thanked: 3 times
Been thanked: 21 times

Re: Re: EditMacro "ISREDIT END" does not close Member/PS-Dataset

 

Re: EditMacro "ISREDIT END" does not close Member/PS-Dataset

Postby steinef » Wed Nov 28, 2012 7:13 pm

Hi guys (and gals),

I am deeply sorry for my late response, but this macro is like a pet to.

Now I am happy to present a working edit macro, which does exactly what I wanted to.

Please feel free to use it. If you have any questions, don't hesitate.


/* REXX *****************************************/
/* ------------------------------------------------------*/
/* Name:       LINE                                                   */
/* Short:      Initial Macro                                          */
/* Typ:        REXX-Macro                                             */
/* Function:   Turns a second command line on or off                  */
/*             Needs Macro MCANCEL and a predefined paneld (SCLINE)   */
/*             which has e second command line in the editor.         */
/*             The Member SCLINE must be in the USER.PANELS Dataset   */
/*             which must be preallocated.                            */
/*                                                                    */
/* Parameters: on or off                                              */
/*                                                                    */
/*******************************************************/

"ISREDIT MACRO (parm) NOPROCESS"

/* Check if correct parms are used ************ */
  IF parm = '' THEN DO
    zedsmsg = 'Macro Error'
    zedlmsg = 'Parameter ist missing. Must be on or off'
    "ISPEXEC SETMSG MSG(isrz000)"
    EXIT
  END

  IF parm /= 'on' THEN DO
  IF parm /= 'off' THEN DO
    zedsmsg = 'Macro Error'
    zedlmsg = 'Macro parameter must be on or off.'
    "ISPEXEC SETMSG MSG(isrz000)"
    EXIT
  END
  END

/* Define Variables *************************** */
"ISREDIT (dsn) = DATASET"
"ISREDIT (mem) = MEMBER"

IF mem /= "" THEN
dsn = dsn!!"("!!mem!!")"

tempcmd = "SCRNAME TMP PERM"
tmpvar = "7`X`X`swap tmp"   /* ` -> is the command delimiter */

"ISPEXEC VGET ZPANELID"
panelid = ZPANELID

/* Beginn of the macro ************************ */

"ISREDIT BUILTIN SAVE"

"ISPEXEC DISPLAY COMMAND(tempcmd)"

/* Second line activation ********************* */
IF parm="on" THEN DO
  IF SYSDSN("'"USERID()".USER.PANELS(SCLINE)'")<>'OK' THEN DO
    zedsmsg = 'Macro Error'
    zedlmsg = 'Second command line allready in use.'
    "ISPEXEC SETMSG MSG(isrz000)"
    EXIT
  END

  "ISREDIT CANCEL"
  "TSO RENAME '"USERID()".USER.PANELS(SCLINE)',
   '"USERID()".USER.PANELS("panelid")'"
     "ISPEXEC CONTROL NONDISPL END"
     "ISPEXEC SELECT PGM(ISPSTRT) SCRNAME(TEMP) PARM("tmpvar")"
  "ISPEXEC VIEW DATASET('"dsn"') MACRO(MCANCEL)"
END

/* Second line deactivation ******************* */
IF parm="off" THEN DO
  IF SYSDSN("'"USERID()".USER.PANELS("panelid")'")<>'OK' THEN DO
    zedsmsg = 'Macro Error'
    zedlmsg = 'Second command line allready off.'
    "ISPEXEC SETMSG MSG(isrz000)"
    EXIT
  END
  "ISREDIT CANCEL"
  "TSO RENAME '"USERID()".USER.PANELS("panelid")',
   '"USERID()".USER.PANELS(SCLINE)'"
     "ISPEXEC CONTROL NONDISPL END"
     "ISPEXEC SELECT PGM(ISPSTRT) SCRNAME(TEMP) PARM("tmpvar")"
  "ISPEXEC VIEW DATASET('"dsn"') MACRO(MCANCEL)"
END                              /* Macro MCANCEL closes the Dataset  */
                                 /* by issuing ISREDIT CANCEL as only */
"ISREDIT CANCEL"                 /* statement.                        */

/* Macro successfully completed *************** */
zedsmsg = 'Macro complete'
zedlmsg = 'Macro successfully completed.'
"ISPEXEC SETMSG MSG(isrz000)"

EXIT


Code'd
"Freedom is not worth having if it does not include the freedom to make mistakes"

Gandhi
steinef
 
Posts: 9
Joined: Mon Oct 01, 2012 9:31 pm
Location: Muenster, Germany
Has thanked: 0 time
Been thanked: 0 time

Re: EditMacro "ISREDIT END" does not close Member/PS-Dataset

Postby BillyBoyo » Wed Nov 28, 2012 7:31 pm

If you like it, you should at least take the time to present it well, in the Code tags and using the Preview button to get it looking its best here. I've done some of it, but I'm not going to change the rest which doesn't "fit" into the display box. If you'd like to post a formatted version, it would be good.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: EditMacro "ISREDIT END" does not close Member/PS-Dataset

Postby Pedro » Thu Nov 29, 2012 5:11 am

I do not understand the renaming... why not just specify the second panel name:
"ISPEXEC VIEW DATASET('"dsn"') PANEL(SCLINE)
Pedro Vera
User avatar
Pedro
 
Posts: 569
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 39 times

Re: EditMacro "ISREDIT END" does not close Member/PS-Dataset

Postby steinef » Thu Nov 29, 2012 6:33 pm

Because in that case I can only VIEW the Dataset.

Since it is still open and I can't perform a proper "ISREDIT END" or "ISREDIT CANCEL" I can't do another EDIT on that Dataset/Member.

I would have to open that Dataset in VIEW mode with the new panel, perform my changes, cut the content of the Dataset/Member, close the VIEW Session, and paste it in the beneath lying EDIT Session. I guess that would work, but it is not a solution I would prefer.

To be honest, I like to test the idea of prino: Creating a pop-up panel which receives the long command and passes it to the edit session. I picture this a bit like the panel of option 6 in the Primary Option Menu. But I am not sure whether I can combine commands writen in an extra pop-up panel with line commands in the edit session.

The proof of the pudding is in the eating. - I'll keep you guys posted. Thanks again for your ideas. I honestly appreciate it
"Freedom is not worth having if it does not include the freedom to make mistakes"

Gandhi
steinef
 
Posts: 9
Joined: Mon Oct 01, 2012 9:31 pm
Location: Muenster, Germany
Has thanked: 0 time
Been thanked: 0 time

Re: EditMacro "ISREDIT END" does not close Member/PS-Dataset

Postby Pedro » Thu Nov 29, 2012 7:31 pm

Because in that case I can only VIEW the Dataset.


I was not questioning the use of VIEW... I questioned why you rename from &ZPANELID to CLINE and back. You can use CLINE without renaming it by specifying the panel name on the VIEW service call.
Pedro Vera
User avatar
Pedro
 
Posts: 569
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 39 times

Re: EditMacro "ISREDIT END" does not close Member/PS-Dataset

Postby steinef » Thu Nov 29, 2012 7:50 pm

To make it permanent in the editor.

The panels are usally named ISREDDEx but I don't know the exact name beforehand (ISREDDE4, ISREDDE3) . So I get the name by reading ZPANELID and change the name of my SCLINE panel to that value, so the new panel should be activated permanently.
"Freedom is not worth having if it does not include the freedom to make mistakes"

Gandhi
steinef
 
Posts: 9
Joined: Mon Oct 01, 2012 9:31 pm
Location: Muenster, Germany
Has thanked: 0 time
Been thanked: 0 time

Previous

Return to TSO & ISPF

 


  • Related topics
    Replies
    Views
    Last post