By admin | August 31, 2009

SAS Certified Base Programmer 123 Questions (9)

A raw data record is listed below:

----|----10---|----20---|----30
son,Travis,

The following output is desired:

relation firstname
son      Travis

Which one of the following SAS programs reads the data correctly?

A.

data family / dlm = ',';
    infile 'file-specification';
    input relation $ firstname $;
run;

B.

option dlm = ',';
data family;
    infile 'file-specification';
    input relation $ firstname $;
run;

C.

data family;
    infile 'file-specification' option dlm = ',';
    input relation $ firstname $;
run;

D.

data family;
    infile 'file-specification';
    input relation $ firstname $ / dlm = ',';
run;

2 comments | Add One

  1. admin - 08/31/2009 at 12:53 pm

    C

  2. Deepak - 07/26/2011 at 7:07 am

    I think, there is a typo in C as well i.e. there is no option keyword required in infile statement before dlm.

    option dlm = ‘,’;

    can be replaced by

    dlm = ‘,’;

Leave a Comment

Leave a Reply

Your email address will not be published.