BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jc3992
Pyrite | Level 9
data work.roth_ira; start = 1000;
do year = 1 to 30; savings + 5000;
do month = 1 to 12;
int = savings * (.05/12);
savings + int; end;
output;

84. How many variables/observations will come from the below program? Thank you!

 

 

 
1 ACCEPTED SOLUTION

Accepted Solutions
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

the code @jc3992 has is incorrect;

you have unclosed do block.

if the code was as this

data work.roth_ira; 
start = 1000;
do year = 1 to 30; savings + 5000;
do month = 1 to 12;
int = savings * (.05/12);
savings + int; 
end;
output;
end;
run;

there would be 30 output records

if the code had the end to the do loop before the output like this

data work.roth_ira; 
start = 1000;
do year = 1 to 30; savings + 5000;
do month = 1 to 12;
int = savings * (.05/12);
savings + int; 
end;
end;
output;
run;

there would be 1 record output

 

 

 

 

 

 

View solution in original post

9 REPLIES 9
novinosrin
Tourmaline | Level 20

30 & 5?

 

If I'm  wrong, i blame it on being tipsy

Reeza
Super User
Technically it's incomplete and would error out.
novinosrin
Tourmaline | Level 20

Btw #84 , where did you get this from?

jc3992
Pyrite | Level 9

I forgot. Maybe the 95 former questions I guess

Reeza
Super User

Those type of questions are usually from a test dump. The exams have been recently redesigned though and I don't think the old materials will supply coverage for the current exams. 

 


@novinosrin wrote:

Btw #84 , where did you get this from?


 

novinosrin
Tourmaline | Level 20

Thank you @Reeza,So are you sure no more dumps circling around. True merit system has been restored or put into effect.

 

Ok some relevant fun or laughter 

 

I've met some Advanced Certified folks who would ask questions like how to reorder variables in a SAS data set or seek help with "proc MERGE" ;). Go figure...

 

That's hilarious 🙂

 

 

EDIT: I assumed dumps meaning leaked questions, but if the meaning is something to do with practice papers, I beg  pardon 

 

 

Reeza
Super User
Oh there are a lot more dumps circling around, but they're no long as useful. It will be a while again before they are but it's why I test candidates for skills. And I've also had the same response as PMD after hiring...fortunately that was not my responsibility at the time.
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

the code @jc3992 has is incorrect;

you have unclosed do block.

if the code was as this

data work.roth_ira; 
start = 1000;
do year = 1 to 30; savings + 5000;
do month = 1 to 12;
int = savings * (.05/12);
savings + int; 
end;
output;
end;
run;

there would be 30 output records

if the code had the end to the do loop before the output like this

data work.roth_ira; 
start = 1000;
do year = 1 to 30; savings + 5000;
do month = 1 to 12;
int = savings * (.05/12);
savings + int; 
end;
end;
output;
run;

there would be 1 record output

 

 

 

 

 

 

ballardw
Super User

Run the code and see.

 

Bonus points for seeing the syntax errors before running the code. (especially with a poor code layout style)

 

And actually without seeing the end of a data step one could make an argument for "can't tell" as there could be more code before a not-shown run statement that affects the number of variables.

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 9 replies
  • 1704 views
  • 1 like
  • 5 in conversation