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?
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.