I need to populate a field called next instalment date and the field I'm have is current instalment date in the format date9. e.g 21Dec2019, I need to populate a field next instalment date using the current instalment date, I needs to display as 21Jan20.
this looks like it might work, I ran the statement
nextdate = intnx('month',InstalmentDate,1,'s');
however it populates a Numeric field and not in a date format. I might be using the code incorrect. I apologies, but I'm very new and teaching myself the coding.
If you create a new variable, you need to assign a date display format to make the result of the calculation human-readable. A SAS date value is a count of days from 1960-01-01, so today's date is 21935.
Add this to the code
format nextdate date9.;
and you'll get the "default" SAS date format. Others can be found in the documentation (section Date and Time).
INTNX('MONTH',InstalmentDate,+1,'SAMEDAY') AS nextdate FORMAT = Date9.
Thank you for great help, you lead me to this 🙂
Regards,
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Registration is open
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!