What is the correct syntax to select specific columns from a SAS table?

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 correct syntax for selecting specific columns from a SAS table is to use the SELECT clause followed by the specified column names and then indicate the dataset from which to select. In this case, the phrasing must follow the SQL standard, which clearly states that you should begin with the SELECT statement, list the columns you want to retrieve, and then follow it up with the FROM clause indicating the dataset.

The choice that correctly adheres to this syntax is the one that includes the SELECT keyword at the start, lists the required columns (Make, Model, MPG_City), and then specifies the source table (sashelp.cars) in the FROM statement. This structure is consistent with the SQL language which is used in SAS for querying data.

In this context, the other options deviate from the correct syntax in various ways: some do not separate column names with commas, others place the FROM clause incorrectly or omit required punctuation, which would result in syntax errors when attempting to execute the code. Thus, option B is the proper choice for correctly selecting specific columns from a SAS table.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy