MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SAS Problem: Date print Problem

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
mls
Beginner


Joined: 10 Nov 2005
Posts: 9
Topics: 5

PostPosted: Thu Nov 10, 2005 5:20 am    Post subject: SAS Problem: Date print Problem Reply with quote

Hi,

My requirement is to print Previous month and date of current year and last year in a report using SAS. e.g if I run it on 11/10, the report should have 30OCT2004 to 30OCT2005.
I am also using these dates for comparison in SQL and I am using
(CURRENT_DATE - DAY(CURRENT_DATE) DAYS) - 1 YEAR) and (CURRENT_DATE - DAY(CURRENT_DATE) DAYS) and it is working in SQL.
But when I am trying to assign this value to a variable in SAS, it is not working.

Thanks a lot for your help,

Regards,
MLS
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Thu Nov 10, 2005 5:27 am    Post subject: Re: SAS Problem: Date print Problem Reply with quote

Please post your SAS code.
Back to top
View user's profile Send private message Send e-mail
jetson
Beginner


Joined: 07 Oct 2005
Posts: 30
Topics: 2
Location: Texas

PostPosted: Thu Nov 10, 2005 4:46 pm    Post subject: Reply with quote

Use the INTNX function: example below

data test;

date='10nov05'd;
prev_month_date = intnx('month',date,-1,'e');
prev_year_date = intnx('month',prev_month_date,-12,'e');

put date mmddyy10.;
put prev_month_date mmddyy10.;
put prev_year_date mmddyy10.;

run;
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group