Hi,
I used the following code to call the attached data set. When i checked the log file I noticed something wasn't right.( Error was about INVALID DATA)
Should I worry about this or is there a way to correct it.
Thanks.
data test;
infile "F:\data\ftse.csv" DSD MISSOVER;
input Date Close adjclose returns dm dt dw dh df;
run;
There are at least three errors, two in the program and one in the file.
In your code you are not accounting for the fact that the datafile has a header record, nor are you accounting for the fact that the first field is a date field.
I think you'll find that the following would work a lot better:
options datestyle=mdy;
data test;
infile "f:\data\ftse.csv" DSD MISSOVER firstobs=2;
informat date anydtdte10.;
input Date Close adjclose returns dm dt dw dh df;
run;
As for the datafile's header record, there is a problem with it and I would ask the supplier to correct it. There are two dt fields identified, thus one doesn't know which contains the right data. You called the second one df, in your code, thus you may already know about the discrepancy.
There are at least three errors, two in the program and one in the file.
In your code you are not accounting for the fact that the datafile has a header record, nor are you accounting for the fact that the first field is a date field.
I think you'll find that the following would work a lot better:
options datestyle=mdy;
data test;
infile "f:\data\ftse.csv" DSD MISSOVER firstobs=2;
informat date anydtdte10.;
input Date Close adjclose returns dm dt dw dh df;
run;
As for the datafile's header record, there is a problem with it and I would ask the supplier to correct it. There are two dt fields identified, thus one doesn't know which contains the right data. You called the second one df, in your code, thus you may already know about the discrepancy.
Thank you very much!
doesnt he also have to declare the lrecl=5558 as the number of records is close to this number?
right! Totally confused them .Thank you though
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.