What statement is used to read data from an external file in SAS?

Get ready for the SAS Advanced Programming Certification Exam. Use multiple choice questions and flashcards, with detailed explanations. Ensure success in your exam and enhance your SAS skills!

The statement that is used to read data from an external file in SAS is the INFILE statement. This statement specifies the location of the external file and allows SAS to access the data within that file. When you want to read raw data, for example from a CSV or a text file, you typically use the INFILE statement in conjunction with the DATA step.

Using the INFILE statement, you can control various aspects of data reading, such as specifying delimiters, handling line terminators, and defining the format of the data being read. This makes it a powerful tool for importing data accurately into SAS datasets.

The other statements are related to data handling in SAS but serve different purposes. The INPUT statement, for example, works in tandem with INFILE to describe how to read the values from the data lines once the INFILE statement has pointed to the correct external file. The FILE statement is used to write data to an external file, not to read it. The term READDATA is not a recognized SAS statement, which further reinforces that the INFILE statement is the correct choice for reading data from external sources.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy