data learn.medical;
input Patno : $3.
Clinic & $15.
VisitDate : mmddyy10.
Weight : 3.
HR : 3.
DX : $3.
Comment & $50.;
format VisitDate mmddyy10.;
label VisitDate = 'Visit Date'
HR = 'Heart Rate';
datalines;
001 Mayo Clinic 10/21/2006 120 78 7 Patient has had a persistent cough for 3 weeks.
003 HMC 9/1/2006 166 58 8 Patient placed on beta-blockers on 7/1/2006
002 Mayo Clinic 10/01/2006 210 68 9 Patient has been on antibiotics for 10 days
004 HMC 11/11/2006 288 88 9 Patient advised to lose some weight
007 Mayo Clinic 5/1/2006 180 54 7 This patient is always under high stress
050 HMC 7/6/2006 199 60 123 Refer this patient to mental health for evaluation
;
proc print data = learn.medical;
run;
It seems to work fine. Can you elaborate what doesn't work?
LOG:
57
58 data medical;
59 input Patno : $3.
60 Clinic & $15.
61 VisitDate : mmddyy10.
62 Weight : 3.
63 HR : 3.
64 DX : $3.
65 Comment & $50.;
66 format VisitDate mmddyy10.;
67 label VisitDate = 'Visit Date'
68 HR = 'Heart Rate';
69 datalines;
NOTE: The data set WORK.MEDICAL has 6 observations and 7 variables.
NOTE: DATA statement used (Total process time):
real time 2.12 seconds
cpu time 0.04 seconds
76 ;
Did you assign the libname 'learn' before running your code. e.g.,
libname learn '/folders/myfolders';
Art, CEO, AnalystFinder.com
Always READ and post the log when something "does not work".
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.