Sorry folks - in my excitement I copied in the wrong code (above) - we had an internal system before we switched on RA......
Here is some code - you will need to tweak a bit but it works........
-* Summary of usage by user for a selected date range
-*MRNOEDIT -INCLUDE SAPREF
-*SET &BYSORT = IF &BYSORT EQ 'LOWEST' THEN 'HIGHEST' ELSE 'LOWEST';
-SET &ECHO=ALL;
-SET &COMPNAME = FGETENV(12,COMPUTERNAME,16,'A16');
-*TYPE &COMPNAME
-RUN
JOIN CLEAR
-*JOIN SMKEY IN SMQUERY TO SMKEY IN SMREQSTS AS J0.
-RUN
SET ASNAMES=ON
TABLE FILE SMQUERY
SUM
COMPUTE DELAP/D20.4 = SMELAPTIME/10000;
COMPUTE DCPU/D20.4 = SMCPUTIME/10000;
COMPUTE DIOS/D15 = SMIOS;
COMPUTE DROWS/D15 = SMROWS;
CNT.SMKEY AS 'REQCOUNT'
-*SMFEXLOC
-*SMSQLLINE
BY SMUSERID
BY SMDATE
BY SMTIME
BY SMRPCNAME
WHERE SMRPCNAME NE ' '
WHERE SMDATE GE '&FROMDATEyyyymmdd' AND SMDATE LE '&TODATEyyyymmdd'
AND SMSERVER EQ '&COMPNAME' ;
WHERE SMCONNID EQ SMUSERID;
WHERE SMCONNID NE 'WEBFOCUS';
ON TABLE HOLD AS QURY
END
-*EXIT
-RUN
?FF QURY
-RUN
-*EXIT
DEFINE FILE QURY
TMPDATE/I8=EDIT(SMDATE);
TMQDATE/I8YYMD=TMPDATE;
SMMONTH/YYM=TMQDATE;
END
TABLE FILE QURY
SUM
CNT.REQCOUNT
MIN.SMDATE AS 'MINSMDATE'
MAX.SMDATE AS 'MAXSMDATE'
DIOS
DROWS
DCPU
DELAP
CNT.DST.SMRPCNAME AS 'PROCCNT'
BY SMUSERID
BY SMMONTH
-*BY SMDATE
ON TABLE HOLD AS SAUSU FORMAT FOCUS INDEX SMUSERID
END
-RUN
-*EXIT
-*?FF SAUSU
-IF &LINES GT 0 THEN GOTO :HAVEDATA ;
-GOTO :ENODATA;
-:HAVEDATA
FILEDEF IBIMRUSR DISK e:\ibi\WebFOCUS76\utilities\IBIMRUSR.TXT
-*FILEDEF IBIMRGRP DISK e:\ibi\WebFOCUS76\utilities\IBIMRGRP.TXT
-*FILEDEF IBIMRDOM DISK e:\ibi\WebFOCUS76\utilities\IBIMRDOM.TXT
-RUN
SET ALL=ON
SET PCOMMA=ON
SET MSG=ON
DEFINE FILE IBIMRUSR
TOKEN1/A40 = GETTOK(USER_PROP, 256, 1, ',', 40, TOKEN1) ;
TOKEN2/A40 = GETTOK(USER_PROP, 256, 2, ',', 40, TOKEN2) ;
TOKEN3/A40 = GETTOK(USER_PROP, 256, 3, ',', 40, TOKEN3) ;
TOKEN4/A40 = GETTOK(USER_PROP, 256, 4, ',', 40, TOKEN4) ;
TOKEN5/A40 = GETTOK(USER_PROP, 256, 5, ',', 40, TOKEN5) ;
TOKEN6/A40 = GETTOK(USER_PROP, 256, 6, ',', 40, TOKEN6) ;
EMAILADDR/A40=IF TOKEN1 CONTAINS 'email=' THEN TOKEN1 ELSE
IF TOKEN2 CONTAINS 'email=' THEN TOKEN2 ELSE
IF TOKEN3 CONTAINS 'email=' THEN TOKEN3 ELSE
IF TOKEN4 CONTAINS 'email=' THEN TOKEN4 ELSE
IF TOKEN5 CONTAINS 'email=' THEN TOKEN5 ELSE
IF TOKEN6 CONTAINS 'email=' THEN TOKEN6 ELSE 'UNKNOWN';
DISABLED/A1=IF USER_PROP CONTAINS 'inactive' THEN 'Y' ELSE 'N';
USERIDUC/A48=UPCASE(48,USER_ID,'A48');
END
TABLE FILE IBIMRUSR
-* USE WRITE AND NOT PRINT TO GET ONE LOT OF ACCOUNT DETAILS PER USER
WRITE *
EMAILADDR
DISABLED
BY USERIDUC
ON TABLE HOLD AS USERINFO FORMAT FOCUS INDEX GROUP_HREF USERIDUC
END
-RUN
-*?FF USERINFO
-*EXIT
-RUN
JOIN CLEAR *
-*JOIN SMUSERID IN SAUSU TO USERIDUC IN USERINFO AS J1.
JOIN USERIDUC IN USERINFO TO ALL SMUSERID IN SAUSU AS J2.
SET ASNAMES = OFF
DEFINE FILE USERINFO
PREQCNT/D10.2 = REQCOUNT;
TOTRES/D16.2 = DIOS + DROWS + DCPU + DELAP;
TDATE/A5 = EDIT(MINSMDATE,'$$$$$$99') | '/' | EDIT(MINSMDATE,'$$$$99$$');
IDATE/A10 = TDATE | '/' | EDIT(MINSMDATE,'9999$$$$');
DDATE/A5 = EDIT(MAXSMDATE,'$$$$$$99') | '/' | EDIT(MAXSMDATE,'$$$$99$$');
ADATE/A10 = DDATE | '/' | EDIT(MAXSMDATE,'9999$$$$');
-*INCLUDE SADHLP
END
TABLE FILE USERINFO
PRINT
REQCOUNT AS 'Number of,Menu Items Run'
PROCCNT AS 'Number of,Different,Procedures Run'
-*IOS AS 'IO'
-*ROWS AS 'ROWS'
-*CPU
-*ELAP AS 'ELAPSED'
PCT.PREQCNT AS '% Total,Requests'
-*PCT.TOTRES AS '% Total,Resources'
IDATE AS 'First,Access'
ADATE AS 'Last,Access'
AND COLUMN-TOTAL
-*&BYLINE
-*BY HIGHEST
-*BY SMUSERID
BY HIGHEST REQCOUNT NOPRINT
BY USER_DESC AS 'User Name'
BY USERIDUC AS 'User ID'
BY SMMONTH AS 'Month'
-*BY SMDATE AS 'Date'
-*WHERE ROLE CONTAINS 'Power'
HEADING
"Frequency of Use Summary INCLUDING users that did NOT logon at all"
" "
"Report Date: &DATEDMYY "
"Server Name: &COMPNAME "
"Date Range : &FROMDATEyyyymmdd - &TODATEyyyymmdd "
" "
FOOTING BOTTOM
-MRNOEDIT -INCLUDE SAFOOT
ON TABLE PCHOLD FORMAT AHTML
-*IF &WEBVIEW NE 'OFF' THEN GOTO :NOVIEW2 ;
-MRNOEDIT -INCLUDE HTML_STYLE
ENDSTYLE
-*ON TABLE &SARHOLD FORMAT &SARFMT
-:NOVIEW2
-*ON TABLE HOLD AS RESANAL FORMAT FOCUS INDEX SMUSERID
END
-RUN
-*?FF RESANAL
-EXIT
-*HOLD AS RESANAL FORMAT FOCUS INDEX SMUSERID
-RUN
JOIN CLEAR *
JOIN USERIDUC IN USERINFO TO ALL SMUSERID IN RESANAL AS J3.
-*?FF USERINFO
-*EXIT
TABLE FILE USERINFO
"Frequency of Use Summary "
" "
"Report Date: &DATEDMYY "
"Server Name: &COMPNAME "
"Date Range : &FROMDATEyyyymmdd - &TODATEyyyymmdd "
" "
FOOTING BOTTOM
-MRNOEDIT -INCLUDE SAFOOT
ON TABLE PCHOLD FORMAT AHTML
-MRNOEDIT -INCLUDE HTML_STYLE
ENDSTYLE
PRINT REQCOUNT IOS ROW CPU ELAP TOTRES
AND COLUMN-TOTAL
BY USERIDUC
BY USER_DESC AS 'User Name'
WHERE ROLE CONTAINS 'Power'
END
-EXIT
-:ENODATA
-TYPE SORRY NO DATA MATCHES YOUR DATE SELECTIONS......
-XEXIT
_______________________
*** WebFOCUS 8.1.05M ***