WRKUSROUTQ - A WRKSPLF/WRKOUTQ hybrid with extra functions
WRKUSROUTQ lets you work with spool files across multiple output queues and users, filtering the list for specific files, users and user data. You can view formatted (empty lines included) spoolfiles and save spoolfiles as streamfiles (either .txt or .html). It can also trigger (via RUNRMTCMD) your PC to open the file just created in your choice of application (Word, Excel, Textpad, IE, Vim, etc). There's an option to send the files via FTP, defaulting to the pc you're using for your emulation session. The main functions are contained in seperate routines which allow their use as APIs for automated/unattended conversion/transfer. I've used it that way to generate a web archive of our sales force's monthly reports, with an easy to navigate index. Using my GNU/Linux box I've converted the text files into Acrobat documents so they print off nicely as landscape A4 - let me know if you'd like the code I use.
A number of enhancements have been made since originally releasing this utility. WRKUSROUTQ now does subsetting by string searches within the spoolfile as well as by file attributes. F20=Save settings
was added to the PC setup window, helpful if you regularly need to use non-default settings. The password is saved too, but in a disguised form. It wouldn't be obvious from looking at the file directly, but if it's a concern there are several options. 1) Save settings before entering the password, and enter it via F8 each session. 2) Set the settings file authority to *PUBLIC *EXCLUDE and run the program under adopted authority so only the program can read/update the file. 3) Come up with a better solution and send me a patch
Also the subfile paging has been improved. You can now process more than a screen full of options at a time, and cursor positioning should be more sane too. As yet I still
haven't packaged up all the enhancements to the tool,so you'll need to install the search add-on (see Download below). You'll also need the progress meter
I released recently, as that's used too.
It has its limitations - the formatting and stream file functions only work with *SCS spool files. If you want to do these sort of things with *IPDS or *AFPDS files, you'll need to look elsewhere - BVS Tools
, RJS Software
and Ariadne software
are worth looking at. On the plus side, you have the code to play with so you can add any additional functionality yourself
- OUTQ - A qualified output queue name (library value defaults to *LIBL) or one of the special values *JOB, *OUTQLIST or *USRSPLF
- OVRUSER - the user profile used when *USRSPLF specified for OUTQ. Defaults to *CURRENT
*JOB is the default, and is the equivalent of WRKOUTQ for the current job's default queue. *OUTQLIST will show all spoolfiles in a list of one or more *OUTQs (a per user setting). *USRSPLF is the equivalent of WRKSPLF with the current or nominated user profile.
Here's the main screen. You can switch views by the familiar F11, and use most of the usual numeric options. 7 to display messages isn't there, as I haven't figured out how to do that yet, but you can get there via option 9, then 2 from the Print status screen
The character options are my extras.
- F to convert the spoolfile to a streamfile and send it somewhere via FTP
- P to invoke RUNRMTCMD to a Client Access PC to open (copy or whatever) the streamfile
- T to just dump a converted spoolfile to the IFS
- V to view the spoolfile with line spacing & underlining intact (where possible).
The streamfile can be either plain text or HTML formatted. You can choose if the original formatting (a la option V) is used.
This is the defaults screen for the PC file conversion options. See the on-line help for full details
Here's the override panel - if you want to change any of the defaults set above, or change the auto-generated name or HTML title, do so here. Again, check the on-line help. I'm FTPing one of the files to my home PC from Netshare400's machine in the States. My IP address is picked up automatically (if not specified), courtesy of Tom Liotta's RTNIPADDR command (details in the on-line help)
Reporting the transfer
Using F17 to select multiple *OUTQs to work with. Your choices are saved, so if you use the *OUTQLIST parm on WRKUSROUTQ, you'll get the same selection. Details are held in file DBGUOL00.
The result of the above selection
If you want to see the output of the earlier FTP transfer of a web page, look here
. Note that the HTML wrapper around the text file generated are configurable. Run WRKOLD and check out documents HTMLSTART and HTMLEND.
Here's a shot of the restrictor/subset facility. File and User data match on starting characters, User must be exact.
This is the search dialog window. Being daring here and going for a case insensitive match.
The active search, with all *SCS type files in the current selection being scanned one by one.
Finally we're left with just two files that start with 'D' and contain the string 'Transfer'.
(36Kb) - WRKUSROUTQ main code - packaged in SRCPARSER format
(26Kb) - Search add-on, plus enhancements. Packaged in XML installer format.
If you haven't already done so, you must
first, as they share a number of common files & programs, and it won't compile or run without them. Installation instructions
for WRKUSROUTQ require you to build & run MAKEDBGSPL. If you want the latest version, install the progress meter
& search add-on (see above) over the top of your existing WRKUSROUTQ, following the XML installation instructions
. If you have problems compiling program DBG188R4?
because of a missing QUSEC /COPY member then replace the /COPY with this code
- sorry for the inconvenience.