Hi ,
I have two tables test1 and test2 and need to join two tables by id and birthdat
(only by month and year not by date).The date formats are different in both the table.
Test1:
ID bthdat
1 19400420
2 19890929
5 19830624
Test2 :
ID bthdat
1 20/04/1938
2 29/04/1938
3 11/27/1938
Please let me know.
Thanks.
Are they both SAS dates but with different formats?
Yes Art..
I'm confused! Given your example, what would you expect your output to be? If they are both SAS dates, the format should be irrelevant and the month and year functions can be used. But I don't understand what result you are attempting to achieve.
Art,
In test 1 , the format for that field is best32. and test 2 the date format is MMDDYY10.
So you do NOT have two date fields. The first dataset has a number like 19,400,420 that you want to interpret as the date 1940/04/20.
To convert it use
bthdate = input(put(pthdate,z8.),yymmdd8.);
format bthdate yymmdd10.;
Also I am confused about dataset two. You say the format is MMDDYY10., but the dates you listed are have day before month.
Tom,
Actually two appear that way and the third one appears to be mmddyy. There is also the possibility that the big numbers represent datetime values but, if so, they are all from 1960. I still don't have any idea of what the OP wants as a result.
Raveena, can you let us know?
Hi Art,
I would like to skip this question. Even I am not so clear with this requirement.
Thanks for your valuable time in response for this question.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.