BookmarkSubscribeRSS Feed
Neens1
Calcite | Level 5

I am trying to create a dataset of the library contents that will just show me the dataset name and the owner name.

It seems really simple  but I think I must be missing something.

Any ideas welcome

Thanks

3 REPLIES 3
DBailey
Lapis Lazuli | Level 10

on unix...

%macro file_info(root=/);

  filename inf pipe "ls -l &root" Lrecl=200;

  data file_info (drop= txt) ;

  infile inf lrecl=200 truncover ;

  input txt $char200. ;

  if index(txt,'>') >=1 or index(txt,'<') >=1 then delete ;

  user_id=scan(txt,3,' ') ;

  run;

  %mend file_info;

  %file_info(root=$HOME);

on windows..you could replace the pipe command to a dos and parse the results ( I think it is dir /s/q "c:\")

Neens1
Calcite | Level 5

Thanks for that but I am not able to do anything on Unix.

It would have to be on Enterprise Guide


DBailey
Lapis Lazuli | Level 10

actually, the code is submitted from a sas program node within EG.  Which syntax you use depends on where your SAS is actually running.  If you use EG on Windows and sas is installed locally, then you would use the windows syntax.  If you use EG and your sas runs remotely on an unix server, then you would use the unix syntax.

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
  • 450 views
  • 0 likes
  • 2 in conversation