Hi I'm working in SAS platform and I've a data_set with more then 30 columns. there are two date columns in that data-set. dates in that data set are in format as 1.33E12
This is the little part of my table
I want to create a new data-set with few columns and then I'm exporting it to excel file.
my code is
dataset
othercolumns | date1 | date2
- 1.33E12 2.53E14
proc sql noprint;
create table my_data_set as
select ID, col_1, col_2, date1, date2
from data_set;
quit;
I want my date values in date1 and date2 column in a readable format like 10feb2017 as date9. SAS date format so they can be exported to my excel file. right now with E power dates I'm getting #######
as date1 and date2 columns in excel
I've tried
select ID, col_1, col_2, datepaart(date1), datepart(date2)
Warning: Invalid Argument, getting '.' values in date column
select ID, col_1, col_2, date1 date9., date2 date9.
select ID, col_1, col_2, date1 DATEw., date2 DATEw.
Error: Syntax error
select ID, col_1, col_2, date1 format=DATE9., date2 format=DATE9.
Getting the same E date values in my table
select ID, col_1, col_2, put(date1 , date9. ), put(date2 , date9.)
Error: Date value out of range
How to convert the E date into a readable format into my table so i can export it to excel?
this is my export code
ods excel file ="C:\data.xlsx";
ods excel close;
proc export
data = work.my_data_set
dbms = xlsx
outfile = "C:\data.xlsx"
replace;
quit;