BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
TheresaM
Obsidian | Level 7

I'm taking a practice exam for Base Programming Performance-Based Certification Exam for SAS 9.4 and am stuck on what I know is a simple question.

For the following question, I thought the obvious answer was 1 numeric variable (answer B). But the answer key says 0 (answer A). Why is that? Thanks in advance!

 

The following SAS program is submitted:

 

data employees;
   infile 'file-specification';
   input @1 name $10.
         @15 date date9.
         @25 department $;
Run;

How many numeric variables are created:

A. 0

B. 1

C. 2

D. 3

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

@TheresaM wrote:

I'm taking a practice exam for Base Programming Performance-Based Certification Exam for SAS 9.4 and am stuck on what I know is a simple question.

For the following question, I thought the obvious answer was 1 numeric variable (answer B). But the answer key says 0 (answer A). Why is that? Thanks in advance!

 

The following SAS program is submitted:

 

data employees;
   infile 'file-specification';
   input @1 name $10.
         @15 date date9.
         @25 department $;
Run;

How many numeric variables are created:

A. 0

B. 1

C. 2

D. 3


You are right.  Either the answer key is wrong or there is something different about the actual question or the actual code from what you posted.

View solution in original post

13 REPLIES 13
Tom
Super User Tom
Super User

@TheresaM wrote:

I'm taking a practice exam for Base Programming Performance-Based Certification Exam for SAS 9.4 and am stuck on what I know is a simple question.

For the following question, I thought the obvious answer was 1 numeric variable (answer B). But the answer key says 0 (answer A). Why is that? Thanks in advance!

 

The following SAS program is submitted:

 

data employees;
   infile 'file-specification';
   input @1 name $10.
         @15 date date9.
         @25 department $;
Run;

How many numeric variables are created:

A. 0

B. 1

C. 2

D. 3


You are right.  Either the answer key is wrong or there is something different about the actual question or the actual code from what you posted.

Reeza
Super User
Date9 is numeric, so 1 is correct.
TheresaM
Obsidian | Level 7

Sorry everyone! I just conferred with a fellow student and he reminded me that the . after the character $10 length declaration is a syntax error, and so no variable gets created.  But thank you to those who offered help!

Reeza
Super User

It's best to test, which does not align with your classmates statement. 

 

Reeza_0-1690227872758.png

Then you can also run a PROC CONTENTS on the sample data to see the variable types. 

However, the exact wording of the question may also matter. 

 


@TheresaM wrote:

Sorry everyone! I just conferred with a fellow student and he reminded me that the . after the character $10 length declaration is a syntax error, and so no variable gets created.  But thank you to those who offered help!


 

TheresaM
Obsidian | Level 7

Thank you, Reeza. I ran a test as you recommended and found the same, of course.

I triple-checked that I typed the question exactly how it is in the exam, but below is a screenshot of the question and the answer key. I think that, based on our test code, and the two other people's responses, the practice exam seems to be incorrect. 

 

 Screen Shot 2023-07-24 at 2.32.48 PM.pngScreen Shot 2023-07-24 at 3.21.32 PM.png

Tom
Super User Tom
Super User

Where did you get the practice exam?  Did you pay money for it?  Can you get your money back?

TheresaM
Obsidian | Level 7

The practice exam was given as an "extra resource" from a course I took. I suppose the unspoken caveat is that the practice exams were given to us as-is. The course was a good one, but it's possible these practice exams are not as good as the vetted ones from certified sources.  I'm switching over to the official SAS practice exam now. 🙂

Mark2010
SAS Employee

@TheresaM 

 

I think you will need to carefully reconsider the course that you have taken, and this practice exam. I see where you said you are going to switch to the SAS official practice exam for the A00-231 exam, so that is good news. Not only is the question not provided with the accurate correct answer, but it is also covering a topic (reading raw data with infile/input) that has not been part of an exam since before 2019. So if the course focused on this as topic area, I would question the entire course as relevant to the current exam. Please refer to the SAS Certification Website for the Base Programming Specialist for the exam content guide as well as other important preparation resources. 

TheresaM
Obsidian | Level 7

Thanks @Mark2010 .  Points well-taken. I've switched over to official SAS guides to lessen future unnecessary confusion!  I've also been updating the course instructors with this type of information, and they have so far appreciated the feedback.  

TheresaM
Obsidian | Level 7

Also, yes, I've GREATLY appreciated provided in the preparation resources page you posted. I should have revisited the exam content guide before tearing my hair out over questions that address topics no longer covered in the exam. 😁

ballardw
Super User

@TheresaM wrote:

Sorry everyone! I just conferred with a fellow student and he reminded me that the . after the character $10 length declaration is a syntax error, and so no variable gets created.  But thank you to those who offered help!


Since there is no LENGTH statement shown I am not sure why this is brought up.

Plus it is not a syntax error as shown here:

16   data junk;
17      length x $10.;
18      x='abcdefghijk';
19   run;

NOTE: The data set WORK.JUNK has 1 observations and 1 variables.
NOTE: DATA statement used (Total process time):

The value of X will be truncated to 10 characters because of the length statement. In fact SAS won't even care if you include a decimal value (ignored)

41   data junk;
42      length x $10.5;
43      x='abcdefghijk';
44   run;

 

TheresaM
Obsidian | Level 7

Thank you -- every piece of information has been helpful. I did look for the answer online, but was confusing informat delimiters with length statements. I've emailed our course instructor to see what they say regarding the question/answer key from the practice exam they gave to us.  I'm understanding that SAS is forgiving, and may ignore things that are unnecessary and still execute the code.  Of course I am also interested in what the official answer would be that the Certification Exam would consider correct.  

Tom
Super User Tom
Super User

@TheresaM wrote:

Sorry everyone! I just conferred with a fellow student and he reminded me that the . after the character $10 length declaration is a syntax error, and so no variable gets created.  But thank you to those who offered help!


That has nothing to do with your original question.

 

SAS is in general very forgiving of some mistakes.  The length of a variable is always an integer (since it is a count of the number of bytes to use) so there is no need to include a decimal point in a LENGTH statement.  But that will not cause any error or even any note or warning.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

5 Steps to Your First Analytics Project Using SAS

For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 13 replies
  • 1691 views
  • 6 likes
  • 5 in conversation