I tried to do a math of the Elapstime, for example: Time_pickup =15:00 and Time_received=15:36, so the Elapstime will be Time_received - Time_pickup.
the result is not showing the time value, like 0:36 instead 2160.
does any one know what is the 'Time Format' is?
thank you.
Try this:
format Elapstime time5.;
Good luck.
Anca.
thank you so much, Anca, it's very helpful.
Another problem is, when I got the Elapsed_time fixed, but, when I run it in proc means, it came back as a long number again instead of like 0:35.
Do you know how to fix it?
thanks,
data have;
input time;
cards;
2160
2161
2162
2163
;
proc means data=have mean noprint;
var time;
format time time5.;
output out=temp(drop=_:) mean=mean;
run;
proc print data=temp;run;
Obs mean
1 0:36
thank you very much.
do you mind to explain to me what is the "output out=temp(drop=_:) mean= mean" means?
thank you.
You are welcome!
"output out=" creates a dataset," (drop=_:)" drop all the variables begin with _. "mean=mean" names the calculated mean mean.
you may understand better by running the modified code below:
data have;
input time;
cards;
2160
2161
2162
3863
;
proc means data=have mean noprint;
var time;
format time time5.;
output out=new_dataset /* temp(drop=_:)*/ mean=aaa /*mean*/;
run;
proc print data=new_dataset;run;
Obs _TYPE_ _FREQ_ aaa
1 0 4 0:43
Thank you again, Have a great weekend!
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.