The dataset orion.counsellor contains the following variables: Counsel_ID, DateOfBirth, Yrs_Exp, Salary.
Given the following code:
Data counsel_new;
Set orion.counsellor;
Study = Yrs_Exp + 3;
Bonus = Salary * 1.05;
Run;
Which of the following variables will be re-initialized at the start of each iteration of DATA Step?
(a) Yrs_Exp
(b) Counsel_ID
(c) Bonus
(d) DateOfBirth
Hi @Guru_MG,
Writing and testing small programs is very useful when learning SAS. So, why not observe what happens in practice (maxim 4)?
/* Create test data (if orion.counsellor does not yet exist) */
libname orion (work);
data orion.counsellor;
input Counsel_ID $ DateOfBirth Yrs_Exp Salary;
cards;
0 1 2 3
4 5 6 7
;
/* Run the DATA step in question with diagnostic PUT statements added */
data counsel_new;
put 'Start of iteration ' _n_ ': ' _all_;
set orion.counsellor;
Study = Yrs_Exp + 3;
Bonus = Salary * 1.05;
put 'End of iteration ' _n_ ': ' _all_;
run;
This is an example of a question you can answer without really knowing the material but based on the form of the question.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.