Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why isn SAS reading my datalines correctly from an external file?

0
Posted

Why isn SAS reading my datalines correctly from an external file?

0

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

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123