Chapter 6: Advanced SQL Techniques

  1. Correct answer: a
    You can use the INTO clause to create one or more macro variables in the SELECT clause. The INTO keyword is followed by a colon (:) and then the macro variable name.
  2. Correct answer: c
    You cannot create a macro variable in the same SQL step in which you are calling the macro variable. To create a report that does not contain any duplicate items including the values in the macro variable, use the DISTINCT keyword in the SELECT clause.
  3. Correct answer: d
    When storing a value in a single macro variable, PROC SQL preserves leading or trailing blanks. You can use the TRIMMED option in the INTO clause to remove the leading and trailing blanks. Use the INTO keyword followed by a colon (:), followed by the macro variable named, followed by the keyword TRIMMED.
  4. Correct answer: a
    You can use the SEPARATED BY keyword in the INTO clause to specify a character to delimit the values into a macro variable. You do not need to use the TRIMMED keyword with the SEPARATED BY keyword because it removes leading and trailing blanks from each value before performing the concatenation of values.
  5. Correct answer: b
    While the foundation of PROC FedSQL syntax is similar to PROC SQL, there are a few differences when it comes to specific SAS enhancements such as formats. In order to associate a format with a variable in the output, use the PUT function.
  6. Correct answer: d
    In PROC FedSQL when you want to limit the number of rows, use the LIMIT clause in the SELECT statement. The LIMIT clause is the LIMIT keyword followed by the count or the number of rows you want to display in the output. You cannot use INOBS= in PROC FedSQL.
Last updated: October 16, 2019
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.107.110