/* REXX ***************************************************************/ /* -------------------------------------------------------------------*/ /* Name: ET (EditThis) */ /* Short When changes made, using VIEW, type ET, and you will */ /* see all the changes in the editor. */ /* Type: REXX-Macro */ /* Author: Norbert Haas & Meik Naujeck */ /* Syntax: ET [-] */ /* Parameter: - = Cancel the changes, just open the editor */ /* Remark: Needs macros ET2, */ /* MCANCEL and */ /* Function WHOHELDS() */ /* */ /* Version Author Date Why */ /* ------- ------------- ---------- --------------------------------- */ /* V02.00 Haas 30.05.2003 english version and CUT (no VCUT) */ /* V01.00 Haas&Naujeck 29.04.1998 Creation */ /**********************************************************************/ "ISPEXEC CONTROL ERRORS RETURN" /* Some not executed linecommands ?---------------------------------- */ "ISREDIT MACRO (parm) NOPROCESS" IF rc /= 0 THEN DO zedsmsg = 'ET not possible' zedlmsg = 'Some linecommands have not yet been finished.', 'Please type RESET and try again.' "ISPEXEC SETMSG MSG(isrz001)" EXIT END /* Init ------------------------------------------------------------- */ "ISREDIT (dsn) = DATASET" "ISREDIT (mem) = MEMBER" IF mem = '' THEN dsn_mem = "'" || dsn || "'" ELSE dsn_mem = "'" || dsn || "(" || mem || ")'" /* Edit possible (Editmode or Viewmode) ? --------------------------- */ "ISPEXEC EDIT DATASET("dsn_mem") MACRO(MCANCEL)" IF RC = 14 THEN DO zedsmsg = "ET not possible" zedlmsg = "Macro ET can't open" dsn_mem", because it is used", 'by' WHOHELDS(dsn_mem)"." "ISPEXEC SETMSG MSG(ISRZ001)" EXIT -8 END /* Are there changes ? ---------------------------------------------- */ "ISREDIT (etchg) = DATA_CHANGED" /* with changes ? --------------------------------------------------- */ IF parm = '-' THEN etwc = 'NO' ELSE DO etwc = 'YES' IF etchg = 'YES' THEN "ISREDIT CUT et$copy .ZF .ZL" END /* notice cursorposition, lines and columns ------------------------- */ "ISREDIT (lrecl) = LRECL" "ISREDIT (etrow,etcol) = CURSOR"; IF etcol > lrecl THEN etcol = 1 "ISREDIT (etdl1,etdl2) = DISPLAY_LINES"; IF rc > 0 THEN etdl1 = 1 "ISREDIT (etdc1,etdc2) = DISPLAY_COLS" /* notice all labels ------------------------------------------------ */ etlabels = '' "ISREDIT LOCATE FIRST LABEL" DO WHILE RC = 0 "ISREDIT (top,bot) = DISPLAY_LINES" "ISREDIT (label) = LABEL" top "ISREDIT CURSOR =" top 1 etlabels = etlabels STRIP(label) top + 0 "ISREDIT RESET LABEL" .ZCSR .ZCSR "ISREDIT LOCATE FIRST LABEL" END /* notice all excludet lines ---------------------------------------- */ etexcl = '' "ISREDIT LOCATE FIRST EXCLUDED" DO WHILE RC = 0 "ISREDIT (top,bot) = DISPLAY_LINES" "ISREDIT CURSOR =" top 1 etexcl = etexcl top + 0 "ISREDIT RESET EXCLUDED" .ZCSR .ZCSR "ISREDIT LOCATE FIRST EXCLUDED" END /* put vars into sharedpool ----------------------------------------- */ "ISPEXEC VPUT (etrow,etcol,etdl1,etdc1,etwc,etchg,etlabels", "etexcl) SHARED" /* call edit with macro et2 ----------------------------------------- */ temp = 'SCRNAME EDITTHIS' "ISPEXEC DISPLAY COMMAND(temp)" "ISPEXEC EDIT DATASET("dsn_mem") MACRO(ET2)" edit_rc = rc IF edit_rc = 14 THEN DO zedsmsg = 'ET not possible' zedlmsg = 'Dataset' dsn_mem 'in use by' WHOHELDS(dsn_mem)'.' "ISPEXEC SETMSG MSG(isrz001)" EXIT END /* last message (after edit) ---------------------------------------- */ zedsmsg = '' zedlmsg = 'The ET-Macro finished successful.' "ISPEXEC SETMSG MSG(isrz000)" "ISREDIT CANCEL" EXIT