01-20-2016 07:46 AM
I am not a SAS programmer but more behind the scences (admin). I am looking to code the following : in Base SAS 9.4 or Enterprise Guide 6.1.
I have 3 seperate Unix servers that I want to connect to and run the following command df -h
Then generate those results and export to a excel spreadsheet.
I have the following to work with:
---Base SAS Software
---MDDB Server common products
---SAS Enterprise Guide
---SAS/ACCESS Interface to Oracle
---SAS/ACCESS Interface to PC Files
---SAS/ACCESS Interface to ODBC
---SAS Workspace Server for Local Access
---High Performance Suite
Any help is greatly appreciated.
01-20-2016 07:55 AM
Why do you not just run that command and stream the output to a CSV file? Am sure it can be done, in DOS its just:
dir c:\temp -> results.txt
Your an admin, so you should have the tools for this?
It can get a bit more complicated is you want to do it in SAS.
01-20-2016 08:14 AM
If you are on Linux, I'm pretty sure that are some free/share ware tools that helps do basic resource reporting.
This is might out of the scope for this thread, but I can't help seeing that your SAS product portfolio is a bit outdated. If trade in some of the V8 products (MDDB Server, EIS, ASSIST, FSP, AF and potentially CONNECT) so you could use the V9 SAS Intelligence Platform. That would include the SAS Environment Manager, that lets you do extensive reporting on both SAS specific, and some OS specific resources "out of the box".
01-20-2016 08:36 AM
A simple SAS program to read the output of the df command into a SAS file looks like that:
filename oscmd pipe "df -k"; data diskfree; infile oscmd dlm=" " truncover firstobs=2; length volume $30 space 8 used 8 nodes 8 directory $100 ; informat percent npercent percent5. ; format percent npercent percent5. space used comma12. nodes comma9. ; input volume@ ; if volume ne '/proc'; input space used percent nodes npercent directory ; run;
Note that I use -k instead of the -h option, as it spares me the hassle of interpreting the K, M, or G.
Also note the subsetting if that suppresses the /proc filesystem, as it does not contain valid numerical values (AIX)