Dear SAS users
I have a variable "Birth_date" with dates of birth. The variable containts numbers between 14316 and 36329. As far as I know the SAS date of birth format counts from the year 1960 so that jan 1st 1960 is "1" and so forth.
If I do a proc freq with a date9. format I get dates between year 2011 and year 2052. That doesn't quite make sense since the data should be covering current employees from ages at maybe 16 and up. So I would expect dates between maybe year 1940 and year 2000 or something like that:
proc freq data =NEW.Samlet;
format Birth_date date9.;
table Birth_date;
run;
Am I doing something wrong or does my data simply contain nonsense?
Kind regards,
Jacob
Where do you get those numbers from? 14316=13MAR1999?
Did you get the data from Excel, if so Excel holds date values from a different base date so the number is different.
Dear RW9
The data comes from an employee database and we use SAS primarily so therefore I was expecting the numbers to express a SAS-format. I thought that maybe the explanation was that more than one baseline-format existed in SAS, such as if a 1900-baseline was also sometimes used, then maybe that would explain the distribution.
Kind regards,
Jacob
Well there is:
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000197881.htm
However you need to know what those numbers actually refer to. I would also be careful about changing the option as it may affect other data's representation in the same session.
Thanks
@Jbraun wrote:
Dear SAS users
I have a variable "Birth_date" with dates of birth. The variable containts numbers between 14316 and 36329. As far as I know the SAS date of birth format counts from the year 1960 so that jan 1st 1960 is "1" and so forth.
You might be interested to know that those example numbers will be 3/12/1939 and 6/18/1999 if treated as EXCEL date values which uses 1/1/1900 as it's base date. Perhaps the data base imported data from Excel but did not use or associate a date format with them, or the date format did not carry over from export or however you moved the data into SAS.
@ballardwthanks, that age span would definitely make a lot more sense. I will of course look for documentation to make sure.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.