I took SAS Advanced practice exam couple of days back and I have some doubts on one question regarding creating a macro variable that contains list of comma-separated values. Here is the question from the exam: Use SAS dictionary tables, run a PROC SQL query to create a macro variable named COL_LIST which contains a comma separated list of the columns contained in the CERT.AIR10 data set. If needed, use the DESCRIBE TABLE statement to display the column attributes of the dictionary.columns table. Question: What is the value of the col_list macro variable? I answered: DATE,AIR Per exam result: my answer was wrong Solution given by SAS: proc sql ; select distinct name into :col_list separated by ', ' from dictionary.columns where libname='CERT' and memname="AIR10"; quit; The correct answer is: AIR, DATE Could someone please help me understand: Why the ‘distinct’ keyword and 'comma with blank space' are used. Thanks.
... View more