WAAPDSUT - WAA (written by EDS corporate software in Dallas) P (program) DSUT (dataset utility)
Originally written for DOS in the '60s, this utility was the most heavily used dataset printing/dumping/comparing/ repairing etc. tool used by EDS systems engineers. EDS naming standards were for the first three characters to represent where the program was written. The 4th character indicated what type of object (P=program, S=subroutine, M=macro, , Y=COBOL copybook, etc.) The last four characters were left to the programmer, and usually gave a hint as to the function. WAAPDSUT(dataset utility), WAASDATE(date manipulation subroutine), WAAPSPLT(a report splitter), WAAPISAM(ISAM version of WAAPDSUT)
WAAPDSUT can read 1 or 2 sequential files, and write from 1 to 5 sequential output files.
SYSUT1 - Primary input file (Required)
SYSUT1A - Secondary Input file (Optional)
SYSUT2 thrU SYSUT5 are output files (Optional)
SYSIN - Pseudo-assembler control cards (Optional)
SYSPRINT - Print output, and Statistics report
Without SYSIN control cards, there are default actions which depend upon which DDNAMES are present in the JCL.
SYSUT1 only - Print SYSUT1 on SYSPPRINT
SYSUT1 and SYSUT1A - Compare files, and report on differences only
SYSUT1 and SYSUT2 - Copy SYSUT1 to SYSUT2
Output file DCB parameters are copied from SYSUT1, unless they are overridden in the JCL.
JCL supplied DCB parameters take precedence, and override the catalog values (For example: Recfm FB / VB files can be read by block by specifying RECFM=U)
An interesting feature is that concatenations of files on SYSUT1, SYSUT1A, and SYSIN can be different RECFMs or LRECLS. (Don't really know why you'd want to do this)
WAAPDSUT can call subroutines. (like WAASDATE to do date manipulations)
Pseudo Registers: RX-SYSUT1 record pointer, RY-SYSUT1A record pointer, RZ-4k scratchpad area address, RV and RW are for programmer use.
The SYSIN cards are a subset of explicitly coded assembler instructions, plus functions accessed via special B or BAL instructions. The B (branch) to a function causes the function to be performed, and then the SYSIN code is re-entered from the top. When using BAL, control is returned to the next instruction.
The special functions are DELETE, KEEP, SYSUT2, SYSUT3, SYSUT4, SYSUT5, DITTO, COMPFAIL, DUMP, and PRINT.
DELETE(RX), DELETE(RY), or DELETE (read another record from either SYSUT1, SYSUT1A, or both)
KEEP(RX), KEEP(RY), or KEEP (write record from SYSUT1, SYSUT1A, or both to SYSUT2)
SYSUT#(R?) WHERE #=2,3,4,or 5 (output file), AND ?=V,W,X,Y, or Z (pseudo register)
Note: KEEP and SYSUT2 both write to SYSUT2.
KEEP can only use pseudo registers RX, RY, or blank(both RX and RY) If a branch, new record(s) are read.
SYSUT2 can only y If the pseudo register is omitted, it applies to both SYSUT1 and SYSUT1a
COMPFAIL (print line over-line comparison of SYSUT1 and SYSUT1A records in DUMP format)
DITTO(R?) (print data pointed to by a pseudo register in a 3 line format Char/Hex Zone/Hex Digit)
DUMP(R?) (print data pointed to by a pseudo register in dump format)
PRINT(R?) (print data pointed to by a pseudo register in Zoned Decimal format)
Lengths of areas pointed to by a pseudo register are stored in halfwords refered to as LEN# where #= V,W,X,Y,Z LENX and LENY are set automatically when a record is read. You must set the others before using the corresponding pseudo-register in a function. ( ex. 10 MVC LENZ,=H'100' )
SYSIN cards must be terminated by an "END" statement.
Special labels EOFX and EOFY are used when end-of-file on the respective file is reached. If absent, processing stops when the first input file reaches eof. If additional records exist on the other file, it is noted in the report in SYSPRINT.
A special form of the CLC instruction is used to compare SYSUT1 and SYSUT1A records without needing to code the length. ( CLC RX,RY )
If you need help interpreting existing instances out there, let me know. I'll also try to dig out the documentation.