I am having a problem to input the text file, the sample data is shown below.
I found out when I created my codes below, it didn't work. Starting with column "admitdate", the date is missing. Please help. Thanks.
data test; infile "Pathway/test.txt" dlm=',' dsd missover lrecl=47 firstobs=2; input id $ site provider hospital scr $ abi $ dein $ caseid $ date $ dob $ admitdate $ admittime $ years months days insurance sex race1 race2 race3 race4 race5 race6 hisp zipcode county $ symptom1 scrsymptom2 scrsymptom3 scrsymptom4 scrsymptom5 scrsymptom6 scrsymptom7 scrsymptom8 scrsymptom9 scrsymptom10 scrsymptom11 $ exclusion1 exclusion2 exclusion3 exclusion4 exclusion5 exclusion6 exclusion7 exclusion8 exclusion9 exclusion10 $ elig consent1 $ consent2 $ consent interview complete; run;
I strongly suggest reading Date values with a DATE informat and Times with a time informat. You can do a lot more with actual SAS Date and time values than character. Almost anything, including sorting, with character values as you show will require conversion to a date or headaches with multiple additional steps to get the values you want.
I suggest reading those dates with MMDDYY8. informat and the time with time8.
Assign an appropriate display format for people to use.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.