I did not want to confuse with other logic that were in the code. Here is the code. SYSOUT record that we are concerned WER054I RCD IN 10000, OUT 154416 Input Parm file (there are other rows which are hardcoded values and does not need any substitution) Total record count is: #### Output Records: ### CODE: /* This step extracts counts from SYSOUT from previous SORT step*/ DATA SYSOINF(KEEP=COUNT); INFILE I1INPUT TRUNCOVER; INPUT @3 SYNCINF $CHAR7. @; IF SYNCINF = "WER054I" THEN INPUT @1 INREC $CHAR80.; ELSE DELETE; TOTAL = PUT((COMPRESS(SCAN(INREC,2,'OUT'))),15.); COUNT = INPUT(TOTAL,9.); PROC PRINT DATA=SYSOINF;TITLE "SYSOINF";RUN; /* This is the input parm file */ DATA DEF; INFILE I1PARM END=EOF; INPUT @1 OUT_REC $CHAR80.; PROC SQL; CREATE TABLE LOGOUT AS SELECT DEF.*,SYSOINF.* FROM DEF,SYSOINF; PROC PRINT DATA=LOGOUT;TITLE "LOGOUT";RUN; DATA _NULL_; SET LOGOUT; LENGTH OUT_RECD $80.; LENGTH COUNTC $9.; COUNTC = (PUT(COUNT,Z9.)); PUT COUNTC; FILE O1OUTPUT; IF SCAN(OUTREC,2,':') = "####" THEN OUT_RECD = CAT(SCAN(OUT_REC,1,'####'),COUNTC); /* counts with zeros */ ELSE OUT_RECD = SCAN(OUT_REC,1,'###') || COMPRESS(COUNT); /* counts without zeros */ PUT @1 OUT_RECD $CHAR80.; OUTPUT ********************************* Top of Data ********************************** Total record count is: 10000 Output Records: 10000 ******************************** Bottom of Data ******************************** Output
... View more