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