check date on existed file

Reply
Contributor
Posts: 55

check date on existed file

Hello Friends,

i am wonder how can we check date stamp on existence of any file using SAS using SYSFUNC or any other SAS function?

I tried to check online to get this information but didn't find anything so far...

Thanks.

Super User
Posts: 5,424

Re: check date on existed file

The finfo() function could probable get what you need. The information that it can give varies with OS. See link for Windows:

SAS(R) 9.4 Companion for Windows, Third Edition

Data never sleeps
Trusted Advisor
Posts: 1,913

Re: check date on existed file

For Windows, I use a FILENAME statement with something called an unnamed PIPE, see the example "Using Redirection Sequences" here:

SAS(R) 9.4 Companion for Windows, Third Edition

Then you have to read the resulting directory listing into a SAS data set and parse out the date/time of the file.

Message was edited by: Paige Miller

Trusted Advisor
Posts: 1,913

Re: check date on existed file

Posted in reply to PaigeMiller

Well isn't that lovely? Neither the link from LinusH nor my link opens to the desired page in the SAS documentation with my browser Smiley Sad

UPDATE: Ctrl-click works, ordinary click doesn't work.

Contributor
Posts: 55

Re: check date on existed file

will this work with sas 9.1.3?

Super User
Posts: 19,772

Re: check date on existed file

The pipe  method will for sure.

    Both links work automatically in my browser, Firefox.

If you're using IE, my condolences :smileycry:

Trusted Advisor
Posts: 1,913

Re: check date on existed file

— I have been using the unnamed PIPE method for many versions of SAS, I'm pretty sure I used it for all versions of SAS 9 and probably back as far as SAS 8. If you can find the unnamed PIPE reference in the SAS 9.1.3 documentation, then it will work.

— my company allows me to choose any browser I want, as long as it is IE 9. I would use Firefox if that was on the approved list

Ask a Question
Discussion stats
  • 6 replies
  • 368 views
  • 3 likes
  • 4 in conversation