Statistical Analysis System (SAS) Programming Certification Practice Exam

Disable ads (and more) with a membership for a one time $2.99 payment

Study for the SAS Programming Certification Exam. Master multiple choice questions, check explanations, and gear up for success. Boost your knowledge and confidence with engaging content!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


Which program contains an error in its variable handling?

  1. data stresstest(drop=timemin timesec);

  2. proc print data=stresstest; drop sumsec;

  3. proc print data=stresstest(keep=totaltime timemin);

  4. data stresstest; keep id totaltime tolerance;

The correct answer is: proc print data=stresstest; drop sumsec;

The choice that contains an error in its variable handling involves misunderstanding the scope and purpose of the `drop` statement in the PROC PRINT step. In statistical programming with SAS, the `drop` statement is used to exclude specific variables from the output dataset or reports. In the case of PROC PRINT, the `drop` statement can be applied when printing data, but it affects only the columns displayed in the output. The specific issue with this choice is that it attempts to drop a variable named `sumsec`, which might not be present in the dataset `stresstest`. If `sumsec` does not exist in the `stresstest` dataset, it would lead to an error because SAS cannot find a variable that was specified to be dropped. This indicates a fundamental oversight in understanding the dataset’s structure. In contrast, other options correctly handle variable inclusion and exclusion based on their contexts. The `keep` statement in PROC PRINT and the use of `drop` in the data step simply focus on managing variable display within the respective scopes and do not encounter similar issues with non-existent variables. This distinction is crucial for effective management of variable handling in SAS programming.