Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"Because of this forum, I continue to WOW! my clients!"

Geography

Where in the world do Tek-Tips members come from?
katrina11 (TechnicalUser)
17 Apr 12 11:14
Hi Experts,

I really need your help.Proc contents gave me the following:

Variable      Type  Len   Format         Informat       Label
AdmitDate     Num    8   DATETIME22.3   DATETIME22.3   AdmitDate
HospDischDate Num    8
   

HospDischDate  looks like : 1594252800
AdmitDate      looks like : 09JUL2010:00:00:00.000

How can I convert HospDischDate in order to look like AdmitDate?

I have to do some calculations as I keep getting
unexpected results. So far I really need to visually compare dates values on each step.

Thank you!

Katrin
sasbuddy (Programmer)
18 Apr 12 2:08
Hi Katrin

IF you observe the PROC CONTENTS output; you can see that AdmitDate variable has got format datetime22.3 while HospDischDate havent got any format.

But I dont see any reason which would create problem in any kind of calculations.

Suppose you want to get difference between Hospital Admit Date and Hospital Discharge Date; you can use following expression.

no_of_admit_days = intck('DAY', datepart(AdmitDate), datepart(HospDischDate));

It should work absolutely fine.

Any how if you want to see the HospDischDate in same foramt as AdmitDate then you can use following PROC DATASETS CODE.

proc datasets lib= (provide the library name for the dataset here) ;
modify (provide the dataset name here);
format HospDischDate datetime22.3;
quit;

GoodLuck

 

sasbuddy
http://sites.google.com/site/sasbuddy/
 

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close