How are your SAS Skills? Chapter 1: Accessing Data (Question # 1) When merging data sets using the MERGE statement, which data set, first or second, has data values that overwrite data values for common variables? Sharpening Your SAS Skills, Sunil Gupta, www.SASSavvy.com
How are your SAS Skills? Chapter 1: Accessing Data (Answer # 1) For common variables, the second data set has data values that overwrite data values of the first data set when merging two data sets using the MERGE statement. Sharpening Your SAS Skills, Sunil Gupta, www.SASSavvy.com
How are your SAS Skills? Chapter 2: Creating Data Structures (Question # 2) What is the order of sequence if both DROP and KEEP statements are applied within the DATA step? Sharpening Your SAS Skills, Sunil Gupta, www.SASSavvy.com
How are your SAS Skills? Chapter 2: Creating Data Structures (Answer # 2) If both DROP and KEEP statements are applied within the DATA step, then the order of priority is DROP and then KEEP. Sharpening Your SAS Skills, Sunil Gupta, www.SASSavvy.com
How are your SAS Skills? Chapter 3: Managing Data (Question # 3) Is it possible to use the RETAIN statement to preserve a character string in a character variable? Sharpening Your SAS Skills, Sunil Gupta, www.SASSavvy.com
How are your SAS Skills? Chapter 3: Managing Data (Answer # 3) Yes, it is possible to use the RETAIN statement to preserve a character string in a character variable without resetting to blanks for the next observation. Also works for numeric variables. Sharpening Your SAS Skills, Sunil Gupta, www.SASSavvy.com
How are your SAS Skills? Chapter 4: Generating Reports (Question # 4) What is one difference between the MEANS procedure and the SUMMARY procedure? Sharpening Your SAS Skills, Sunil Gupta, www.SASSavvy.com
How are your SAS Skills? Chapter 4: Generating Reports (Answer # 4) By default, the MEANS procedure produces a report while the SUMMARY procedure provides an output data set unless the PRINT option is specified. Other than that, the two SAS procedures are similar in syntax and results. Sharpening Your SAS Skills, Sunil Gupta, www.SASSavvy.com
How are your SAS Skills? Chapter 5: Handling Errors (Question # 5) Is it possible to get the note ‘Invalid Data’ when using the SET statement in a DATA step? Sharpening Your SAS Skills, Sunil Gupta, www.SASSavvy.com
How are your SAS Skills? Chapter 5: Handling Errors (Answer # 5) No, the ‘Invalid Data’ note appears when SAS encounters unexpected data while reading the data using the INPUT statement. When using the SET statement, you are accessing a data set that is already created. Sharpening Your SAS Skills, Sunil Gupta, www.SASSavvy.com