Dear SAS Community member,
I am now dealing with a challenge that surprised me. Because i thought there was a simple solution for it 🙂
This is the case.
In SAS VA i like to caculate a new date by subtracting 6 months.
Date - 6months = new date.
Steps:
First i like to use treatas function to make the date numeric.
Then find a formula to subtract 6 months. This formula must take the diffrent numbers of days in the months into account.
Question:
Is there a formula which i can use in SAS VA which can calculate 6 months?
Remarks:
I do not use SAS Base.
Regards,
Lucien
Hello SurajSaini,
Thank you for the reply. It is indeed the challenge that the date is variable.
There fore i have implemented a simple solution.
With the "treat as" function i have changed to date into a number.
Dan subtract 180 days from it.
The goal to warn the user that a depreciation date was coming within 6 months.
This information can be used for business purposes.
I will close this issue.
Regards, Lucien
Can you please explain what you want to achieve in your analysis
I do not have a solution to directly subtract a month from the date, because it's a bit hard to as you Date variable is not constant(I just supposed so even if we create a date parameter in the calculation item still as the month varies in the date variable that will change the calculation results.
If you do not mind can you please tell me what do you want to do in your reporting so that we can come_up with any other alternatives.
Hello SurajSaini,
Thank you for the reply. It is indeed the challenge that the date is variable.
There fore i have implemented a simple solution.
With the "treat as" function i have changed to date into a number.
Dan subtract 180 days from it.
The goal to warn the user that a depreciation date was coming within 6 months.
This information can be used for business purposes.
I will close this issue.
Regards, Lucien
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Lock in the best rate now before the price increases on April 1.
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.