I imported an excel file that has two date columns (B,C). I then created a computed column that references two datastes. One, that I imported and another one, dataset B that has a date column of D).If the dateB in dataset A equals a date D in dataset B then I want dateC from dataset A to populate. It does, but it populates as a string (20820) instead of 01MAR2017. If I look at datasetA after importing it shows up as 01MAR2017 and if I look at the dates in datasetB they also show up as 01MAR2017. Why is the computed column going to a string format?
In the computed column when I do the case statement it shows t1.'dateB'n which I assumed was the reason but when I try to type in 't1.'dateB'd it errors.
Please help!
t1.'dateB'n - this has nothing to do with it. '...'n refers to a variable using named literals (i.e. doesn't conform to SAS standards).
20820 - this is the numeric representation of a date. Dates in SAS a numbers of days since a certain date, to display them in a date format, you would need to apply a date format for instance date9.
As for it being read in a character, that doesn't sound right as the date number is there, I assume you should just be able to apply a format to that variable.
t1.'dateB'n - this has nothing to do with it. '...'n refers to a variable using named literals (i.e. doesn't conform to SAS standards).
20820 - this is the numeric representation of a date. Dates in SAS a numbers of days since a certain date, to display them in a date format, you would need to apply a date format for instance date9.
As for it being read in a character, that doesn't sound right as the date number is there, I assume you should just be able to apply a format to that variable.
The format worked. For some reason I picked a different date format and still spit out numbers but when I clicked Date9. it came out in the excel sheet as a date.
Thanks for the help!
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.