/* REXX | | Name: HLASMTR | | Author: David Alcock | | Purpose: Trim HLASM non-essential output lines | | Note: John Ehrman, the Father of the HLASM, says that all | screen scrappers (and this is one) are living in sin! */ /* -------------------------------------------------------------------- | M o d i f i c a t i o n H i s t o r y | | Person Date Description | ---------- ----------- --------------------------------------------- | DGAlcock 14-NOV-1998 v1.1 Added check for option S +------------------------------------------------------------------ */ vrm = '1.1' mtype = address() PARSE SOURCE s1 s2 s3 s4 s5 s6 s7 s8 s9 if mtype == "TSO" | mtype == "MVS" then , if sysvar(systsoe) > "2040" then systemid = mvsvar(syssmfid) else do cvt = storage(10,4) dcvt = c2d(cvt) smca = storage(c2x(d2c(dcvt+x2d(c5))),3) dsmca = c2d(smca) systemid = storage(c2x(d2c(dsmca+x2d(10))),4) end else systemid = "" if substr(systemid,1,3) == "CSW" then "cls" /* clear screen for Dave */ say "HLASMTR - version "vrm "- Freeware - HLASM listing trimmer" say "Copyright 1998 by David Alcock. All rights reserved." say " " say ". Executing in Environment: "s1 "-" mtype if systemid <> "" then say ". Executing on system: "systemid say " " /*--------------------------------------------------------------------- | Locate args ------------------------------------------------------------------- */ address TSO arg sysut1_dsn sysut2_dsn options /*--------------------------------------------------------------------- | Set options ------------------------------------------------------------------- */ in_good_stuff = 0 if translate(options) == "S" then in_good_stuff = 1 /*--------------------------------------------------------------------- | Verify the input dataset and read it in ------------------------------------------------------------------- */ if sysut1_dsn == "" then do say "Missing input dataset" exit 12 end x = LISTDSI(sysut1_dsn) if x <> 0 then do say "Error accessing DSN:" sysut1_dsn say "> "sysmsglvl1 say "> "sysmsglvl2 say "> SYSREASON: "sysreason exit end sysut1_pdsn = sysdsname parse value sysut1_dsn with . "(" member ")" . if member <> "" then do sysut1_pdsn = sysut1_pdsn"("strip(member)")" end say "%HLASMTR - Processing input file "sysut1_pdsn sysut1_dd = "SYU1"random() address TSO "ALLOCATE FILE("sysut1_dd") DA('"sysut1_pdsn"') SHR REUSE" "EXECIO * DISKR "sysut1_dd" (FINIS STEM sysut1_file." address TSO "FREE FILE("sysut1_dd")" /*--------------------------------------------------------------------- | Verify the output dataset and create it if needed ------------------------------------------------------------------- */ if sysut2_dsn == "" then do sysut2_dsn = "SPFTEMP1.HLASM.TRIMMED" end sysut2_dd = "SYU2"random() x = LISTDSI(sysut2_dsn) if x <> 0 then do say "Creating output file: "sysut2_dsn "ALLOCATE FILE("sysut2_dd") DA("sysut2_dsn")", "UNIT(SYSDA) NEW REUSE SPACE(5 5) TRACKS", "LRECL(137) BLKSIZE(1410) RECFM(V B)" "FREE FILE("sysut2_dd")" y = LISTDSI(sysut2_dsn) if y <> 0 then do say "Internal error after allocate of SYSUT2 file, terminating" exit 20 end end sysut2_pdsn = sysdsname parse value sysut2_dsn with . "(" member ")" . if member <> "" then do sysut2_pdsn = sysut2_pdsn"("strip(member)")" end "ALLOCATE FILE("sysut2_dd") DA('"sysut2_pdsn"') SHR REUSE" /*--------------------------------------------------------------------- | Read the HLASM SYSPRINT output and trim out ANSI bytes and titles ------------------------------------------------------------------- */ do i = 1 to sysut1_file.0 if in_good_stuff == 0 then do if substr(sysut1_file.i,4,4) == "Loc " then , in_good_stuff = 1 iterate end if substr(sysut1_file.i,1,1) == "1" then do if word(sysut1_file.i,2) == "Ordinary" then i = sysut1_file.0 if word(sysut1_file.i,2) == "Diagnostic" then i = sysut1_file.0 if word(sysut1_file.i,2) == "Macro" then i = sysut1_file.0 iterate end if substr(sysut1_file.i,4,6) == "Active" then iterate if substr(sysut1_file.i,4,4) == "Loc " then iterate queue substr(sysut1_file.i,2,length(sysut1_file.i)-1) end /********************************************************************* * That's all folks... *********************************************************************/ queue '' /* add null line to indicate End-Of-File */ address TSO "EXECIO * DISKW "sysut2_dd" (FINIS" address TSO "DELSTACK" address TSO "FREE FILE("sysut2_dd")"