Alicia Grossman,13,C,10-28-2008,7.8,6.5,7.2,8.0,7.9
Matthew Lee,9,D,10-30-2008,6.5,5.9,6.8,6.0,8.1
Elizabeth Garcia,10,C,10-29-2008,8.9,7.9,8.5,9.0,
,6,D,10-30-2008,6.7,5.6,4.9,5.2,6.1
Jose Martinez,7,D,10-31-2008,8.9,,10.0,9.7,9.0
Brian Williams,11,C,10-29-2008,7.8,8.4,8.5,7.9,8.0
Have to read this in with infile cannot get the right combination of options to deal with missing values, comma delimited, embedded blanks for name, length statement or informat for name . Tried as many combinations as I could come up with. here is most recent attempt.
DATA Pumkins2;
infile pumpkins DLM= ',';
input Name & $16. Age 2. Type $ EnterDate mmddyy10. j1-j5;
format EnterDate mmddyy10.;
RUN;
PROC PRINT;
RUN;
title;
When using delimiters, such as commas, don't try to give SAS instructions about how many characters to read. Instead, set a maximum length and let SAS figure out which characters to read. For example:
data test;
infile pumpkins dsd;
length name $ 16;
informat EnterDate mmddyy10.;
input Name Age Type $ EnterDate j1-j5;
format EnterDate mmddyy10.;
run;
When using delimiters, such as commas, don't try to give SAS instructions about how many characters to read. Instead, set a maximum length and let SAS figure out which characters to read. For example:
data test;
infile pumpkins dsd;
length name $ 16;
informat EnterDate mmddyy10.;
input Name Age Type $ EnterDate j1-j5;
format EnterDate mmddyy10.;
run;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.