An Idea Exchange for SAS software and services

Comments
by Frequent Contributor
on ‎05-10-2012 09:45 AM

In the mean time, one can easily pipe an os command that lists the environment variables in a datastep and create a table from the list. This simple code worked for me in both windows and unix.

filename oscmd pipe 'set'; ** windows **;
*filename oscmd pipe 'env'; ** unix    **;

** create dataset with os environment variables;
** and values;
data os_env;
infile oscmd dlm='=';
input env_var :$32. value :$1000.;
run;

by Valued Guide
on ‎05-11-2012 01:22 PM

good idea

. and as a view in the SASUSER library you are very close to achieving the objective.

( tho I  protect against finding an = sign in the value or having a line returned by the command without any = )

Idea Statuses
Top Liked Authors