BookmarkSubscribeRSS Feed
tianerhu
Pyrite | Level 9

tianerhu_0-1616090336946.pngtianerhu_1-1616090388429.png

I think that the answer A is correct ? But the key is C. why ?   Thank you.

10 REPLIES 10
Reeza
Super User
Because there's no trailing @.
tianerhu
Pyrite | Level 9

Could you give me more detail explain? Thank you .

Reeza
Super User
You're aware the newer SAS certification exam doesn't bother testing most of these concepts anymore? I assume you're using one of the older test exam banks that really aren't worth the paper they're printed on...


tianerhu
Pyrite | Level 9

Thank you for your advise, I appreciate.

mkeintz
PROC Star

Every time there is an INPUT statement, SAS first advances to the next line of raw data after reading the designated variables.  So the input statement conditioned on "SUE" is already pointing at the next record - giving a value of 40 for age.

 

BUT ... if the first input  has a trailing "@", then the conditional INPUT would read from the same record.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
tianerhu
Pyrite | Level 9

Thank you for your help.

Tom
Super User Tom
Super User

Assuming the typo's in the SAS code were fixed and the misalignment of the columns of the data is just because of the use of a proportional font in the displaying the question then C  is the right answer.  If the typos remain then it will never generate any dataset so none of the answers are right.

 

The question is trying to access if you understand when SAS moves to the next line of an input file.

ballardw
Super User

As @Tom says, the code needs to be fixed. The INFILE is spelled incorrectly and no data set would be created as posted.

67   data example;
68      in file 'something.txt';
        --
        180
ERROR 180-322: Statement is not valid or it is used out of proper order.

69      input a $;
70   run;
tianerhu
Pyrite | Level 9

The typo can be ignored. We suppose it was infile.

 

Thank you for your help.

tianerhu
Pyrite | Level 9

Thank you for your help.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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
  • 10 replies
  • 1748 views
  • 0 likes
  • 5 in conversation