%macro vbgt72(indd=SASAUTOS); /* check that required ddnames are really there */ data _null_; if not fexist("&indd") then do; file print noprint; put " ===> Error: Required DDNAME &INDD not in JCL."; err+1; end; if not fexist('AUTOOUT') then do; file print noprint; put " ===> Error: Required DDNAME AUTOOUT not in JCL."; err+1; end; if err then do; file print noprint; put ' ===> Errors have been encountered.'; put ' ===> VBGT72 ending with errors.'; abort abend 997; end; run; /* Read the PDS directory collecting members and the */ /* dataset name */ data members(keep=dsname member); length dsn dsname $44; retain dsname ' ' memcnt 0; if eof then do; if not memcnt then do; file print noprint; put ' ===> THere are no members to process.'; put ' ===> VBGT72 ending with errors.'; abort abend 997; end; end; INFILE &indd RECFM=U BLKSIZE=256 LRECL=256 filename=dsn end=eof; DO WHILE(1=1); COL=3; INPUT COUNT PIB2. @; dsname = dsn; IF COUNT lt 14 THEN RETURN; DO WHILE(COL lt COUNT); INPUT @COL MEMBER $8. TT PIB2. R PIB1. IND PIB1. @; IF MEMBER eq:'FF'X THEN DO; INPUT; RETURN; END; ALIAS=0; COL=COL+12+2*MOD(IND,32); OUTPUT; memcnt+1; END; INPUT; END; /* Now the hard work. Read all members to determine if */ /* a line goes out beyond column 72. If so, mark it as a */ /* troublesome entry and move on to the next. */ data badmac goodmac; keep dsname member; set members; dsn = compress(dsname !! '(' !! member !! ')'); notdone=1; zrec=0; do while (notdone); infile rich filevar=dsn end=end pad; input @73 eight $char8.; zrec=zrec+1; if eight NE ' ' then do; put 'WARNING: Found a troublesome macro ' dsn ' Line ' zrec; put 'NOTE: Will stop processing this one' 'and move on the the next'; notdone=0; output badmac; end; if (end) & (notdone) then do; notdone=0; output goodmac; end; end; run; /* Lets see the list of those identified as troublesome. */ title 'Members that exceed column 72.'; proc print data=badmac; run; data _null_; length outdsn $44; retain outdsn ' '; if _n_ eq 1 then do; outdsn = pathname('AUTOOUT'); end; set goodmac; inmac = compress(dsname !! '(' !! Member !!')'); outmac = compress(outdsn !! '(' !! Member !!')'); notdone=1; infile rich filevar=inmac pad end=end; do while (not end); input line $char80.; file fbmaclib filevar=outmac; put line $char80.; end; run; %mend vbgt72; %vbgt72;