/* REXX */ /* */ /* AUTHOR: Mark Zelden */ /* Last Updated 08/14/2009 */ /***********************************************************/ /* FVE - Fast View/Edit */ /* */ /* Command to VIEW or EDIT members from libraries. */ /* It is intended to be used with ISPF command table */ /* entries to create "shortcuts" for VIEWing/EDITing */ /* data sets or data set concatenations. */ /***********************************************************/ /* Here are example command table entries for short cuts */ /* to VIEWing/EDITing SYS1.PARMLIB and SYS1.PROCLIB: */ /* */ /* VERB = PARM */ /* ACTION = SELECT CMD(%FVE PARM &ZPARM) NEWAPPL(ISR) */ /* VERB = PROC */ /* ACTION = SELECT CMD(%FVE PROC &ZPARM) NEWAPPL(ISR) */ /* */ /* Assuming the above command table entry, the invocation */ /* syntax for VIEWing/EDITing SYS1.PARMLIB would be: */ /* */ /* PARM mbrname */ /* */ /* MBRNAME = Any valid member name or pattern */ /* MODE = VIEW , EDIT, or BROWSE */ /* */ /* The default mode is set below for each library in the */ /* REXX code. It can be overriden when specified as the */ /* second parm. If you want to override the default mode, */ /* and see all members of the library, then you must */ /* specify '*' as the second parameter. */ /* */ /* EXAMPLES: PARM (VIEW all members) */ /* PARM * E (EDIT all members) */ /* PARM PROG* */ /* PARM PROG* BROWSE */ /* PARM IEA* EDIT */ /* PARM IEA* E */ /* PARM IEA* V */ /* PARM IEA* B */ /* */ /* If you don't want to (or can't) update the ISPF */ /* command table, you can still use this as a "regular" */ /* REXX exec. */ /* */ /* EXAMPLES: TSO %FVE PARM (VIEW all members) */ /* TSO %FVE PARM * E (EDIT all members) */ /* TSO %FVE PARM PROG* */ /* TSO %FVE PARM PROG* BROWSE */ /* TSO %FVE PARM IEA* EDIT */ /* TSO %FVE PARM IEA* E */ /* TSO %FVE PARM IEA* V */ /* TSO %FVE PARM IEA* B */ /* */ /***********************************************************/ /* *** WARNING *** WARNING *** WARNING *** WARNING *** */ /* */ /* When working with library concatenations in EDIT mode, */ /* the member will always appear as though it was found */ /* in the first library when selected - regardless of */ /* which library it was actually found in. This also */ /* means that any SAVE command (either explicit or */ /* AUTOSAVE) will be attempted to the first library in */ /* the concatenation. VIEW and BROWSE will show the */ /* proper library when you select a member by exact name */ /* or from a member list. This is standard ISPF behavior */ /* when working with concatenations and can't be changed. */ /* */ /***********************************************************/ /* TRACE ?R */ arg VERB MBR MODE /***************************************/ /* Determine system name, smfid and */ /* sysclone for later usee */ /***************************************/ SYSNAME = Mvsvar('SYSNAME') /* SYSNAME value */ SMFNAME = Mvsvar('SYSSMFID') /* SMFID value */ SYSCLONE = Mvsvar('SYSCLONE') /* SYSCLONE value */ /***************************************/ /* Define libraries and modes below */ /***************************************/ Select When VERB = 'CNTL' | VERB = 'MYCNTL' then do If MODE = '' then MODE = 'EDIT' DSN = "'userid.lib.CNTL'" End When VERB = 'MACLIB' then do If MODE = '' then MODE = 'VIEW' DSN = "'SYS1.MACLIB','SYS1.MODGEN'" End When VERB = 'VTAM' then do If MODE = '' then MODE = 'VIEW' DSN = "'SYS1.VTAMLST'" End When VERB = 'PARM' then do If MODE = '' then MODE = 'VIEW' DSN = "'SYS1.PARMLIB','SYS1.IBM.PARMLIB'" /* dflt */ If SMFNAME = 'SYSA' | , SMFNAME = 'SYSB' | , SMFNAME = 'SYSC' then do DSN = "'SYS1.PRODPLEX.PARMLIB','SYS1.IBM.PARMLIB'," || , "'SYS1.SHASPARM'," || , "'SYS1.PARMLIB'" End If SMFNAME = 'SYSD' | , SMFNAME = 'SYSE' then do DSN = "'SYS1.TESTPLEX.PARMLIB','SYS1.IBM.PARMLIB'," || , "'SYS1.SHASPARM'," || , "'SYS1.PARMLIB'" End End When VERB = 'IPLPARM' then do If MODE = '' then MODE = 'VIEW' DSN = "'SYS1.IPLPARM'" /* DSN = "'SYS1.PARMLIB'" */ /* use parmlib for IPLPARM */ End When VERB = 'PROC' | VERB = 'SYSPROC' then do If MODE = '' then MODE = 'VIEW' DSN = "'SYS1.PROCLIB','SYS1.IBM.PROCLIB'" /* dflt */ If SMFNAME = 'SYSA' | , SMFNAME = 'SYSB' | , SMFNAME = 'SYSC' then do DSN = "'SYS1."SMFNAME".PROCLIB'," || , "'SYS1.PRODPLEX.PROCLIB'," || , "'SYS1.PROCLIB'," || , "'SYS1.IBM.PROCLIB'" End If SMFNAME = 'SYSD' | , SMFNAME = 'SYSE' then do DSN = "'SYS1."SMFNAME".PROCLIB'," || , "'SYS1.TESTPLEX.PROCLIB'," || , "'SYS1.PROCLIB'," || , "'SYS1.IBM.PROCLIB'" End End When VERB = 'PRODPROC' then do If MODE = '' then MODE = 'VIEW' DSN = "'PROD.PROCLIB1'," || , "'PROD.PROCLIB2'," || , "'PROD.PROCLIB3'," || , "'PROD.PROCLIB4'" End When VERB = 'PRODJCL' then do If MODE = '' then MODE = 'VIEW' DSN = "'PROD.JCLLIB1'," || , "'PROD.JCLLIB2'," || , "'PROD.JCLLIB3'," || , "'PROD.JCLLIB4'" End /***************************************/ Otherwise Say 'FVE001E - Error in ISPF Command Table or' , 'command/library not coded in FVE EXEC' Exit 12 End /* select */ /* */ Address TSO junk = msg(off) ddnm = 'DD'||random(1,99999) /* choose random ddname */ "FREE FILE("||ddnm||")" "ALLOC FILE("||ddnm||") SHR REUSE DA("||dsn||")" junk = msg(on) /* */ Address ISPEXEC "CONTROL ERRORS RETURN" "LMINIT DATAID(TEMP) DDNAME("||ddnm||")" /* */ MODE = Strip(MODE) /* remove leading & trailing blanks */ If Abbrev('EDIT',MODE,1) <> 0 then , If mbr = '' | mbr = '*' then "EDIT DATAID("||temp")" Else "EDIT DATAID("||temp") MEMBER("||mbr||")" Else If Abbrev('VIEW',MODE,1) <> 0 then , If mbr = '' | mbr = '*' then "VIEW DATAID("||temp")" Else "VIEW DATAID("||temp") MEMBER("||mbr||")" Else If Abbrev('BROWSE',MODE,1) <> 0 then , If mbr = '' | mbr = '*' then "BROWSE DATAID("||temp")" Else "BROWSE DATAID("||temp") MEMBER("||mbr||")" Else do zedsmsg = 'Invalid mode-BROWSE used' zedlmsg = 'The mode specified was not "EDIT"/"VIEW"/"BROWSE".', '"BROWSE" mode was used.' "SETMSG MSG(ISRZ001)" /* msg - with alarm */ If mbr = '' | mbr = '*' then "BROWSE DATAID("||temp")" Else "BROWSE DATAID("||temp") MEMBER("||mbr||")" End /* */ RETCD = RC If RETCD = 4 then RETCD = 0 IF RETCD <> 0 THEN Address ISPEXEC "SETMSG MSG(&ZERRMSG)" "LMFREE DATAID("||temp")" Address TSO junk = msg(off) "FREE FILE("||ddnm||")"