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
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 16. 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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: