We would like to have the ability to show what reports, currently referred to in a View database, were processed in what weeks.
Release : 14.0
The following SARGRW program, shows the number of reports that are referenced in the database, broken down by weeks:
/CONTROL DATABASE=DATABASE_HLQ
RULER=YES
/SELECT ARCHDATE GE 2010
/DEFINE YYYYWW CHAR(6)
/DEFINE YEAR CHAR(4)
/DEFINE YDAY BIN
/DEFINE YJAN BIN
/DEFINE WEEK BIN
/DEFINE ALINES PACK(8)
/DEFINE X CHAR(6)
/TITLE 'LINES ARCHIVED PER WEEK'
/SET YEAR = EDIT(ARCHDATE,'YYYY')
/SET YDAY = EDIT(ARCHDATE,'DDD')
/SET YJAN = DATE('01/01/'||YEAR)
/SET WEEK = (YDAY+(YJAN-(YJAN/7*7)))/7+1
/SET YYYYWW = YEAR||EDIT(WEEK,'99')
/SORT YYYYWW
/IF YYYYWW NE X THEN
/ IF X NE ' '
/ PRINT SUBSTR(X,5,2)||'/'||SUBSTR(X,1,4) 'WW/YYYY' COL(1)
/ PRINT EDIT(ALINES,'ZZZ,ZZZ,ZZZ,ZZZ,ZZ9') ' LINES ARCHIVED'
/ END
/ SET X = YYYYWW
/ SET ALINES = 1
/ELSE
/ SET ALINES = ALINES+1
/END
/ON ENDDATA
/ IF X NE ' '
/ PRINT SUBSTR(X,5,2)||'/'||SUBSTR(X,1,4) 'WW/YYYY' COL(1)
/ PRINT EDIT(ALINES,'ZZZ,ZZZ,ZZZ,ZZZ,ZZ9') ' LINES ARCHIVED'
/ END
/END