Desktop productivity for business analysts and programmers

Extracting month from a file creation data using %sysfunc function

Reply
Occasional Contributor
Posts: 5

Extracting month from a file creation data using %sysfunc function

I run  monthly files and trying to create title something like --

"Files are current through December31, 2017".

I do not want to hard code in my program. I know I can use %sysfunc on the file creation day using data dictionary. Then how am I going to get last day of each month.

Any tips will be greatly appreciated.

Thank you!

BG

Super User
Posts: 22,827

Re: Extracting month from a file creation data using %sysfunc function

INTNX will give you the end of the month. 

Use the difference of 0 months and the fourth parameter allows you to align the date to the end of the month.

The documentation has an example if you're having difficulty or post your code back here.

 


Bula wrote:

I run  monthly files and trying to create title something like --

"Files are current through December31, 2017".

I do not want to hard code in my program. I know I can use %sysfunc on the file creation day using data dictionary. Then how am I going to get last day of each month.

Any tips will be greatly appreciated.

Thank you!

BG


 

Occasional Contributor
Posts: 5

Re: Extracting month from a file creation data using %sysfunc function

Thank you Reeza! I will try tomorrow to figure it out.
Occasional Contributor
Posts: 5

Re: Extracting month from a file creation data using %sysfunc function

Hi Reza,

I spent a bit time on refreshing INTNX function. My Base SAS documentation is showing foreign language. I do not know why. If you please could send me code that would ve very helpful.
Thanks Reza
Super User
Posts: 22,827

Re: Extracting month from a file creation data using %sysfunc function

Here's the english version:

http://documentation.sas.com/?docsetId=lefunctionsref&docsetTarget=p10v3sa3i4kfxfn1sovhi5xzxh8n.htm&...

 

Note that you can use the TODAY() function to get todays date.

 

Post what you've tried and I'll be happy to help further.

Occasional Contributor
Posts: 5

Re: Extracting month from a file creation data using %sysfunc function

 
Occasional Contributor
Posts: 5

Re: Extracting month from a file creation data using %sysfunc function

No luck Smiley Sad

Please find the attachment. When I clicked on your documentation link, I simply get a blank page.

Super User
Posts: 22,827

Re: Extracting month from a file creation data using %sysfunc function

You need to get that fixed...not having access to the documentation doesn't make sense. Does your work block websites?

Or did you try some old versions, ie SAS 9.3? 

 

 

 

Ask a Question
Discussion stats
  • 7 replies
  • 201 views
  • 1 like
  • 2 in conversation