Tring to importime with the following format. have about 1000 rows of data.
data tm_data;
informat pid $4. stm etm stimer8.;
format stm etm mmss.;
infile datalines truncover;
input pid stm etm;
datalines;
2867 0:25 00:25
2936 8:47 10:03
3015 8:45 10:01
3088 8:44 10:00
3161 8:46 10:03
3234 8:43 9:59
....
....
;
run;
This does not seem to work
Can anybody help
by any chance you want this?
data tm_data;
informat pid $4. stm etm time5.;
format stm etm time5.;
infile datalines truncover;
input pid stm etm;
datalines;
2867 0:25 00:25
2936 8:47 10:03
3015 8:45 10:01
3088 8:44 10:00
3161 8:46 10:03
3234 8:43 9:59
;
run;
by any chance you want this?
data tm_data;
informat pid $4. stm etm time5.;
format stm etm time5.;
infile datalines truncover;
input pid stm etm;
datalines;
2867 0:25 00:25
2936 8:47 10:03
3015 8:45 10:01
3088 8:44 10:00
3161 8:46 10:03
3234 8:43 9:59
;
run;
Thanks it worked.
Adjusted space between columns to a single space
Ok I am glad. I hope you noticed the use of time5. informat in the solution I provided as opposed to stimer that you used. I assumed you wanted time5 rather.
Your code worked fine too.
1643 data tm_data;
1644 informat pid $4. stm etm stimer8.;
1645 format stm etm mmss.;
1646 infile datalines truncover;
1647 input pid stm etm;
1648 datalines;
NOTE: The data set WORK.TM_DATA has 6 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
Use Time. Informat instead.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.