Why isn SAS reading my datalines correctly from an external file?
When you read a file, you must be sure that there aren’t extra characters or missing characters anywhere in the dataset. Sometimes when you download a file using a browser, hidden junk characters are placed at the end of each line. SAS will think these are data, and so it will become very confused. Depending upon how you view downloaded files, you may or may not see these extra characters. If data are in fixed columns, it is always safer to specify column location, rather than using free format (relying on blank spaces or other delimiters to distinguish variables). Furthermore, if there are missing characters, SAS will be confused, as it will think the value immediately following the missing one is the right one, when it isn’t. It is helpful to use the keyword ‘missover’ at the end of the INFILE command to tell SAS that if data are missing for one case (subject) not to go to the next case (dataline) looking for the missing values.
Related Questions
- How can I incorporate information about external variables such as the gender of the research participant into the data file?
- I am testing a script, and faking log file entries but EQWatcher isn reading them. How can I do this?
- I have a PDF file which PdfGrabber is not reading correctly. Am I doing something wrong?