SAS Base Programming for SAS (r) 9 v7.9 (A00-211)

Page:    1 / 15   
Total 218 questions

The following SAS program is submitted:
data test;
set sasuser.employees;
if 2 le years_service le 10 then
amount = 1000;
else amount = 0;
amount_per_year = years_service / amount
run;
What is the value of the variable AMOUNT_PER_YEAR if an employee has been with the company for one year?

  • A. 0
  • B. 0.001
  • C. 1
  • D. . (missing numeric value)


Answer : D

The following SAS program is submitted:
data work.accounting;
set work.dept1 work.dept2;
jobcode = FA1;
length jobcode $ 8;
run;
A character variable named JOBCODE is contained in both the WORK.DEPT1 and
WORK.DEPT2 SAS data sets. The variable JOBCODE has a length of 5 in the
WORK.DEPT1 data set and a length of 7 in the WORK.DEPT2 data set. What is the length of the variable JOBCODE in the output data set?

  • A. 3
  • B. 5
  • C. 7
  • D. 8


Answer : B

The SAS data set named WORK.SALARY contains 10 observations for each department, and is currently ordered by Department. The following SAS program is submitted:


Which statement is true?

  • A. The by statement in the DATA step causes a syntax error.
  • B. The statement Payroll+(MonthlyWageRate*12); in the data step causes a syntax error.
  • C. The values of the variable Payroll represent the monthly total for each department in the WORK.SALARY data set.
  • D. The values of the variable Payroll represent a monthly total for all values of WAGERATE in the WORK.SALARY data set.


Answer : C

The following SAS program is submitted:
data work.total;
set work.salary(keep = department wagerate);
by department;
if first.department
then payroll = 0;
payroll + wagerate;
if last.department
run;
The SAS data set WORK.SALARY, currently ordered by DEPARTMENT, contains 100 observations for each of 5 departments.
What is the result?

  • A. The WORK.TOTAL data set contains 5 observations.
  • B. The WORKTDTAL data set contains 100 observations.
  • C. The WORKTOTAL data set contains 500 observations.
  • D. The program fails to execute due to errors.


Answer : A

The following SAS program is submitted:
data WORK.ACCOUNTING;
set WORK.DEPARTMENT;
label Jobcode='Job Description';
run;
Which statement is true about the output dataset?

  • A. The label of the variable Jobcode is Job (only the first word).
  • B. The label of the variable Jobcode is Job Desc (only the first 8 characters).
  • C. The label of the variable Jobcode is Job Description.
  • D. The program fails to execute due to errors. Labels must be defined in a PROC step.


Answer : C

The contents of the raw data file PRODUCT are listed below:
--------10-------20-------30
24613 $25.31
The following SAS program is submitted:
data inventory;
infile 'product';
input idnum 5. @10 price;
run;
Which one of the following is the value of the PRICE variable?

  • A. 25.31
  • B. $25.31
  • C. . (missing numeric value)
  • D. No value is stored as the program fails to execute due to errors.


Answer : C

Given the SAS data set EMPLOYEES:

EMPLOYEES -

NAME SALARY -
-------- ------------

Innis60000 -

Jolli50000 -

Ellis55000 -

Liu45000 -
The following SAS program is submitted:
proc print data = employees; where name like _i%;
run;
What is contained in the output?

  • A. Liu only
  • B. Innis and Ellis only
  • C. Innis, Ellis, and Liu only
  • D. Innis, Jolli, Ellis, and Liu


Answer : A

Which statement specifies that records 1 through 10 are to be read from the raw data file customer.txt?

  • A. infile 'customer.txt' 1-10;
  • B. input 'customer.txt' [email protected];
  • C. infile 'customer.txt' obs=10;
  • D. input 'customer.txt' stop=10;


Answer : C

The following SAS program is submitted:


What new variables are created?

  • A. Difcount1, Difcount2 and Difcount3
  • B. Diff1, Diff2 and Diff3
  • C. Janpt, Febpt, and Marpt
  • D. Patients1, Patients2 and Patients3


Answer : A

Given the contents of the raw data file EMPLOYEE:
----|----10----|----20----|----30

Alan -
19/2/2004

ACCT -

Rob -
22/5/2004

MKTG -

MaryJane -
14/3/2004

EDUC -
The following SAS program is submitted:
data emps;
infile employee;
[email protected] name$
@15 date <insert INFORMAT here>
@25 department$;
run;
Which INFORMAT correctly completes the program?

  • A. date9.
  • B. ddmmyyyy9.
  • C. ddmmyy10.
  • D. ddmmyyyy10.


Answer : C

The Excel workbook REGIONS.XLS contains the following four worksheets:

EAST -

WEST -

NORTH -

SOUTH -
The following program is submitted:
libname MYXLS 'regions.xls';
Which PROC PRINT step correctly displays the NORTH worksheet?

  • A. proc print data=MYXLS.NORTH; run;
  • B. proc print data=MYXLS.NORTH$; run;
  • C. proc print data=MYXLS.'NORTH'e; run;
  • D. proc print data=MYXLS.'NORTH$'n; run;


Answer : D

Given the SAS data set PRICES:

PRICES -
prodid price

K12S5.10producttype -

NETWORKsales -
15returns

B132S 2.34HARDWARE30010 -

R18KY21.29SOFTWARE255 -
3KL8BY 6.37HARDWARE12515

DY65DW 5.60HARDWARE455 -

DGTY23 4.55HARDWARE672 -
The following SAS program is submitted:
data hware inter soft;
set prices (keep = producttype price);
if price le 5.00;
if producttype = HARDWARE then output HWARE;
else if producttype = NETWORK then output INTER;
else if producttype = SOFTWARE then output SOFT;
run;
How many observations does the HWARE data set contain?

  • A. 0
  • B. 2
  • C. 3
  • D. 4


Answer : B

The following SAS program is submitted:
Data_null_;
set old;
put sales 1 sales2;
run;
Where is the output written?

  • A. to the SAS log
  • B. to the SAS data set _NULL_
  • C. to the SAS output window or to an output file
  • D. to the raw data file that was most recently opened


Answer : A

The following SAS program is submitted:
data ONE TWO SASUSER.TWO
set SASUSER.ONE;
run;
Assuming that SASUSER.ONE exists, how many temporary and permanent SAS data sets are created?

  • A. 2 temporary and 1 permanent SAS data sets are created
  • B. 3 temporary and 2 permanent SAS data sets are created
  • C. 2 temporary and 2 permanent SAS data sets are created
  • D. there is an error and no new data sets are created


Answer : D

The following SAS program is submitted:
data one;
addressl = 214 London Way;
run;
data one;
set one;
address = tranwrd(address1, Way, Drive); run;
What are the length and value of the variable ADDRESS?

  • A. Length is 14; value is ‘214 London Dri’.
  • B. Length is 14; value is ‘214 London Way’.
  • C. Length is 16; value is ‘214 London Drive’.
  • D. Length is 200; value is ‘214 London Drive’.


Answer : D

Page:    1 / 15   
Total 218 questions