The ROUTE EDIT Macro for ISPF[Home] [Products] [Support] [Documents] [Partners] [Contact Us] [Search] [Freeware]OverviewROUTE is an ISPF EDIT macro written in REXX. ROUTE writes the data currently being edited or viewed to a SYSOUT data set, or to a work-station file via the ISPF FILEXFER service. Although it can be used as an alternative to PRINTDS, PRINTOFF, or the various PRINT functions of ISPF/PDF, ROUTE is particularly useful to print data that does not exist on disk in a printable form, such as packed data, data modified during the current EDIT session, or data only accessible via the ISPF EDIT or VIEW Interfaces (EDIF/VIIF). ROUTE is free software and available in source-code format in the freeware section of this Web site. |
ROUTE must be invoked as an EDIT macro in an EDIT or VIEW ISPF session.
ROUTE dest SPOOL Destination or WS File Name first First line .A last Last line .B CCHAR Data contains carriage control characters CLASS(class) Class COPIES(copies) Number of copies DEST(dest) Destination (alt) FCB(FCB-name) Name of the FCB FORMS(forms-number) Forms number HOLD/NOHOLD HOLD/NOHOLD TITLE|NOTITLE Print/Do-not-print header PAGELEN(lines) Number of lines per page OUTDES(output-descriptor-name) PORTRAIT|LANDSCAPE Print Format on Laserjet or Xerox 3700 WRITER(external-writer-name) Defaults: CLASS(A) NOCCHAR NOHOLD PAGELEN(60) TITLE
Notes:
Examples:
ROUTE can be found in file 183 of the CBT Tape, and consists of three elements:
To install ROUTE and make it available to ISPF/PDF users, simply copy the REXX exec to a REXX or CLIST library allocated to the TSO/ISPF session in the SYSEXEC or SYSPROC DD concatenations.
You may also copy the ROUTEHLP member to an ISPPLIB data set. This allows TSO users to get help when they enter the ROUTE ? command.
The ROUTEPGM program may be assembled and link-edited into a load-library accessible to ISPF. When ROUTEPGM is present, ROUTE automatically uses it to speed up its processsing. Incidentally, ROUTEPGM is a fairly generic program which can be used by any CLIST or REXX EDIT macro which needs to copy data from the EDIT (or VIEW) session to a data set.
The ROUTE macro itself can be tailored at installation time by modifying two tables it contains:
/*--------------------------------------------------------------------*/ /* */ /* Define Default Values */ /* */ /*--------------------------------------------------------------------*/ Default_Class='A' /* Default CLASS */ Default_Dest='LOCAL' /* DEST defaults to LOCAL */ Default_Dest='' /* User must specify DEST */ Default_Forms='' /* No special form required */ Default_Node='' /* Dest defined on this JES */ Default_Pagelen=60 /* Lines per page */ Print_Line_Numbers='NO' /* Do NOT print line numbers */ Print_Line_Numbers='YES' /* Print line numbers */ Routepgm='XYZ.LOAD' /* Use ISPLLIB LIBDEF */ Routepgm='NO' /* Use the REXX stack and EXECIO */ Routepgm='YES' /* Use the ROUTEPGM program */ xdsn='ISPFCS.TEXT' /* temp dsn for WS download */
Default_Node optionally indicates a default NJE node through which remote printers are accessible. If Default_Node is non-null, ROUTE prepends the specified value to the dest value.
/*--------------------------------------------------------------------*/ /* */ /* Printer Default Attribute Table */ /* */ /* This table defines default attributes for printers. */ /* It must be set up locally for every printer that requires default */ /* attributes different from the values set in the Default_nnnnn */ /* variables above. Hyphens must be used to indicate null values. */ /* */ /* Note: for a JES2 remote, you must use the RMTn format (no leading */ /* zeroes in the numeric portion). */ /*--------------------------------------------------------------------*/ /* PRINTER NODE/NODE.DEST CLASS PAGELEN FORMS FCB MODE */ printer.1 ="LOCAL - A 60 - - - " printer.2 ="DEVV - G 60 - - - " printer.3 ="ROSV - Q 60 - - - " printer.4 ="XRX3700 - Q 60 - - P37 " printer.5 ="ESG3700 DEVV Q 60 - - P37 " printer.6 ="SSG1 DEVV.SSG13287 Q 60 - - L37 "
ROUTE was written in 1988 as a CLIST for ISPF/PDF 2.3, the first release of ISPF/PDF which supported EDIT macros. ROUTE was designed to print EDIT data to a nearby 3287 matrix printer, defined to JES2 as RMT4, or R4. In the 1990s, ROUTE was converted from CLIST to REXX and enhanced for flexibility and speed. In 1995, ROUTE R604 was added to File 183 of the CBT Tape. Support for writing to work-station files via the ISPF FILEXFER service was added in 1998.
Original ROUTE CLIST, ca 1988:
ISREDIT MACRO (DEST,FIRST,LAST)
IF &DEST = &STR() THEN -
DO
WRITENR ENTER DESTINATION:
READ DEST
IF &DEST = &STR() THEN EXIT CODE(8)
END
IF &FIRST = &STR() THEN SET FIRST = .ZFIRST
IF &LAST = &STR() THEN SET LAST = .ZLAST
IF &SUBSTR(1:1,&FIRST) = &STR(.) THEN ISREDIT (FIRST) = LINENUM &FIRST
IF &SUBSTR(1:1,&LAST) = &STR(.) THEN ISREDIT (LAST) = LINENUM &LAST
ISREDIT (DSNAME) = DATASET
ISREDIT (MEMBER) = MEMBER
IF &MEMBER ¬= &STR() THEN SET MEMBER = &STR((&MEMBER))
ISREDIT (LEN) = LRECL
/* IF &LEN > 132 THEN SET LEN = 132
SET LEN = 133
/*
ALLOC DD(DDROUTE) SYSOUT(A) DEST(&DEST) RECFM(F A) BLKSI(&LEN) REUSE
IF &DEST = LOCAL OR &DEST = R0 THEN +
ALLOC DD(DDROUTE) SYSOUT(V) DEST(&DEST) RECFM(F A) BLKSI(&LEN) REUSE
OPENFILE DDROUTE OUTPUT
SET DDROUTE = &STR(USERID=&SYSUID DATE=&SYSDATE TIME=&SYSTIME)
SET DDROUTE = &STR(1&DDROUTE DATASET=&DSNAME&MEMBER)
PUTFILE DDROUTE /* WRITE HEADER
SET CTLCHR=0
SET LINECT=2
/*
DO WHILE (&FIRST LE &LAST)
ISREDIT (DDROUTE) = LINE &FIRST /* GET CURRENT LINE
IF &LEN > 133 THEN SET DDROUTE = &SUBSTR(1:&LEN,&STR(&DDROUTE))
SET DDROUTE = &STR(&CTLCHR&DDROUTE)
PUTFILE DDROUTE /* WRITE CURRENT LINE
SET FIRST = &FIRST+1 /* NEXT LINE NUMBER
SET CTLCHR=&STR( )
SET LINECT=&LINECT+1
IF &LINECT>75 THEN SET CTLCHR=1
IF &LINECT>75 THEN SET LINECT=1
END
CLOSFILE DDROUTE
FREE DD(DDROUTE)
SET &ZEDSMSG = &STR(DATA SET ROUTED) /* SHORT MESSAGE
SET &ZEDLMSG = &STR(YOUR EDIT DATA SET HAS BEEN ROUTED TO DEST(&DEST))
ISPEXEC SETMSG MSG(ISRZ001) /* SEND THE MESSAGE