/* REXX */ /*********************************************************************/ /* */ /* (c) Copyright International Business Machines Corporation 1998 */ /* */ /* All Rights Reserved */ /* */ /*********************************************************************/ /* PURPOSE: */ /* Sample REXX exec to correct APAR prefixs in HOLDDATA. */ /* INPUTS: */ /* Uses dataset hlq.APARPRFX.TABLE as the source for correct APAR */ /* prefixes. */ /* Uses dataset hlq.HOLD.LIST as the source for current HOLDDATA. */ /* This dataset is produced as the output from an SMP/E */ /* LIST HOLDDATA HOLDERROR. */ /* OUTPUT: */ /* Dataset hlq.HOLDDATA.FIX. This dataset can be SMP/E RECEIVE'd */ /* as regular HOLDDATA into the SMP/E global zone. This dataset */ /* should be reviewed to ensure that only the appropriate ++HOLDs */ /* are ++RELEASEd and reheld. */ /* OPERATION: */ /* Create a variable of fmids and prefixes in the format */ /* FMID PRFX FMID PRFX ... */ /* Loop reading input (passed) file */ /* Check the reason prefix on the ++HOLD statement. If it is */ /* correct, then pass to next ++HOLD. */ /* If the reason prefix is incorrect, create a ++RELEASE for the */ /* incorrect prefix, and write the corrected ++HOLD to the output */ /* file. */ /*********************************************************************/ /* Support available from the author - Bill Spencer */ /* (914) 435-4106 */ /*********************************************************************/ trace o arg hlq HRC1 = 0 CALL INIT CALL PROCESS CALL FINISH EXIT HRC1 INIT: /********************************************************************/ /* Identify and allocate the data sets needed */ /********************************************************************/ holdinput = hlq||'.HOLD.LIST' "ALLOC FI(HLDI) DA('"holdinput"') OLD" aparprfx = hlq||'.APARPRFX.TABLE' "ALLOC FI(APRF) DA('"aparprfx"') OLD" holdfix = hlq||'.HOLDDATA.FIX' "ALLOC FI(HLDF) DA('"holdfix"') NEW CATALOG UNIT(SYSDA)", "SPACE(2,1) CYLINDERS RELEASE RECFM(F,B) LRECL(80)", "BLKSIZE(3200) DSORG(PS)" fmid_list = '' /* blank variable */ return PROCESS: /********************************************************************/ /* Read the holddata file and determine if the ++HOLD is invalid. */ /* If so, create the ++RELEASE and the valid ++HOLD. */ /********************************************************************/ "EXECIO * DISKR APRF (FINIS STEM IREC." do n=1 by 1 for irec.0 /* build variable of fmids & prfx */ parse var irec.n fmid pref . fmid_list = fmid_list fmid pref /* catenate to list variable */ end out_next_rec = 0 /* set flag */ "EXECIO * DISKR HLDI (FINIS STEM FREC." trace o do n=1 by 1 for frec.0 select when substr(frec.n,40,7)='++HOLD(' &, substr(frec.n,56,5)='FMID(' &, substr(frec.n,70,7)='REASON(' &, substr(frec.n,86,5)='ERROR' &, substr(frec.n,92,5)='DATE(' then do /* looks like one of our ++HOLDs */ parse var frec.n 'HOLD('sysmod')' 'FMID('fmid')' , 'REASON('reason')' 'DATE('cdat')' rsn_prf = substr(reason,1,1) rsn_rsn = substr(reason,2,6) select when wordpos(fmid,fmid_list)=0 &, rsn_prf <> 'A' then /* not 'A', should be an 'A' */ do rsn_prf='A' CALL WRITE_RLS_AND_NEW out_next_rec = 1 /* write next record to output */ end when wordpos(fmid,fmid_list)<>0 then do fmid_word = wordpos(fmid,fmid_list) fmid_p_word = fmid_word+1 new_rsn_prf = word(fmid_list,fmid_p_word) if new_rsn_prf <> rsn_prf then do rsn_prf=new_rsn_prf CALL WRITE_RLS_AND_NEW out_next_rec = 1 /* write next record to output */ end else out_next_rec = 0 end otherwise out_next_rec = 0 /* skip to next ++HOLD */ end /* sub-select */ end when out_next_rec & , substr(frec.n,41,8)='COMMENT(' then do out_rec=substr(frec.n,40) CALL COPY_TO_OUT end when out_next_rec & , substr(frec.n,41,6)='CHGDT(' then do out_rec=substr(frec.n,40) CALL COPY_TO_OUT end when out_next_rec & , substr(frec.n,41,6)='CLASS(' then do out_rec=substr(frec.n,40) CALL COPY_TO_OUT end otherwise NOP /* skip to next ++hold */ end /* primary select */ end /* frec do loop */ return FINISH: "EXECIO 0 DISKW HLDF (FINIS" "FREE FI(HLDI)" "FREE FI(APRF)" "FREE FI(HLDF)" return /*-------------------------------------------------------------------*/ /* Create ++RELEASE statement and follow-on correct ++HOLD and */ /* write to output file. */ /*-------------------------------------------------------------------*/ WRITE_RLS_AND_NEW: out_rec='++RELEASE('sysmod') FMID('fmid') REASON('reason') ERROR' , 'DATE('cdat').' CALL COPY_TO_OUT out_rec=substr(frec.n,40) out_rec=overlay(rsn_prf,out_rec,38) CALL COPY_TO_OUT return /*-------------------------------------------------------------------*/ /* Write record to output file. */ /*-------------------------------------------------------------------*/ COPY_TO_OUT: RECORD = out_rec PUSH RECORD "EXECIO 1 DISKW HLDF" return