Good morning all,
I've got 3 different columns in a data set that represent a month, a date, and a year as numbers. My issue right now is concatenating these together in PROC SQL while keeping them formatted as a date. So far, I've tried the following, but I'm only getting results that show every date as a period ("."). You'll notice that I had to convert them to characters to be able to concatenate them.
PROC SQL;
SELECT
INPUT(PUT(f.MTH,z2.) || '-' || PUT(f.DAY,z2.) || '-' || PUT(f.YR,z4.),date9.)
FROM
table f
;QUIT;
I tired rearranging the year/day/month, and tried with and without the '-' between them. Still, I'm just getting a period in every row.
It is worth noting that the numbers look fine when just concatenated by themselves, without any attempt at date formatting. But I need their column to be a DATE column for the process the data is being used for.
PUT(f.YR,z4.)|| PUT(f.MTH,z2.) ||PUT(f.DAY,z2.)
^looks fine with and without '-' separating the numbers. On that note, the date9. format isn't the absolute needed date format, I really just need it to be a DATE of some sort.
What am I missing here? Should I not be relying so heavily on PROC SQL to do this?