SAS
Base
Programming version 9 Certification
Exam
Study Guide
SAS
Exam
#
AOO-211
Study Guide www.ePlanetLabs.com
SAS
QUESTIONS
and
ANSWERS
1. A raw data file is listed below.
1---+
----1
0---+
----20---+
---
son Frank
01/31/S9
daughter
June 12-25-S7
brother
Samuel
01/17/51
The following program is submitted using this file as
input:
data
work.family;
infile 'file-specification';
<insert
INPUT
statement
here>run;Which
INPUT
statement
correctly reads
the
values
for
the
variable Birthdate
as
SAS
date
values? a.
input
relation $
firsCname
$ birthdate
date9.;
b.
input
relation $ first_name $ birthdate
mmddyyS.;
c.
input
relation $
firsCname
$ birthdate :
date9.;
d.
input
relation $ first_name $ birthdate :
mmddyyS.;
Correct answer: ddd
An
informat
is used
to
translate
the
calendar date
to
a
SAS
date value.
The date values are in
the
form
of
two-digit
values
for
month-day-year,
so
the
MMDDYVS.
informat
must
be used. When using
an
informat
with
list
input,
the
colon-format
modifier
is required to correctly associate
the
informat
with
the
variable name.You can learn
about·
informats
in
Reading Date and Time
Values·
the
colon-format
modifier in Reading Free-
Format Data.
2. A raw data file is listed
below.l---+----l0---+----20---+---
Jose,47,210
Sue,,10S
The following
SAS
program is submitted using
the
raw data file above as
input:
data employeestats;
<insert
INFILE
statement
here>
input
name $
age
weight;run;The
following
output
is desired:name age
weight
Jose 47 210
Sue lOS
Which
of
the
following INFILE statements completes
the
program and
accesses
the
data correctly?
a.
infile 'file-specification' pad;
b.
infile 'file-specification' dsd;
c.
infile 'file-specification'
dlm=',';
d. infile 'file-specification' missover;
Correct answer: bbb
The
PAD
option specifies
that
SAS
pad variable length records with
blanks. The MISSOVER option prevents
SAS
from reading past
the
end
of
the
line when reading free
formatted
data. The DLM= option specifies
the
comma
as
the
delimiter;
however, consecutive delimiters are treated
as
one by
default. The
DSD
option correctly reads
the
data with commas
as
delimiters
and
two
consecutive commas indicating a missing value like those in this raw
data file.
You
can learn
about·
the
PAD
option in Reading
Raw
Data in Fixed
Fields·
the
MISSOVER option in Creating Multiple Observations
from
a
www.ePlanetLabs.com
All
Rights
Reserved
512
评论0
最新资源