BookmarkSubscribeRSS Feed
S_B
Calcite | Level 5 S_B
Calcite | Level 5

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
---SAS/STAT
---SAS/GRAPH
---SAS/ETS
---SAS/FSP
---SAS/OR
---SAS/AF
---SAS/IML
---SAS/ASSIST
---SAS/CONNECT
---SAS/EIS
---MDDB Server common products
---SAS/Secure 168-bit
---SAS/Secure Windows
---SAS Enterprise Guide
---OR OPT
---OR PRS
---OR IVS
---OR LSO
---SAS/ACCESS Interface to Oracle
---SAS/ACCESS Interface to PC Files
---SAS/ACCESS Interface to ODBC
---SAS/IML Studio
---SAS Workspace Server for Local Access
---High Performance Suite

 

Any help is greatly appreciated.

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

LinusH
Tourmaline | Level 20

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".

Data never sleeps
Kurt_Bremser
Super User

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)

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 798 views
  • 0 likes
  • 4 in conversation