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.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 620 views
  • 3 likes
  • 3 in conversation