So How Do You Know What is Installed?


So you have installed the SAS System, and you can check what is licensed with the proc setinit command, but what if something hiccuped in the install. Or your supporting (I mean validating) someone else's install and you need to quickly see what is available? Included below is some 'found' code. This prints out three items: The SAS Applications Installed (such as 9.1, DIStudio, Web Olap Viewer), The SAS Products (including INTRNET, INTTECH, and CONNECT), and the list of Access Products (to Oracle, PC File Formats, etc).

This came from the SAS Support Site -
* SAS Install detector version 9 *;
* Purpose: to show what V9 SAS products are installed based on a directories and executables installed *;
* on the system Limitations: While the program checks directories and certain individual files it cannot check every *;
* single file present Note: if no access products are installed there may be errors in the access checking section. *;
* The same thing can happen with Enterprise Guide sector Jan 13 2002 - added Enterprise Guide 2.0 search *;

options formdlm='-';dm wpgm 'clear output' wpgm;dm wpgm 'clear log' wpgm;

* Change these filenames to reflect where SAS is installed on your system Please check to see if the access directory is there before running the Access checking code farther down in the program *;
filename file1 pipe 'dir "C:Program FilesSASSAS 9.1"';
filename file2 pipe 'dir "c:\program files\sas"';
filename file3 pipe 'dir "C:\Program Files\SAS\SAS 9.1\accesssasexe"';
filename file4 pipe 'dir "C:\Program Files\SAS\SAS 9.1\accesssasmacro"';
filename file5 pipe 'dir "C:\Program Files\SAS\SAS 9.1\accesssashelp"';

* First we read in the data for the SAS system itself to determine what products are installed under SAS itself *;
data temp1;
infile file1 truncover;
input var1 $ 1-100;
run; quit;
data temp2;
set temp1;
if _n_ > 2;
if tester = 'DIR' and product ^= '.';
if tester='DIR' and product ^= 'SASCFG';
if tester='DIR' and product ^='..';
keep product;

proc sort;
by product;
* Then we check to see what top level products are installed in addition to the SAS system. Examples include SAS *;
* Eminer Tree Viewer, SAS System Viewer etc. *;
data temp4;
infile file2 truncover;
input var1 $ 1-100;
run; quit;
data temp5;
set temp4;
if _n_ > 2;
if tester = 'DIR' and product ^= '.';
if tester = 'DIR' and product ^= '..';
keep product;
if product ^= 'SETUP LOGS';
proc sort; by product;

* Then we print out the SAS products and SAS components that are installed *;
proc print noobs data=temp5; title 'SAS Institute Applications Installed'; run; quit;
proc print noobs data=temp2; title 'SAS Software Products Installed'; run; quit;

* Checking for access products If you do not have any access products do not run the code beyond this line please *;
data tempacc; infile file3 truncover; input accvar1 $ 1-100; run; quit;
data tempacc2; set tempacc; if _n_ > 7; dllprod=substr(accvar1,40,12); run;
data tempacc3; set tempacc2;
if (dllprod='sasimode.dll') or (dllprod='sasioodb.dll') or (dllprod='sasiosyb.dll') or (dllprod='sasioora.dll') or (dllprod='sasiotra.dll') or (dllprod='sasiodbu.dll') or (dllprod='sasioole.dll'); run;
data tempacc4; set tempacc3;length prodinst $ 40;
if (dllprod='sasimode.dll') then prodinst='Access to PC File Formats';
if (dllprod='sasioodb.dll') then prodinst='Access to ODBC';
if (dllprod='sasiosyb.dll') then prodinst='Access to Sybase';
if (dllprod='sasioora.dll') then prodinst='Access to Oracle';
if (dllprod='sasiotra.dll') then prodinst='Access to Teradata';
if (dllprod='sasiodbu.dll') then prodinst='Access to DB2';
if (dllprod='sasioole.dll') then prodinst='Access to OLE/DB';run; quit;

data tempacc5;infile file4 truncover;input accvar1 $ 1-100;run; quit;
data tempacc6; set tempacc5;if _n_ > 7;dllprod=substr(accvar1,40,12);run;
data tempacc7; set tempacc6;
if dllprod='' or dllprod='' or dllprod='';
Length prodinst $ 40;
if dllprod='' then prodinst='Access to SAP BW';
if dllprod='' then prodinst='Access to R3';
if dllprod='' then prodinst='Access to Baan';
data tempacc8;infile file5 truncover;input accvar1 $ 1-100;run; quit;
data tempacc9; set tempacc8;
if _n_ > 7;
if dllprod='accpeo.sas7bcat';
if dllprod='accpeo.sas7bcat' then prodinst='Access to Peoplesoft';run;

data accfinal; set tempacc4 tempacc7 tempacc9;run;
proc sort data=accfinal nodupkey;by prodinst;run; quit;
* Then we print the access products *;

proc print data=accfinal;var prodinst;title 'Access Products Installed';run ; quit;


About Author

Angela Hall

Senior Technical Architect

Angela offers tips on using the SAS Business Intelligence solutions. She manages a team of SAS Fraud Framework implementers within the SAS Solutions On-Demand organization. Angela also has co-written two books, 'Building BI using SAS, Content Development Examples' & 'The 50 Keys to Learning SAS Stored Processes'.

Related Posts


  1. Pingback: Top 5 Tips from a Popular SAS BI Blog - The SAS Training Post

  2. This can also work on UNIX, you only need to update the filename locations to point to the correct directories.filename file1 pipe 'dir "sashomesas9.1"';filename file2 pipe 'dir "sashomesas"';filename file3 pipe 'dir "sashomesas9.1accesssasexe"';filename file4 pipe 'dir "sashomesas9.1accesssasmacro"';filename file5 pipe 'dir "sashomesas9.1accesssashelp"';

Leave A Reply

Back to Top