Hello,
A portion of my current table looks like this:
U |
:00:00 |
:00:08 |
:00:00 |
:00:13 |
:00:00 |
:00:11 |
:00:04 |
and in SAS U is considered Character. I am needing to switch it to numeric with the exact same information. So doing
Time = (U*1)
is not working. Any advice on how to get to the result is appreciated.
Thank you!
You must create a new variable:
data want;
set have (rename=(u=_u));
u = input("00" !! _u,time8.);
format u mmss5.;
drop _u;
run;
You must create a new variable:
data want;
set have (rename=(u=_u));
u = input("00" !! _u,time8.);
format u mmss5.;
drop _u;
run;
Is that value truncated? It looks like it's missing leading 00 with the colon at the front?
This is exactly how I get the export from the source, So I am unsure what happens with it before it gets to me. But I know that it stands for minutes and seconds
In which form do you get your data? Already as a SAS dataset, as a text file, Excel, or through a connection with a database?
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.