BookmarkSubscribeRSS Feed
JJP1
Pyrite | Level 9

hi all ,

would you pleas help on sas script that identify the files in unix environment that does not have owner name and send the report for same please. so that i can verify and delete accordingly.

Sample file in /home/data - directory  that does not have owner name 

 

-rwxrwx--- 1 759320 sssssss 24167 24 Oct 2008 FFFFFFFFF.TXT
 

2 REPLIES 2
andreas_lds
Jade | Level 19

I haven't worked with unix for some time, but why do you want to bring sas into this problem, such things should be solvable with bash-commands easily.

Humbly asking @Kurt_Bremser for to share his wisdom.

Kurt_Bremser
Super User

I'm coming!

 

That is a UNIX one-liner:

find /home/data -nouser

To read the list of resulting names into a SAS dataset, do

filename oscmd pipe "find /home/data -nouser 2>&1";

data names;
infile oscmd truncover;
input name $200.;
run;

The "2>&1" construct reroutes stderr output to stdout, so in case of a problem you get one or a few observation(s) containing the problem message.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 448 views
  • 3 likes
  • 3 in conversation