Dear ALL,
value | time |
0.00036548 | 0:00:32 |
0.0022222 | 0:03:12 |
0.0005 | 0:00:43 |
In the above table i got value column after so many calculations.
In time column i just applied time format in excel can we do the same in sas.
Used excel format 37:30:55.
Please help me its urgent for me.
Regards,
Sravan
Hi Sravan,
Is this what you want to achieve ?
data want;
set have;
format time tod8.;
time = value * 86400;
run;
Kr,
Florent
SAS stores time as the number of seconds since midnight. Excel is storing it as a fraction of a day. So to convert your variable VALUE to a variable that you could treat as time in SAS you need to mulitply by 24 hours.
66 data want ;
67 input value time time. ;
68 time2 = value*'24:00:00't ;
69 format time time2 time.;
70 put (_all_) (=);
71 cards;
value=0.00036548 time=0:00:32 time2=0:00:32
value=0.0022222 time=0:03:12 time2=0:03:12
value=0.0005 time=0:00:43 time2=0:00:43
Just another way
data want;
input value time time8.;
format time time8.;
cards;
0.00036548 0:00:32
0.0022222 0:03:12
0.0005 0:00:43
;
proc print;
run;
Thanks,
Jagadish
I think he wanted to know how to create the 'time' variable from the 'value' variable instead of reading both. Your example is just reading values, there is no calculation.
Regards,
Florent
Thank every one i got my answer.
Once again thanks a lot.
Regards,
Shraz's
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 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.