I have a SAS file with field named MYTIME which is Numeric and TIME. format associated. I want to write this to Excel, letting a co-worker edit some other fields, then read back into SAS. Problem is importing back into SAS, MYTIME is assigned TEXT type. To write from SAS to Excel, and make sure format of MYTIME is kept as a time in Excel, I use: ods excel file="myfile.xlsx";
proc print data=mydata;
var A B C;
var MYTIME / style(data)={tagattr='format:h:mm'};
run;
ods excel close; When I open Excel, it has correctly assigned a format of h:mm to the MYTIME column, so that looks good, but when I re-import the Excel file into SAS using this code... proc import file="myfile.xlsx" dbms=xlsx out=test_read replace; run; ... MYTIME now is type TEXT with format $8., not NUMERIC with TIME. format! If I build an Excel file from scratch and enter a time into a cell, it correctly imports to SAS using PROC IMPORT code above, so something different is happening when I create the Excel file via SAS, but what?
... View more