The SAS Output Delivery System and reporting techniques

variable with time13.3 format to numeric format conversion

Reply
Frequent Contributor
Posts: 78

variable with time13.3 format to numeric format conversion

I may have lost my mind at the moment so any quick idea would help certainly....

So I have variable which is in the TIME13.3 format whereas  I have another variable which is in numeric format ....Now I need to put a WHERE clause however before that need to convert TIME13.3 format variable to the numeric format I tried PUT function however that doesn't seems to work...quick thought please?

Contributor
Posts: 45

Re: variable with time13.3 format to numeric format conversion

May be you can use a similar code like the code I have given below.

MYTIME = INPUT(PUT(TIME1,BEST12.),$40.);

Super User
Posts: 7,403

Re: variable with time13.3 format to numeric format conversion

TIME13.3 is a numeric format, so your variable is already numeric (seconds of the day) and can be "converted" by simply changing its format.

I suspect that yoout other variable has a specific sequence of digits; could you give an example?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Frequent Contributor
Posts: 78

Re: variable with time13.3 format to numeric format conversion

Thanks Kurt you was correct i put the TIMEPART(VAR2) and it resolved the problem...thanks for pointing in right direction..

Ask a Question
Discussion stats
  • 3 replies
  • 461 views
  • 1 like
  • 3 in conversation