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

Good Afternoon Guys,

 

Looking for some syntax help if you can 🙂

 

I need to create an effective date which is always to be Dec 31st of the following year


Example


If my Creation Date is 8/18/2017 my effective date would be DEC 31 2018

 

If my Creation Date is 12/31/2017 my effective date woul dbe DEC 31 2018

 

Ect.

Appreciate any assistance

1 ACCEPTED SOLUTION

Accepted Solutions
TomKari
Onyx | Level 15

The INTNX function is incredible. I suggest you read up about it.

 

data have;
	format CreationDate EffectiveDate date.;
	CreationDate = '1jan2017'd;
	EffectiveDate = intnx('year', CreationDate, 1, 'end');
	output;
	CreationDate = '18aug2017'd;
	EffectiveDate = intnx('year', CreationDate, 1, 'end');
	output;
	CreationDate = '31dec2017'd;
	EffectiveDate = intnx('year', CreationDate, 1, 'end');
	output;
run;

 

 

 

 

Tom

View solution in original post

1 REPLY 1
TomKari
Onyx | Level 15

The INTNX function is incredible. I suggest you read up about it.

 

data have;
	format CreationDate EffectiveDate date.;
	CreationDate = '1jan2017'd;
	EffectiveDate = intnx('year', CreationDate, 1, 'end');
	output;
	CreationDate = '18aug2017'd;
	EffectiveDate = intnx('year', CreationDate, 1, 'end');
	output;
	CreationDate = '31dec2017'd;
	EffectiveDate = intnx('year', CreationDate, 1, 'end');
	output;
run;

 

 

 

 

Tom

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1 reply
  • 649 views
  • 2 likes
  • 2 in conversation