Thursday, May 4, 2023

sas viya cas cache cascache disk usage history

 

cas sess1; 

caslib _all_ assign;


%let BASE_URI=%sysfunc(getoption(servicesbaseurl)) ;

 


/* proc casutil outcaslib="CASUSER" ; */

/*    load data=  path="dfcascachehistory.sashdat"; replace;   */



proc cas;

/* table.dropTable / table="dfcascachehistory";   */


  table.loadTable /

    path="dfcascachehistory.sashdat"

    casout={name="dfcascachehistory"} ;

    

  table.fileInfo /                                                /* 1*/

    path="dfcascachehistory.sashdat";

quit ;




proc cas; 

    session sess1; 

    accessControl.assumeRole / adminRole="superuser";       

    builtins.getCacheInfo result=results; 

    describe results  ;  

run;



SAVERESULT results dataout=dfcascache ;  




data casuser.dfcascache_with_date; 

set dfcascache;

format datum ddmmyy10. ;

  datum=date();

run;


data casuser.dfcascachehistory ( append=yes ) ;

set  casuser.dfcascache_with_date;

run;


proc contents data=casuser.dfcascachehistory ;

run; 


proc cas;

  table.save /

    table="dfcascachehistory"

    name="dfcascachehistory.sashdat"

    replace=True;

    

  table.fileInfo /  path="dfcascachehistory.sashdat";

quit ;






options 

  emailsys=smtp 

  emailhost=

(

"MAILSERVERNAME.nl"

STARTTLS auth=LOGIN

/* your Outlook address */

id=USERNAME@SOMESITE.NL

/* optional: encode PW with PROC PWENCODE */

pw={SAS002}ABCDEFGHI port=25

)

;

/* Small SAS job to produce some data */


filename msg email 

 to="sasuser@somesite.nl"

from="no_reply@somesite.nl"

type='text/html'

subject = "DDS-INFO-001:DFCASCACHE &base_uri"; 

ods graphics / imagefmt=png height=800 width=800;

ods html5 (id=mail) file=msg style=htmlblue options(bitmap_mode="inline") gtitle;

ods escapechar='^';

ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black} ";

ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black}Goededag ,";

ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black} ";

ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black}Bijgaand de cascache informatie";

ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black} ";

ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black}Vriendelijke groeten,";

ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black} ";


 

proc print data=dfcascache noobs

 style (table) = [frame=box borderwidth=1 ];

;

/* VAR sex name age; */

TITLE1 "DISK USAGE CAS CACHE ";

Footnote1 "&_sasprogramfile";

Footnote2 "2023 &BASE_URI";


run;


proc print data=casuser.dfcascachehistory noobs

 style (table) = [frame=box borderwidth=1 ];

;

run;

proc sgplot data=casuser.dfcascachehistory;


title "Graph of FS_USAGE, by Node";


series x=datum y=FS_USAGE /markers group=Node;


/* keylegend /location=outside position=top; */

keylegend /position=top;


run;



ods html5 (id=mail) close;


cas sess1 terminate;



No comments: