/* rexx */ /*-------------------------------------------------------------------*/ /* */ /* REXX Exec : PRINTIT */ /* */ /* ***** Edit Macro ***** */ /* */ /* Description : Prints a dataset */ /* */ /* Created on : 01 May 2007 */ /* Created by : Kevin Ferguson */ /* : Userid MIT001 */ /* : Using ABBYDALE.DEVL.REXX(PRINTIT) */ /* */ /* Called by : Nothing */ /* */ /* Calls : PRINTDS (IBM Supplied Program) */ /* */ /* Panels Used : None */ /* */ /* Change Activity : */ /* */ /* ©Copyright of Abbydale Systems LLC. */ /* */ /*-------------------------------------------------------------------*/ Parse Arg Help Class Copies /* Check for Help */ If SYSVAR("SYSISPF")<>"ACTIVE" then do Say "ISPF must be active to use "PRINTIT exit(16) end Address ISREDIT "MACRO (Help Class Copies) PROCESS" signal on novalue /* un-initialized vars*/ signal on halt /* attention key */ If Help = "?" Then do Call Disp_Help ZEDSMSG = 'Help displayed' ZEDLMSG = 'Help information was displayed' ZDLMSG = 'Help displayed' Address ISPEXEC "VPUT (ZDLMSG ZDLMSG) SHARED" Address ISPEXEC "SETMSG MSG(ISRZ001)" exit(4) end if Help = '' then do Dest = 'LOCAL' /* <=== Change to your default printer */ /* LOCAL will print the output to */ /* the LOCAL spool */ end else do Dest = Help end /*********************************************************************/ /* */ /* Now we will set site defaults for any missing parms */ /* */ If Class = '' Then Class = 'A' /* <=== Change to site default */ If Copies = '' Then Copies = '1' /* <=== Change to site default */ /* */ /*********************************************************************/ If translate(Copies,' ','1234567890') <> ' ' Then do ZEDSMSG = 'Copies Value Invalid' ZEDLMSG = 'Non-Numeric Value for copies' ZDLMSG = 'Non-Numeric' Address ISPEXEC "VPUT (ZDLMSG ZDLMSG) SHARED" Address ISPEXEC "SETMSG MSG(ISRZ001)" Exit(8) end If LENGTH(Class) > 1 then do ZEDSMSG = 'Invalid Class' ZEDLMSG = 'Invalid Class Specified' Class ZDLMSG = 'Invalid SYSOUT Class' Address ISPEXEC "VPUT (ZDLMSG ZDLMSG) SHARED" Address ISPEXEC "SETMSG MSG(ISRZ001)" Exit(8) End "ISREDIT (DSN) = DATASET " "ISREDIT (MEM) = MEMBER " if mem <> '' Then do DSNI = DSN'('MEM')' end else do DSNI = DSN end "PRINTDS DSN('"DSNI"') CLASS("CLASS") COPIES("copies") DEST("dest")" ZEDSMSG = 'Dataset Printed' ZEDLMSG = 'Dataset' DSNI 'sent to printer' ZDLMSG = 'Print Successful' Address ISPEXEC "VPUT (ZDLMSG ZDLMSG) SHARED" Address ISPEXEC "SETMSG MSG(ISRZ001)" /* Say "'"DSNI"' Routing "copies" copies of print to" DEST "as class "Class */ return /*-------------------------------------------------------------------*/ /* Disp_Help Procedure */ /*-------------------------------------------------------------------*/ Disp_Help: Procedure say" PRINTIT - This Edit Macro will print the contents of the dataset" say" to a printer. By default the print out will be sent to" say" LOCAL as class A output and one copy only" say"" say" Usage: PRINTIT dest Class Copies | ? " say"" say" ? - Generates this information." say" Dest - Is the print destination (If omitted LOCAL is used)" say" Class - Is the output class to use. (Default is A)" say" Copies - Is the number of copies to print. (Default is 1)" say"" say" Note: If you want to changed the output class then you MUST" say" specify the destination printer. Likewise if you want" say" more than one copy then you must specify both destination" say" printer and output class." say" " say" Return Codes :" say" 4 - Help displayed" say" 8 - Class or Copies value invalid" say" 16 - Not under ISPF" say"" Return /*-------------------------------------------------------------------*/ /* End of Disp_Help Procedure */ /*-------------------------------------------------------------------*/ /*-------------------------------------------------------------------*/ /* Trap NOVALUE Condition */ /*-------------------------------------------------------------------*/ novalue: say "NOVALUE entered from line" sigl say condition("D") say "The instruction is suppressed" address "TSO" "delstack" exit(16) /*-------------------------------------------------------------------*/ /* Trap HALT Condition */ /*-------------------------------------------------------------------*/ halt: say "HALT acknowledged in line" sigl say "Cleanup processing in progress" address "TSO" "delstack" exit(16) /*-------------------------------------------------------------------*/ /* End of PRINTIT */ /*-------------------------------------------------------------------*/