BookmarkSubscribeRSS Feed
Guru_MG
Fluorite | Level 6

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

4 REPLIES 4
FreelanceReinh
Jade | Level 19

Hi @Guru_MG,

 

Writing and testing small programs is very useful when learning SAS. So, why not observe what happens in practice (maxim 4)?

Spoiler
/* 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;
Tom
Super User Tom
Super User

This is an example of a question you can answer without really knowing the material but based on the form of the question.

https://muppet.fandom.com/wiki/One_of_These_Things 

Ksharp
Super User
C

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 758 views
  • 0 likes
  • 5 in conversation