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
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
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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.