BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mehak
Calcite | Level 5

 calculate the months , weeks, days seperately  since coupon expiry date from current date to 31 march 2014. 


data _class_s;
date1 = '21OCT2017'd;
date2 = '31MAR2014'd;
no_of_months = intck ('MONTH', date1, date2);
no_of_weeks = intck ('WEEK', date1, date2);
no_of_days = intck ('DAY', date1, date2);
format date1 date2 date9.;
proc print data = _class_s noobs;
run;

 

can any1 please tell me whati have to do to add coupon expiry date in this code .

1 ACCEPTED SOLUTION
3 REPLIES 3
mehak
Calcite | Level 5

sir  can you please tell me how can i take difference between the var called coupon id , current date and 31march

Kurt_Bremser
Super User

@mehak wrote:

sir  can you please tell me how can i take difference between the var called coupon id , current date and 31march


Differences are calculated with a subtraction. Date and time differences are calculated with intck, as you already know.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 628 views
  • 0 likes
  • 2 in conversation