Hi
I have a column in excel, variable : Time with HH:MM
I am trying to import in SAS, but my Time variable gives 0.333333....
I am trying to convert it :
DATA NT;
SET NT;
Time = input(Time, time5.);
FORMAT Time time5.;
RUN;
I have a new blank column Time in SAS.
Thanks for you answers !
Don't use the same data set name in your DATA and SET statement, it makes it really hard to trace your errors.
Can you show what your data looks like before you did your conversion?
Time
Time: 8:00 8:15 8:30 ... 18:00 in Excel
What did it look like when you imported the data into SAS?
What was the type and format of the variable?
Did you try applying a format rather than doing a conversion?
Thanks for your help.
problem is solved
PROC IMPORT DATAFILE="\\........\Name.xlsx"
DBMS=xlsx REPLACE OUT=NT;
SHEET='NT';
GETNAMES=YES;
FORMAT Time time5.;
RUN;
Ok now...
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.