SAS Certified Base Programmer 50 Questions (3)
The following program is submitted:
data numrecords; infile cards dlm=','; input agent1 $ agent2 $ agent3 $; cards; jones,,brownjones,spencer,brown ; run;
What is the value for the variable named Agent2 in the second observation?
a. brown
b. spencer
c. ”(missing character value)
d. There is no value because only one observation is created
Topics:
SAS Base Questions |
20 Comments »
D
None of the above options.
answer is brownjon
Ans: brownjon
Since 8 character is default length and without dsd it will ignore two consecutive delimiter and consider as single.
The question asked for agent2 in the 2nd observation not in the 1st observation. D is correct.
you guys are right about brownjon, but thats for the 1st obs, but its asking for the 2nd obs
D is the correct option. This dataset will create only one observation.
I run it on sas, it should be brownjon
true. Answer is brownjon
Yes, brownjon is the correct ans.
Question asks value for variable
Agent2 in the SECOND OBS.
D is right ans.
The answer is D.
Please read the question carefully.
What is the value for the variable named Agent2 in the SECOND observation?
There will NOT be a SECOND observation because only ONE line of rawdata is read SAS will create only one observation.
I agree with Deepak. A sample of a sas program is the following.
data wonderful ;
infile datalines dsd dlm=’,’;
input agent1 $ agent2 $ agent3 $ agent4 $;
datalines;
jones,,brownjones,spencer,brown
;
run; proc print data=wonderful; run;
and the output is:
agent1 agent2 agent3 agent4
jones brownjon spencer
Yes,both Ravi and deepak are right.
guys, it’s asking about the 2nd observation, not the second variable. it’s a stupid trick you have to look out for.
answer = ‘D’ try
Actually I believe the answer is A. the first observation has jones missing brownjon then the second observation has spencer brown missing.
@Ravi and Deepak: The question is about the value within the 2nd observation. There is only one observation and therefore answer D is correct
Yes this correct answer
None of the above options.
answer is brownjon
data numrecords;
infile cards dlm=’ ‘ dsd;
input agent1 $ agent2 $ agent3 $ @@;
cards;
jones brownjones spencer brown
;
run;
the above program returns 18 observations WHY plz help
—————————————
Obs agent1 agent2 agent3
1 jones brownjon spencer
—————————————-
This is the output. There is no SECOND obs. So answer is option D.