/* REXX | | Name: BUCKETPP | | Author: David Alcock | dave@PlanetMVS.com | | Purpose: Processes buckets from IBMlink for PTFs for the given | FMIDS. All PTFs that match the FMID will be written | out in a list (suitable for RECEIVE and APPLY-CHECK). | | Doing this by hand "Pales In Comparison" | | Note: This command is a BIKINI command | | BIKINI Is Knot IEBIBALL Nor IEBEYEBALL | | Please double check the bucket with your eyes | (just a thorough as if it were your favorite supermodel | in the annual Sport Illustrated Swimsuit issue) | | Limitations: Dependant on the format of the text in the bucket. | The code processes these line types: | | a: Subset 3494B18/S390 | b: 2. 99/10/01 PROBLEM: (OW40408) yada yada yada | c: INSTALL UW63259 ON VOLID 9909 (HBB6606) | | a: Parsed in Column one to ID new bucket start (trivia) | b: We grab the APAR ID from this line (trivia) | c: We grab the PTF from this line (our reason for existence) | | Syntax: | o PC: BUCKETPP bucket.txt smpe.out | o PC: BUCKETPP bucket.txt smpe.out fmid1 fmid2 fmid3 ... fmidx | o TSO: BUCKETPP 'ibmuser.bucket.txt' 'ibmuser.smp.out' | o TSO: BUCKETPP 'ibmuser.bucket.txt' 'ibmuser.smp.out' fmid1 ... | | Disclaimer: This REXX exec is FREEWARE. Use at your own risk. It | is provided for your enjoyment and neither David | Alcock or his employer provides any warranty for it's | use. I'd like to hear how it works on your system. */ /********************************************************************** * M o d i f i c a t i o n H i s t o r y * * Person Date Description * ---------- ----------- --------------------------------------------- * DGAlcock 2000-06-03 v1.1 TSO I/O support added; * DGAlcock 2000-05-14 v1.0 Initial exec written; **********************************************************************/ 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 = "" say "BUCKETPP - version "vrm "- Freeware - Processes IBMLINK buckets" /* say "Copyright 2000 by David Alcock. All rights reserved." */ say " " say ". Executing in Environment: "s1 "-" mtype if systemid <> "" then say ". Executing on system: "systemid say " " say " " /*--------------------------------------------------------------------- | These are the default FMIDs if none are given ------------------------------------------------------------------- */ fmids = "HDZ11D0 JDZ11DB HBB6606 EER3500" /*--------------------------------------------------------------------- | By environment type, ensure that we can read the input file ------------------------------------------------------------------- */ mtype = address() /* obtain type of environment */ select /*-------------------------------------------------------------- | Systems that support the linein/lineout I/O function ------------------------------------------------------------ */ when mtype == "CMD" | , /* Object Rexx: OS/2, Win */ mtype == "COMMAND" | , /* PC/DOS 7.0 */ mtype == "SYSTEM" then do /* Regina Rexx */ iotype = "l" /* Linein */ arg filein fileout options t = "d" if mtype = "SYSTEM" then do PARSE SOURCE s1 s2 s3 s4 s5 s6 s7 s8 s9 if s1 <> "WIN32" then t = "u" /* Assume Unix */ end if t = "d" then "del "fileout /* DOS/OS2/Windows */ else "rm "fileout /* UNIX */ if lines(filein) == 0 then do say "Input file not useable: "filein exit 12 end end /*-------------------------------------------------------------- | MVS (batch execution) - defaults to SYSUT1 for input ------------------------------------------------------------ */ when mtype == "MVS" then do arg options "EXECIO * DISKR SYSUT1 (FINIS STEM filein." erc = rc if erc <> 0 then do say "Error reading input file " exit 12 end if filein.0 == 0 then do say "Input file is empty" exit 12 end iotype = "s" /* Read from filein. stem */ l = 0 /* Line number */ "NEWSTACK" fileout_dd = "SYSUT2" end /*-------------------------------------------------------------- | TSO (but not batch "MVS") ------------------------------------------------------------ */ when mtype == "TSO" then do arg filein_dsn fileout_dsn options l = 0 /* Line number */ if filein_dsn == "" then do say "Missing input dataset name, terminating" exit end if fileout_dsn == "" then do say "Missing output dataset name, terminating" exit end /* | Handle input file */ x = LISTDSI(filein_dsn) if x <> 0 then do say "Error accessing DSN:" filein_dsn say " > "sysmsglvl1 say " > "sysmsglvl2 say " > SYSREASON: "sysreason exit end filein_pdsn = sysdsname parse value filein_dsn with . "(" member ")" . if member <> "" then do filein_pdsn = filein_pdsn"("strip(member)")" end say "Processing input file "filein_pdsn filein_dd = "SYU1"random() address TSO "ALLOCATE FILE("filein_dd")" , "DA('"filein_pdsn"') SHR REUSE" "EXECIO * DISKR "filein_dd , "(FINIS STEM filein." erc = rc address TSO "FREE FILE("filein_dd")" if erc <> 0 then do say "Error reading input file: "filein_pdsn exit end if filein.0 == 0 then do say "Input file is empty: "filein_pdsn exit end if member == "" then name = "UNKNOWN" else name = member /* | Handle output files */ fileout_dd = "SYU2"random() x = LISTDSI(fileout_dsn) if x <> 0 then do say "Creating output DSN:" fileout_dsn address TSO "ALLOC F("fileout_dd") DA("fileout_dsn")", "UNIT(SYSALLDA) NEW REUSE SPACE(5 5) TRACKS", "LRECL(80) BLKSIZE(8800) RECFM(F B)" arc = rc if arc <> 0 then say "Oops, allocate RC="arc end else do fileout_pdsn = sysdsname parse value fileout_dsn with . "(" member ")" . if member <> "" then do fileout_pdsn = fileout_pdsn"("strip(member)")" end say "Writing to output file "fileout_pdsn address TSO "ALLOCATE FILE("fileout_dd")" , "DA('"fileout_pdsn"') SHR REUSE" arc = rc if arc <> 0 then say "Oops, allocate RC="arc end iotype = "s" /* Read from filein. stem */ l = 0 /* Line number */ "NEWSTACK" end /*-------------------------------------------------------------- | Gripe about it! ------------------------------------------------------------ */ otherwise say "Not written to support system type: "mtype say "We do support: CMD, COMMAND, SYSTEM (Regina), and MVS" exit end /* of "select" */ /*--------------------------------------------------------------------- | Create a FMID list that has them enclosed in parenthesis ------------------------------------------------------------------- */ if options == "" then nop /* here we would parse for FMIDs */ fmidsn = words(fmids) pfmids = "" do i = 1 to fmidsn pfmids = pfmids" ("word(fmids,i)")" end say "Will process FMIDs:" pfmids /*--------------------------------------------------------------------- | Process the input file ------------------------------------------------------------------- */ Input_EOF = 1 /* Loop control */ apar = "" /* APAR ID */ tptf = 0 /* Total number of PTFs */ bptf = 0 /* Number of PTFs in bucket */ do while Input_EOF > 0 /* | Read the input line based on the I/O function type */ select when iotype ="l" then do linein = linein(filein) Input_EOF = lines(filein) end when iotype ="s" then do l = l + 1 linein = filein.l if l = filein.0 then Input_EOF = 0 end otherwise say "Internal error at read" exit end /* | Process linein */ lineout = "" if substr(linein,1,7) == "Subset " then do apar = "" if bptf <> 0 then say "> Found "bptf" PTFs" /* last bucket */ bptf = 0 bname = word(linein,2) say "Processing bucket: " bname iterate end if substr(linein,16,8) == "PROBLEM:" then do apar = substr(linein,26,7) iterate end do i = 1 to words(linein) if word(linein,i) == "INSTALL" then do j = i + 2 if word(linein,j) == "ON" then do j = i + 5 do k = 1 to fmidsn if word(linein,j) == word(pfmids,k) then do m = i + 1 lineout = word(linein,m) , "/* "apar word(pfmids,k) bname" */" bptf = bptf + 1 tptf = tptf + 1 end end end end end /* | Write the line out */ if lineout = "" then iterate /* nothing to write! */ select when iotype ="l" then call lineout fileout,lineout when iotype ="s" then queue lineout otherwise nop end end if bptf <> 0 then say "> Found "bptf" PTFs" if tptf <> 0 then say " "; say "Total PTFs found: "tptf /*--------------------------------------------------------------------- | Do termination stuff ------------------------------------------------------------------- */ if iotype ="s" then do queue '' /* add null line to indicate End-Of-File */ address TSO "EXECIO * DISKW "fileout_dd" (FINIS" address TSO "DELSTACK" address TSO "FREE FILE("fileout_dd")" end say " "; say "That's all folks..." exit 0