Hello!
What informat should i use to read the following data values as numeric variables form a csv?
"Sun, 22 Feb 2004"
input date:?????
Thanks in advance,
Andreas
First, remove the day of the week from the text string. Compress the blanks, and then the date9 informat should work.
data a;
y='22 Feb 2004';
x=input(compress(y),date9.);
format x date9.;
run;
@andreas4 wrote:
Hello!
What informat should i use to read the following data values as numeric variables form a csv?
"Sun, 22 Feb 2004"
input date:?????
Thanks in advance,
Andreas
If that is the way the data is in the CSV you likely will need to read the value as character then so something like:
data example; x="Sun, 22 Feb 2004"; y= input(scan(x,2,','),anydtdte16.); format y date9.; run;
to create a date value.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.