Hi Mates,
I am trying to convert numeric date type column to YYMMDDD10. format using datepart. But when I try this command, it always give me the value of " 1960-01-01" which is not the correct date. I just wonder if you can help me figuring out what wrong with it.
Here is the data:

and here is the code:
proc sql; /* why I can't convert date1 to correct date */
create table z_raw_final as
select date1, datepart(date1) as d_mth format YYMMDDD10.
, n_quarter
, gdp_base
, retail_sales_base as rto_base
, ICR_base
, business_credit_base as bcg_base
from z_raw1
where n_quarter > -41 and n_quarter <= 20 ;
quit;
I also try another way that I found in this forum but just get NULL values
data z_raw_final;
set z_raw_final;
format date1 datetime20.;
run;
Thanks for your help!
Phong Pham