Optimize IT resource capacity and performance with SAS

Retrieve file attributes from all files/folders in a directory

Reply
Regular Contributor
Posts: 194

Retrieve file attributes from all files/folders in a directory

Hi,

Does anyone have SAS code that retrieves the file attibutes of all files/folders in a directory?

I'm particularly interested in date modified and owner name.

Thank you.

Regular Contributor
Posts: 239

Re: Retrieve file attributes from all files/folders in a directory

Create a named pipe and get that from the directory listing?  Exact code depends on OS, but the concept should be the same.

filename myfile pipe "dir C:\temp\ /q";  */q gets owner in windows;

data mystuff;

infile myfile lrecl=500;

input (whatever you are interested in);

run;

Regular Contributor
Posts: 194

Re: Retrieve file attributes from all files/folders in a directory

Thank you for the reply.

I ran the following code:

http://support.sas.com/kb/38/279.html

For "owner" I only see:

BUILTIN\Administrators

8

1

8

2

2

5

Do you know what this is referring to?

Esteemed Advisor
Posts: 6,878

Re: Retrieve file attributes from all files/folders in a directory

It would help if you posted all of the code that you ran.

Post a Question
Discussion Stats
  • 3 replies
  • 331 views
  • 0 likes
  • 3 in conversation