Good Morning, I was wondering if someone could help me with an issue we are having. We have a job that runs every morning and there are days it fails because a user is in a SAS Web report studio report that uses a cube. Therefore the job fails cause the users is in the cube. I am wanting to kick all users out of reports and cubes before this jobs runs but I cannot get successful with this. We have gotten successful at kicking the user out if they are in SAS OLAP Cube Studio by using the below code. But Not in SAS Web report studio using the information map that uses the cube. %MACRO CLOSE_SESSIONS(logfile=out.log, host=localhost, port=5451, userid=sasadm@saspw, password=sasadm1, cube=_ALL_); FILENAME outlog "&logfile"; PROC PRINTTO LOG="&logfile" NEW; RUN; PROC OLAPOPERATE; CONNECT HOST="&host" PORT=&port USERID="&userid" PASSWORD="&password"; %if &CUBE = _ALL_ %then %do; LIST SESSIONS; %end; %else %do; LIST SESSIONS CUBE="&cube"; %end; RUN; PROC PRINTTO LOG=log; RUN; DATA SESSIONS (KEEP=ID); INFILE outlog TRUNCOVER; LENGTH text $256 ID $71; RETAIN count 0; CALL SYMPUT('n',count); INPUT text $ &; IF SUBSTR(text,1,10) = "Session ID" THEN DO; id = SCAN(text,3,' '); count + 1; CALL SYMPUT('n',count); OUTPUT; END; RUN; %DO i = 1 %TO &n; DATA _NULL_; SET SESSIONS (FIRSTOBS=&i OBS=&i); CALL SYMPUT('id',id); RUN; PROC OLAPOPERATE; CONNECT HOST="&host" PORT=&port USERID="&userid" PASSWORD="&password"; CLOSE SESSION "&id"; RUN; %END; DATA _NULL_; sessioncount = strip("&n"); PUT "NOTE: " sessioncount " SAS OLAP Server sessions were closed."; RUN; %MEND;
... View more