03-06-2013 08:40 AM
I have a variable name Losstime which has date with time stamp
My scenario is
if losstime in between 4pm 29jan2011 (Here 4pm inclusive) to 4pm29jan2012 (Here 4pm is exclusive ) then the variable
Policy year = 2011/12 (Variable need to create as per the scenario)
if losstime in between 4pm 29jan2010 (Here 4pm inclusive) to 4pm29jan2011 (Here 4pm is exclusive ) then the variable
Policy year = 2010/11 (Variable need to create as per the scenario) etc...
Please help me with Sas and Sql code.
03-06-2013 08:50 AM
Is this a one time ad-hoc update?
Just use SQL update, with a set statement combined with a where clause.
Be sure that you use SAS date and datetime constants (if your data is stored correspondingly).
03-06-2013 09:22 AM
Sorry, now I get it!
Well, I should build a lookup-up table, containing your start and end datetime, for each policy year. Then you fetch the policy year in a join, or you could define the interval as a format, with the policy year as label (the formatted value).