Date: Wed, 11 Nov 2009 13:09:44 -0600
Reply-To: Joe Matise <snoopy369@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Joe Matise <snoopy369@GMAIL.COM>
Subject: Re: Base sas certification question (Found somewhere )
In-Reply-To: <200911111849.nABHOpN3027542@malibu.cc.uga.edu>
Content-Type: text/plain; charset=UTF-8
I like the question, myself; it's a great example of a question that both
tests your knowledge of programming, AND shows an example of a common
real-world mistake. I doubt I'd get it right more than 2/3 of the time,
even though I'm well aware of the concepts involved.
I don't have any problem with how it's worded; to word it otherwise would
give away the answer after all. It asks you a direct question based on data
provided, and the correct answer is in the list of choices. Pretty much
every SAT-like test I've ever seen is written precisely this way; while the
meaningful (essay question) answer might be much more complex than the
direct (multiple choice) answer, in multiple choice this is pretty much the
only way to go about it, and at least in my opinion adequately tests for the
knowledge desired.
-Joe
On Wed, Nov 11, 2009 at 12:49 PM, Arthur Tabachneck <art297@netscape.net>wrote:
> I agree with data_null_'s rationale, but would complain that it is a
> poorly written (though cute concept) question.
>
> I think the more correct answer would be conditional. I.e., if x has the
> value 'Sue', and Sue's record was an odd numbered record, then age would
> be missing and height would equal whatever was in columns 8 and 9 of the
> immediately following record, otherwise 'Sue' wouldn't be assigned any
> values in the resulting file.
>
> Art
> ---------
> On Wed, 11 Nov 2009 12:35:27 -0600, Data _null_; <iebupdte@GMAIL.COM>
> wrote:
>
> >It is because the line that X is read from is "gone" when the INPUT
> >statements in the IF are executed. The read from the next line BOB
> >and MAM.
> >
> >The INPUT X $1-3 /*needs*/ @; To make it work as might have been
> >intended, or as you though it would.
> >
> >On 11/11/09, SAS_learner <proccontents@gmail.com> wrote:
> >> Base sas certification question
> >> Flat file structure is as below
> >> 1----5----10
> >> dan 23 45
> >> bob 44 50
> >> sue 30 80
> >> mam 40 50
> >>
> >> The following code is submitted.
> >> data temp;
> >> infile �file specification�;
> >> input x $ 1-3;
> >> if x='sue' then input age 5-6;
> >> else input height 8-9;
> >> run;
> >>
> >> what would be the value of variable AGE in the dataset TEMP when
> variable X
> >> has the value �Sue�?
> >> a) 30
> >> b) 44
> >> c) 40
> >> d) 55
> >>
> >> Ans: c
> >>
> >> can anyone plz explain me why the ans is 40. Thanks in advance.
> >>
> >> Thanks
> >> SL
> >>
>
|