data ; set ;
by Department Gender;
if First.<_insert_code_> then Payroll=0; Payroll+Wagerate;
if Last.<_insert_code_>; run;
The SAS data set is currently ordered by Gender within Department.
Which inserted code will accumulate subtotals for each Gender within Department A. Gender
B. Department
C. Gender Department D. Department Gender
Answer: A
-------------------------------------
the following raw data records in :
----|----10---|----20---|----30 John,FEB,13,25,14,27,Final
John,MAR,26,17,29,11,23,Current Tina,FEB,15,18,12,13,Final
Tina,MAR,29,14,19,27,20,Current
The following output is desired:
Obs Name Month Status Week1 Week2 Week3 Week4 Week5
1 John FEB Final $13 $25 $14 $27 . 2 John MAR Current $26 $17 $29 $11 $23 3 Tina FEB Final $15 $18 $12 $13 . 4 Tina MAR Current $29 $14 $19 $27 $20
Which SAS program correctly produces the desired output
A. data ;
length Name $ 4 Month $ 3 Status $ 7; infile '' dsd;
input Name $ Month $;
if Month='FEB' then input Week1 Week2 Week3 Week4 Status $;
else if Month='MAR' then input Week1 Week2 Week3 Week4 Week5 Status $; format Week1-Week5 dollar6.; run;
proc print data=; run;
B. data ;
length Name $ 4 Month $ 3 Status $ 7; infile '' dlm=',' missover; input Name $ Month $;
if Month='FEB' then input Week1 Week2 Week3 Week4 Status $;
else if Month='MAR' then input Week1 Week2 Week3 Week4 Week5 Status $; format Week1-Week5 dollar6.; run;
proc print data=; run;
C. data ;
length Name $ 4 Month $ 3 Status $ 7; infile '' dlm=',';
input Name $ Month $ @;
if Month='FEB' then input Week1 Week2 Week3 Week4 Status $;
else if Month='MAR' then input Week1 Week2 Week3 Week4 Week5 Status $; format Week1-Week5 dollar6.; run;
proc print data=; run;
D. data ;
length Name $ 4 Month $ 3 Status $ 7; infile '' dsd @;
input Name $ Month $;
if Month='FEB' then input Week1 Week2 Week3 Week4 Status $;
else if Month='MAR' then input Week1 Week2 Week3 Week4 Week5 Status $; format Week1-Week5 dollar6.; run;
proc print data=; run;
Answer: C
-------------------------------------
Excel workbook contains the following four worksheets: EAST WEST NORTH SOUTH
The following program is submitted:
libname MYXLS '';
Which PROC PRINT step correctly displays the NORTH worksheet A. proc print data=;run; B. proc print data=$;run;
C. proc print data=MYXLS.'NORTH'e;run; D. proc print data=MYXLS.'NORTH$'n;run;
Answer: D
-------------------------------------
following SAS program is submitted:
data ;
Day=\"01\" ; Yr=1960 ;
X=mdy(Day,01,Yr) ; run;
What is the value of the variable X A. the numeric value 0
B. the character value \"01011960\" C. a missing value due to syntax errors
D. the step will not compile because of the character argument in the mdy function.
Answer: A
-------------------------------------
statement specifies that records 1 through 10 are to be read from the raw data file
A. infile '' 1-10; B. input '' stop@10; C. infile '' obs=10; D. input '' stop=10;
Answer: C
-------------------------------------
a SAS program is submitted, the following is written to the SAS log:
101 data ;
102 set (keep=product month num_Sold Cost); 103 if Month='Jan' then output ; 104 Sales=Cost * Num_Sold; 105 keep=Product Sales; ----- 22
ERROR 22-322: Syntax error, expecting one of the following: !,!!, &, *, **, +, -, , <=, <>, =, >, >=,
AND, EQ, GE, GT, IN, LE, LT, MAX, MIN, NE, NG, NL,NOTIN, OR, ^=, |, ||, ~=. 106 run;
What changes should be made to the KEEP statement to correct the errors in the LOG
A. keep=(Product Sales); B. keep Product, Sales; C. keep=Product, Sales; D. keep Product Sales;
Answer: D
-------------------------------------
of the following choices is an unacceptable ODS destination for producing output that can be viewed in Microsoft Excel
A. MSOFFICE2K B. EXCELXP C. CSVALL D. WINXP
Answer: D
-------------------------------------
SAS data set named contains 10 observations for each department,and is currently ordered by Department. The following SAS program is submitted:
data ;
set (keep=Department MonthlyWageRate); by Department;
if =1 then Payroll=0;
Payroll+(MonthlyWageRate*12); if =1; run;
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 data set.
D. The values of the variable Payroll represent a monthly total for all values of WAGERATE in the data set.
Answer: C
-------------------------------------
following SAS program is submitted:
data ;
Cost='$20,000';
Discount=.10*Cost; run;
What is the result
A. The value of the variable Discount in the output data set is messages are written to the SAS log.
B. The value of the variable Discount in the output data set is note that conversion has taken place is written to the SAS log.
C. The value of the variable Discount in the output data set is missing. A note in the SAS log refers to invalid numeric data.
D. The variable Discount in the output data set is set to messages are written to the SAS log.
Answer: C 因为有一个$符号 -------------------------------------
the existing SAS program:
proc format;
value agegrp
low-12 ='Pre-Teen' 13-high = 'Teen';
run;
proc means data=; var Height; class Sex Age;
format Age agegrp.; run;
Which statement in the proc means step needs to be modified or added to generate the following results:
Analysis Variable : Height
N
Sex Age Obs Minimum Maximum Mean
------------------------------------------------------------------
F Pre-Teen 3
Teen 6
M Pre-Teen 4
Teen 6 --------------------------------------------------------------------
A. var Height / nobs min max mean maxdec=1; B. proc means data= maxdec=1 ;
C. proc means data= min max mean maxdec=1; D. output nobs min max mean maxdec=1;
Answer: C
-------------------------------------
Excel workbook contains the following three worksheets: JAN FEB MAR
Which statement correctly assigns a library reference to the Excel workbook A. libname qtrdata ''; B. libname '' sheets=3; C. libname jan feb mar '';
D. libname mydata '' =(jan,feb,mar);
Answer: A
-------------------------------------
following SAS program is submitted:
data ;
set (keep=Janpt Febpt Marpt); array Diff{3} Difcount1-Difcount3; array Patients{3} Janpt Febpt Marpt; run;
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
-------------------------------------
of the following programs correctly invokes the DATA Step Debugger: A. data debug; set ;
State=scan(cityState,2,' ');
if State='NE' then description='Central'; run;
B.
data debugger; set ;
State=scan(cityState,2,' ');
if State='NE' then description='Central'; run;
C.
data / debug; set ;
State=scan(cityState,2,' ');
if State='NE' then description='Central'; run;
D.
data / debugger; set ;
State=scan(cityState,2,' ');
if State='NE' then description='Central'; run;
Answer: c
-------------------------------------
statement is true concerning the SAS automatic variable _ERROR_
A. It cannot be used in an if/then condition.
B. It cannot be used in an assignment statement.
C. It can be put into a keep statement or keep= option. D. It is automatically dropped.
Answer: D
-------------------------------------
following SAS program is submitted:
data ;
X='04jul2005'd; DayOfMonth=day(x); MonthOfYear=month(x); Year=year(x); run;
What types of variables are DayOfMonth, MonthOfYear, and Year
A. DayOfMonth, Year, and MonthOfYear are character. B. DayOfMonth, Year, and MonthOfYear are numeric.
C. DayOfMonth and Year are numeric. MonthOfYear is character. D. DayOfMonth, Year, and MonthOfYear are date values.
Answer: B
-------------------------------------
the following data step:
data ;
infile datalines; input City $20.; if City='Tulsa' then
State='OK';
Region='Central';
if City='Los Angeles' then State='CA';
Region='Western'; datalines; Tulsa
Los Angeles Bangor ; run;
After data step execution, what will data set
A.
City State Region ----------- ----- -------
Tulsa OK Western Los Angeles CA Western Bangor Western
B.
City State Region ----------- ----- -------
Tulsa OK Western Los Angeles CA Western Bangor
C.
City State Region ----------- ----- -------
Tulsa OK Central Los Angeles CA Western Bangor Western
D.
City State Region ----------- ----- -------
Tulsa OK Central Los CA Western Bangor
Answer: A
contain -------------------------------------
statement describes a characteristic of the SAS automatic variable _ERROR_
A. The _ERROR_ variable maintains a count of the number of data errors in a DATA step.
B. The _ERROR_ variable is added to the program data vector and becomes part of the data set being created.
C. The _ERROR_ variable can be used in expressions in the DATA step.
D. The _ERROR_ variable contains the number of the observation that caused the data error.
Answer: C
-------------------------------------
SAS data set contains a numeric variable named Num and a character variable named Char:
Num Char --- ---- 1 23 3 23 1 77
The following SAS program is submitted:
proc print data=; where Num='1'; run;
What is output
A. Num Char --- ---- 1 23
B.
Num Char --- ---- 1 23
1 77
C.
Num Char --- ---- 1 23 3 23 1 77
D. No output is generated.
Answer: D
-------------------------------------
20. The data set has the variable LocalFee with a format of 9. and a variable CountryFee with a format of 7.;
The following SAS program is submitted:
data ;
format LocalFee CountryFee ; set ;
LocalFee=LocalFee/100;
CountryFee=CountryFee/100; run;
What are the formats of the variables LOCALFEE and COUNTRYFEE in the output dataset
A. LocalFee has format of 9. and CountryFee has a format of 7. B. LocalFee has format of 9. and CountryFee has a format of C. Both LocalFee and CountryFee have a format of
D. The data step fails execution; there is no format for LocalFee.
Answer: C
-------------------------------------
the SAS data set :
ProdId Price ProductType Sales Returns ------ ----- ----------- ----- -------
K12S OUTDOOR 15 2 B132S CLOTHING 300 10 R18KY2 EQUIPMENT 25 5
3KL8BY OUTDOOR 125 15 DY65DW OUTDOOR 45 5 DGTY23 EQUIPMENT 67 2
The following SAS program is submitted:
data ; set ;
if Sales GT 30;
if ProductType EQ 'OUTDOOR' then output ; else if ProductType EQ 'CLOTHING' then output ; else if ProductType EQ 'EQUIPMENT' then output ; run;
How many observations does the data set contain A. 1 B. 2 C. 3 D. 6
Answer: B
-------------------------------------
step displays a listing of all the data sets in the WORK library A. proc contents lib=WORK run; B. proc contents lib=;run; C. proc contents data=; run;
D. proc contents data=WORK _ALL_; run;
Answer: c
-------------------------------------
is a valid LIBNAME statement
A. libname \"_SAS_data_library_location_\";
B. sasdata libname \"_SAS_data_library_location_\"; C. libname sasdata \"_SAS_data_library_location_\"; D. libname sasdata sas \"_SAS_data_library_location_\";
Answer: C
-------------------------------------
the following raw data records:
----|----10---|----20---|----30
Susan*12/29/1970*10 Michael**6
The following output is desired:
Obs employee bdate years 1 Susan 4015 10 2 Michael . 6
Which SAS program correctly reads in the raw data A.
data employees;
infile 'file specification' dlm='*';
input employee $ bdate : mmddyy10. years; run;
B.
data employees;
infile 'file specification' dsd='*';
input employee $ bdate mmddyy10. years; run;
C.
data employees;
infile 'file specification' dlm dsd;
input employee $ bdate mmddyy10. years; run;
D.
data employees;
infile 'file specification' dlm='*' dsd;
input employee $ bdate : mmddyy10. years; run;
Answer: D
-------------------------------------
the following code:
proc print data=(firstobs=5 obs=15); where Sex='M'; run;
How many observations will be displayed
A. 11 B. 15
C. 10 or fewer D. 11 or fewer
Answer: D
-------------------------------------
step sorts the observations of a permanent SAS data set by two variables and stores the sorted observations in a temporary SAS data set
A.
proc sort out=EMPLOYEES data=EMPSORT; by Lname and Fname; run;
B.
proc sort data= out=EMPSORT; by Lname Fname; run;
C.
proc sort out= data=; by Lname Fname; run;
D.
proc sort data= out=; by Lname and Fname; run;
Answer: B
-------------------------------------
the SAS data set :
Day Month Temp --- ----- ---- 1 May 75 15 May 70 15 June 80 3 June 76
2 July 85 14 July 89
The following program is submitted:
proc sort data=;
by descending Month Day; run;
proc print data=; run;
Which output is correct
A.
Obs Day Month --- --- ----- ---- 1 2 July 2 14 July 3 3 June 4 15 June 5 1 May 6 15 May
B.
Obs Day Month --- --- ----- ---- 1 1 May 2 2 July 3 3 June 4 14 July 5 15 May 6 15 June
C.
Obs Day Month --- --- ----- ---- 1 1 May 2 15 May 3 3 June 4 15 June 5 2 July 6 14 July Temp 85 89 76 80 75 7 Temp 75 85 76 89 70 80 Temp 75 70 76 80 85 89
D.
Obs Day Month Temp --- --- ----- ----
1 15 May 70 2 1 May 75 3 15 June 80 4 3 June 76 5 14 July 89 6 2 July 85
Answer: C
-------------------------------------
the SAS data set :
Location Pop2000 -------- -------
Alaska 626931 Delaware 783595 Vermont 608826 Wyoming 493782
and the SAS data set :
State Pop2008 -------- -------
Alaska 686293 Delaware 873092 Wyoming 532668
The following output is desired:
Obs State Pop2000 Pop2008 1 Alaska 626931 686293 2 Delaware 783595 873092 3 Wyoming 493782 532668
Which SAS program correctly combines the data
A. data compare;
merge (in=_a Location=State)
Difference 59362 89497 38886 (in=_b); by State; if _a and _b;
Difference=Pop2008-Pop2000; run;
B.
data compare;
merge (rename=(Location=State)) ; by State; if _a and _b;
Difference=Pop2008-Pop2000; run;
C.
data compare;
merge (in=_a rename=(Location=State)) (in=_b); by State; if _a and _b;
Difference=Pop2008-Pop2000; run;
D.
data compare;
merge (in=_a) (rename=(Location=State)) (in=_b); by State; if _a and _b;
Difference=Pop2008-Pop2000; run;
Answer: C
-------------------------------------
following SAS program is sumbitted:
data ;
infile '';
input @1 Company $20. @25 State $2. @; if State=' ' then input @30 Year; else input @30 City Year;
input NumEmployees; run;
How many raw data records are read during each iteration of the DATA step
A. 1 B. 2 C. 3 D. 4
Answer: A
-------------------------------------
're attempting to read a raw data file and you see the following messages displayed in the SAS Log:
NOTE: Invalid data for Salary in line 4 15-23.
RULE: ----+----1----+----2----+----3----+----4----+----5-- 4 120104 F 46#30 11MAY1954 33
Employee_Id=120104 employee_gender=F Salary=. birth_date=-2061 _ERROR_=1 _N_=4
NOTE: 20 records were read from the infile 'c:\\'. The minimum record length was 33. The maximum record length was 33.
NOTE: The data set has 20 observations and 4 variables.
What does it mean
A. A compiler error, triggered by an invalid character for the variable Salary. B. An execution error, triggered by an invalid character for the variable Salary. C. The 1st of potentially many errors, this one occurring on the 4th observation.
D. An error on the INPUT statement specification for reading the variable Salary.
Answer: B
------------------------------------------------------------------
31. Given the following raw data records in :
----|----10---|----20---|----30 Kim,Basketball,Golf,Tennis Bill,Football
Tracy,Soccer,Track
The following program is submitted:
data ;
length Fname Sport1-Sport3 $ 10; infile '' dlm=',';
input Fname $ Sport1 $ Sport2 $ Sport3 $; run;
proc print data=; run;
Which output is correct based on the submitted program
A.
Obs Fname Sport1 Sport2 Sport3
1 Kim Basketball Golf Tennis 2 Bill Football
3 Tracy Soccer Track
B.
Obs Fname Sport1 Sport2 Sport3
1 Kim Basketball Golf Tennis 2 Bill Football Football Football 3 Tracy Soccer Track Track
C.
Obs Fname Sport1 Sport2 Sport3
1 Kim Basketball Golf Tennis 2 Bill Football Tracy Soccer
D.
Obs Fname Sport1 Sport2 Sport3
1 Kim Basketball Golf Tennis 2 Bill Football
Answer: C
------------------------------------------------------------------ the following data step:
data ; set ; Count+1; run;
The variable Count is created using a sum statement. Which statement regarding this variable is true
A. It is assigned a value 0 when the data step begins execution.
B. It is assigned a value of missing when the data step begins execution. C. It is assigned a value 0 at compile time.
D. It is assigned a value of missing at compile time.
Answer: C
------------------------------------------------------------------
following SAS program is submitted:
data ; set ;
if Jobcode='Pilot2' then Description='Senior Pilot'; else Description='Unknown'; run;
The value for the variable Jobcode is: is the value of the variable Description A. PILOT2 B. Unknown C. Senior Pilot
D. ' ' (missing character value)
Answer: B
------------------------------------------------------------------
user-defined format has been created using the FORMAT is it stored A. in a SAS catalog
B. in a memory resident lookup table C. in a SAS dataset in the WORK library
D. in a SAS dataset in a permanent SAS data library
Answer: A
These formats must be stored in the or catalog ------------------------------------------------------------------ the SAS data set :
X Y -- --
5 2 3 1 5 6
The following SAS program is submitted: data OTHER; set ;
if X eq 5 then output ; if Y lt 5 then output ; output; run;
What is the result
A.
data set has 5 observations data set has 5 observations data set has 3 observations
B.
data set has 2 observations data set has 2 observations data set has 1 observations
C.
data set has 2 observations data set has 2 observations data set has 5 observations
D. No data sets are output. The DATA step fails execution due to syntax errors.
Answer: A
------------------------------------------------------------------ the contents of the raw data file '':
----+----10---+----20---+----30-- Xing 2 19 2004 ACCT Bob 5 22 2004 MKTG Jorge 3 14 2004 EDUC
The following SAS program is submitted:
data ;
infile '';
input
@1 FirstName $ @15 StartDate @25 Department $; run;
Which SAS informat correctly completes the program A. date9.
B. mmddyy10. C. ddmmyy10. D. mondayyr10.
Answer: B
-------------------------------------------------------------
SAS data set contains a variable Open_Date which has
been assigned a permanent label of \"Open Date\". Which SAS program temporarily replaces the label \"Open Date\" with the label \"Starting Date\" in the output
A.
proc print data= label;
label Open_Date \"Starting Date\"; run;
B.
proc print data= label;
label Open_Date=\"Starting Date\"; run;
C.
proc print data=;
label Open_Date=\"Starting Date\"; run;
D.
proc print data=;
Open_Date=\"Starting Date\"; run;
Answer: B
------------------------------------------------------------------
the SAS data set :
X Y Z - - -- 1 A 27 1 A 33 1 B 45 2 A 52 2 B 69 3 B 70 4 A 82 4 C 91
The following SAS program is submitted:
data ; set ; by X Y; if ; run;
proc print data= noobs; run;
Which report is produced
A.
X Y Z -- -- -- 1 B 45 2 A 52 2 B 69 3 B 70 4 A 82 4 C 91
B.
X Y Z -- -- -- 1 A 27 1 B 45 2 A 52 2 B 69 3 B 70 4 A 82 4 C 91
C.
X Y Z -- -- -- 1 A 33 1 B 45 2 A 52 2 B 69 3 B 70 4 A 82 4 C 91
D. The PRINT procedure fails because the data set is not created in the DATA step.
Answer: B
------------------------------------------------------------------
following SAS program is submitted:
data ;
array Favorites{3} $ 8 ('Shakespeare','Hemingway','McCaffrey'); run;
What is the value of the second variable in the dataset A. Hemingway B. Hemingwa
C. ' ' (a missing value)
D. The program contains errors. No variables are created.
Answer: B
------------------------------------------------------------------
following SAS program is submitted:
data ; Prod=1;
do while(Prod LE 6); Prod + 1; end; run;
What is the value of the variable Prod in the output data set
A. 6 B. 7 C. 8
D. . (missing numeric)
Answer: B
------------------------------------------------------------------
the raw data record in the file :
----|----10---|----20---|----30---|
Stevens James SALES 304-923-3721 14
The following SAS program is submitted:
data ;
infile '';
input EmpLName $ EmpFName $ Dept $ Phone $ Extension; <_insert_code_> run;
Which SAS statement completes the program and results in a value of \"James Stevens\" for the variable FullName
A. FullName=CATX(' ',EmpFName,EmpLName); B. FullName=CAT(' ',EmpFName,EmpLName); C. FullName=EmpFName!!EmpLName; D. FullName=EmpFName + EmpLName;
Answer: A
------------------------------------------------------------------
following SAS program is submitted:
data ;
Text='Australia, US, Denmark'; Pos=find(Text,'US','i',5); run;
What value will SAS assign to Pos
A. 0 B. 1 C. 2
D. 12
Answer: D
------------------------------------------------------------------ the SAS data set :
order_id customer shipped -------- ------------ ---------
9341 Josh Martin 02FEB2009 9874 Rachel Lords 14MAR2009 10233 Takashi Sato 07JUL2009
The variable order_id is numeric; customer is character; and shipped is numeric, contains a SAS date value, and is shown with the DATE9. format.
A programmer would like to create a new variable, ship_note, that shows a character value with the order_id,shipped date, and customer name.
For example, given the first observation ship_note would have the value \"Order 9341 shipped on 02FEB2009 to Josh Martin\".
Which of the following statement will correctly create the value and assign it to ship_note
A. ship_note=catx(' ','Order',order_id,'shipped on',input(shipped,date9.),'to',customer);
B. ship_note=catx(' ','Order',order_id,'shipped on',char(shipped,date9.),'to',customer);
C. ship_note=catx(' ','Order',order_id,'shipped on',transwrd(shipped,date9.),'to',customer);
D. ship_note=catx(' ','Order',order_id,'shipped on',put(shipped,date9.),'to',customer);
Answer: D
------------------------------------------------------------------
following SAS program is submitted:
data ONE TWO set ; run;
Assuming that 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
------------------------------------------------------------------
following SAS program is submitted:
ods csvall file='c:\\'; proc print data=;
var Name Score Grade; by IdNumber; run;
ods csvall close;
What is produced as output
A. A file named that can only be opened in Excel.
B. A text file named that can be opened in Excel or in any text editor. C. A text file named that can only be opened in a text editor. D. A file named that can only be opened by SAS.
Answer: C
------------------------------------------------------------------
the SAS data set :
Obs Revenue2008 Revenue2009 Revenue2010 --- ----------- ----------- -----------
1
The following SAS program is submitted:
data ; set ;
Total=mean(of Rev:); run;
What value will SAS assign to Total
A. 3 B. C.
D. The program fails to execute due to errors.
Answer: B
------------------------------------------------------------------
following output is created by the FREQUENCY procedure:
The FREQ Procedure
Table of region by product
region product
Frequency| Percent | Row Pct |
Col Pct |corn |cotton |oranges | Total ---------+--------+--------+--------+
EAST | 2 | 1 | 1 | 4 | | | | | | | | | | | | ---------+--------+--------+--------+
SOUTH | 2 | 2 | 1 | 5 | | | | | | | | | | | | ---------+--------+--------+--------+
Total 4 3 2 9
Which TABLES option(s) would be used to eliminate the row and column counts and just see the frequencies and percents
A. norowcount nocolcount B. freq percent C. norow nocol D. nocounts
Answer: C
------------------------------------------------------------------
following SAS program is submitted:
data ;
drop City;
infile datalines; input
Name $ 1-14 / Address $ 1-14 / City $ 1-12 ;
if City='New York ' then input @1 State $2.; else input; datalines; Joe Conley 123 Main St. Janesville WI
Jane Ngyuen 555 Alpha Ave. New York NY
Jennifer Jason 666 Mt. Diablo Eureka CA ;
What will the data set contain
A.
Name Address State -------------- ---------------- ------ Joe Conley 123 Main St.
Jane Ngyuen 555 Alpha Ave. NY Jennifer Jason 666 Mt. Diablo
B.
Name Address City -------------- ---------------- ----------- ------
Joe Conley 123 Main St. Janesville
Jane Ngyuen 555 Alpha Ave. New York Jennifer Jason 666 Mt. Diablo Eureka
StateNY
C.
Name Address State -------------- ---------------- ------
Jane Ngyuen 555 Alpha Ave. NY
D. O observations,there is a syntax error in the data step.
Answer: A
------------------------------------------------------------------
following SAS program is submitted:
data (keep=MonthSales{12});
set (keep=Year Product Sales); array MonthSales{12}; do i=1 to 12;
MonthSales{i}=Sales; end; drop i; run;
The program fails execution due to syntax errors. What is the cause of the syntax error
A. An array cannot be referenced on a keep= data set option. B. The keep= data set option should be (keep=MonthSales*).
C. The keep= data set option should be the statement KEEP MonthSales{12}. D. The variable MonthSales does not exist.
Answer: A
------------------------------------------------------------------
the SAS data set :
Id Char1 --- ----- 111 A 158 B 329 C 644 D
and the SAS data set :
Id Char2
--- ----- 111 E 538 F 644 G
The following program is submitted:
data ; set ; by Id; run;
What is the first observation in SAS data set
A. Id Char1 Char2 --- ----- ----- 111 A
B.
Id Char1 Char2 --- ----- ----- 111 E
C.
Id Char1 Char2 --- ----- ----- 111 A E
D.
Id Char1 Char2 --- ----- ----- 644 D G
Answer: A
------------------------------------------------------------------ following program is submitted:
proc contents data=_all_; run;
Which statement best describes the output from the submitted program
A. The output contains only a list of the SAS data sets that are contained in the WORK library.
B. The output displays only the contents of the SAS data sets that are contained in the WORK library.
C. The output displays only the variables in the SAS data sets that are contained in the WORK library.
D. The output contains a list of the SAS data sets that are contained in the WORK library and displays the contents of those data sets.
Answer: D
------------------------------------------------------------------
the SAS data set :
Name EmpID ---- ----- Jill 1864 Jack 2121 Joan 4698 John 5463
Given the SAS data set :
EmpID Department ----- ----------
2121 Accounting 3567 Finance 4698 Marketing 5463 Accounting
The following program is submitted:
data ;
merge (in=Emp_N) (in=Emp_D); by Empid;
if (Emp_N and not Emp_D) or (Emp_D and not Emp_N); run;
How many observations are in data set after submitting the program
A. 1 B. 2 C. 3 D. 5
Answer: B
------------------------------------------------------------------
following SAS program is submitted:
data ;
retain Total; set ;
by Department; if
then Total=0;
Total=sum(Total, Wagerate); if ; run;
What is the initial value of the variable Total
A. 0
B. Missing
C. The value of the first observations Wagerate
D. Cannot be determined from the information given
Answer: B
------------------------------------------------------------------
the following data step:
data ;
set (obs=5);
retain City 'Beverly Hills'; State='California'; run;
The computed variables City and State have their values assigned using two different methods, a RETAIN statement and an Assignment statement. Which statement regarding this program is true
A. The RETAIN statement is fine, but the value of City will be truncated to 8 bytes as the LENGTH statement has been omitted.
B. Both the RETAIN and assignment statement are being used to initialize new variables and are equally efficient. Method used is a matter of programmer preference.
C. The assignment statement is fine, but the value of City will be truncated
to 8 bytes as the LENGTH statement has been omitted.
D. City's value will be assigned one time, State's value 5 times.
Answer: D
------------------------------------------------------------------
following SAS program is submitted:
data ;
X=\"01Jan1960\" D ; run;
Variable X contains what value
A. the numeric value 0
B. the character value \"01Jan1960\" C. the date value 01011960
D. the code contains a syntax error and does not execute.
Answer: D 注意D前面有空格
------------------------------------------------------------------
following output is created by the FREQUENCY procedure:
The FREQ Procedure
Table of region by product
region product
Frequency| Percent | Row Pct |
Col Pct |corn |cotton |oranges | Total ---------+--------+--------+--------+
EAST | 2 | 1 | 1 | 4 | | | | | | | | | | | | ---------+--------+--------+--------+
SOUTH | 2 | 2 | 1 | 5 | | | | | | | | | | | |
---------+--------+--------+--------+
Total 4 3 2 9
Which TABLES statement was used to completed the following program that produced the output
proc freq data=sales; <_insert_code_> run;
A. tables region product; B. tables region,product C. tables region/product; D. tables region*product;
Answer: D
------------------------------------------------------------------
the SAS data set :
N BeginDate - ---------
1 09JAN2010 2 12JAN2010
The following SAS program is submitted:
data ; set ;
Day=<_insert_code_>; format BeginDate date9.; run;
The data set is created, where Day would be 1 for Sunday, 2 for Monday, 3 for Tuesday, ... :
N BeginDate Day - --------- ---
1 09JAN2010 1 2 12JAN2010 4
Which expression successfully completed the program and creates the variable Day
A. day(BeginDate)
B. weekday(BeginDate) C. dayofweek(BeginDate) D. getday(BeginDate,today())
Answer: B
------------------------------------------------------------------
following program is submitted:
proc format; value salfmt.
0 -< 50000 = 'Less than 50K' 50000 - high = '50K or Greater';
options fmterr nodate pageno=1; title 'Employee Report'; proc print data= noobs;
var fullname salary hiredate; format
salary salfmt. hiredate date9.; label
fullname='Name of Employee' salary='Annual Salary' hiredate='Date of Hire'; run;
Why does the program fail
A. The PAGENO option is invalid in the OPTIONS statement. B. The RUN statement is missing after the FORMAT procedure. C. The format name contains a period in the VALUE statement. D. The LABEL option is missing from the PROC PRINT statement.
Answer: C
------------------------------------------------------------------
the contents of the raw data file :
----+----10---+----20---+----30 daisyyellow
The following SAS program is submitted:
data FLOWERS;
infile '' truncover; length
Type $ 5 Color $ 11; input
Type $ Color $; run;
What are the values of the variables Type and Color
A. Type=daisy, Color=yellow B. Type=daisy, Color=w
C. Type=daisy, Color=daisyyellow D. Type=daisy, Color=
Answer: D
------------------------------------------------------------------
the SAS data set :
ProdId Price ProductType Sales Returns ------ ----- ----------- ----- -------
K12S OUTDOOR 15 2 B132S CLOTHING 300 10 R18KY2 EQUIPMENT 25 5 3KL8BY OUTDOOR 125 15 DY65DW OUTDOOR 45 5 DGTY23 EQUIPMENT 67 2
The following SAS program is submitted:
data (drop=Sales Returns Price);
set (keep=ProdId Price Sales Returns); Revenue=Price*(Sales-Returns); run;
How many variables does the data set contain
A. 2
B. 3 C. 4 D. 6
Answer: A
------------------------------------------------------------------
the data step:
data ;
infile 'c:\\' dsd;
input Name $ Sex $ Age Height Weight; if Age NE 16 and Age NE 15 then Group=1; else Group=2; run;
Which statement produces a functionally equivalent result for assigning Group a value
A. if Age not in(15,16) then Group=1; else Group=2;
B. if (Age NE 16) or (Age NE 15) then Group=1; else Group=2; C. where Age not between 15 and 16 then Group=1; else Group=2; D. both A or C will work.
Answer: A
------------------------------------------------------------------
following SAS program is submitted:
<_insert_ods_code_> proc means data=;
where Product in ('Sandal' , 'Slipper' , 'Boot'); run;
<_insert_ods_code_>
Which ODS statements, inserted in the two locations above, create a report stored in an html file
A.
ods html open=''; ods html close;
B.
ods file='' / html;
ods file close;
C.
ods html file=''; ods html close;
D.
ods file html=''; ods file close;
Answer: C
------------------------------------------------------------------
following SAS program is submitted:
data ;
do until(Prod GT 6); Prod + 1; end; run;
What is the value of the variable Prod in the output data set
A. . (missing) B. 6 C. 7
D. Undetermined, infinite loop.
Answer: C
------------------------------------------------------------------
following SAS program is submitted:
data ; set ;
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
------------------------------------------------------------------
following SAS program is submitted:
data ;
do Year=1 to 5;
do Month=1 to 12; X + 1; end; end; run;
How many observations are written to the data set
A. 0 B. 1 C. 5 D. 60
Answer: B
------------------------------------------------------------------
the following data step:
data ;
set (keep=X);
if X < 10 then X=1;
else if X >= 10 AND X LT 20 then X=2; else X=3; run;
In filtering the values of the variable X in data set , what new value would be assigned to X if its original value was a missing value
A. X would get a value of 1. B. X would get a value of 3.
C. X would retain its original value of missing. D. This step does not run because of syntax errors.
Answer: A missing data 最小
------------------------------------------------------------------
following SAS program is submitted:
data ; set ;
length EmpId $6; CharEmpid=EmpId; run;
If data set has a numeric variable EmpId,which statement is true about the output dataset
A. The type of the variable CharEmpid is numeric. B. The type of the variable CharEmpid is unknown. C. The type of the variable CharEmpid is character. D. The program fails to execute due to errors.
Answer: D
------------------------------------------------------------------
the data set :
Employee_ Manager_
ID Job_Title Department ID ------- ---------------------- ---------------- ------
120101 Director Sales Management 120261 120102 Sales Manager Sales Management 120101 120103 Sales Manager II Sales Management 120101 120104 Administration Manager Administration 120101 120105 Secretary I Administration 120101
Which one of the following where statements would display observations with job titles containing the word 'Manager'
A. where substr(Job_Title,(length(Job_Title)-6))='Manager'; B. where upcase(scan(Job_Title,-1,' '))='MANAGER'; C. where Job_Title='% Manager '; D. where Job_Title like '%Manager%';
Answer: D
------------------------------------------------------------------
a SAS program is submitted, the following is written to the SAS log:
105 data ;
106 set (keep=Product Month Quantity Cost); 107 if Month='JAN' then output ; 108 Sales=Cost * Quantity;
109 drop=Month Quantity Cost; ----- 22
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, -, , <=, <>, =, >, >=,
AND, EQ, GE, GT, IN, LE, LT, MAX, MIN, NE, NG, NL, NOTIN, OR, ^=, |, ||, ~=. 110 run;
What data set option could be attached to to replace the DROP statement that generated the error in the log
A. (drop Month Quantity Cost) B. (drop Month, Quantity, Cost) C. (drop=Month, Quantity, Cost) D. (drop=Month Quantity Cost)
Answer: D
------------------------------------------------------------------
因篇幅问题不能全部显示,请点此查看更多更全内容