Quiz
CRACKMAN_70
Crie uma conta grátis para terminar este quiz
Salve seu progresso e veja sua nota final.
Já tem uma conta? Inicie sessão
Perguntas do quiz (70)
11.The following SAS program is submitted:
data WORK.TOTAL;
set WORK.SALARY;
by Department Gender;
if First.<_insert_code_> then Payroll=0;
Payroll+Wagerate;
if Last.<_insert_code_>;
run;
The SAS data set WORK.SALARY is currently ordered by Gender within Department.
Which inserted code will accumulate subtotals for each Gender within Department?- AA. Gender
- BB. Department
- CC. Gender Department
- DD. Department Gender
22.Given the following raw data records in TEXTFILE.TXT:
—-|—-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?- AA.
data WORK.NUMBERS;
length Name $ 4 Month $ 3 Status $ 7;
infile \’TEXTFILE.TXT\’ 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=WORK.NUMBERS;
run; - BB.
data WORK.NUMBERS;
length Name $ 4 Month $ 3 Status $ 7;
infile \’TEXTFILE.TXT\’ 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=WORK.NUMBERS;
run; - CC.
data WORK.NUMBERS;
length Name $ 4 Month $ 3 Status $ 7;
infile \’TEXTFILE.TXT\’ 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=WORK.NUMBERS;
run; - DD.
data WORK.NUMBERS;
length Name $ 4 Month $ 3 Status $ 7;
infile \’TEXTFILE.TXT\’ 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=WORK.NUMBERS;
run;
- AA.
33.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?- AA. proc print data=MYXLS.NORTH;run;
- BB. proc print data=MYXLS.NORTH$;run;
- CC. proc print data=MYXLS.\’NORTH\’e;run;
- DD. proc print data=MYXLS.\’NORTH$\’n;run;
44.The following SAS program is submitted:
data WORK.DATE_INFO;
Day=\”01\” ;
Yr=1960 ;
X=mdy(Day,01,Yr) ;
run;
What is the value of the variable X?- AA. the numeric value 0
- BB. the character value \”01011960\”
- CC. a missing value due to syntax errors
- DD. the step will not compile because of the character argument in the mdy function
55.Which statement specifies that records 1 through 10 are to be read from the raw data file customer.txt?
- AA. infile \’customer.txt\’ 1-10;
- BB. input \’customer.txt\’ stop@10;
- CC. infile \’customer.txt\’ obs=10;
- DD. input \’customer.txt\’ stop=10;
66.After a SAS program is submitted, the following is written to the SAS log:
101 data WORK.JANUARY;
102 set WORK.ALLYEAR(keep=product month num_Sold Cost);
103 if Month=\’Jan\’ then output WORK.JANUARY;
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?- AA. keep=(Product Sales);
- BB. keep Product, Sales;
- CC. keep=Product, Sales;
- DD. keep Product Sales;
77.Which of the following choices is an unacceptable ODS destination for producing output that can be viewed in Microsoft Excel?
- AA. MSOFFICE2K
- BB. EXCELXP
- CC. CSVALL
- DD. WINXP
88.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:
data WORK.TOTAL;
set WORK.SALARY(keep=Department MonthlyWageRate);
by Department;
if First.Department=1 then Payroll=0;
Payroll+(MonthlyWageRate*12);
if Last.Department=1;
run;
Which statement is true?- AA. The by statement in the DATA step causes a syntax error.
- BB. The statement Payroll+(MonthlyWageRate*12); in the data step causes a syntax error.
- CC. The values of the variable Payroll represent the monthly total for each department in the WORK.SALARY data set.
- DD. The values of the variable Payroll represent a monthly total for all values of WAGERATE in the WORK.SALARY data set.
99. data course;
input exam;
datalines;
50.1
;
run;
proc format;
value score 1 – 50 = \’Fail\’
51 – 100 = \’Pass\’;
run;
proc report data =course nowd;
column exam;
define exam / display format=score.;
run;
What is the value for exam?- AA. Fail
- BB. Pass
- CC. 50.1
- DD. No output
1010.The following SAS program is submitted:
data WORK.RETAIL;
Cost=\’$20.000\’;
Discount=.10*Cost;
run;
What is the result?- AA. The value of the variable Discount in the output data set is 2000.No messages are written to the SAS log.
- BB. The value of the variable Discount in the output data set is 2000.A note that conversion has taken place is written to the SAS log.
- CC. The value of the variable Discount in the output data set is missing.A note in the SAS log refers to invalid numeric data.
- DD. The variable Discount in the output data set is set to zero.No messages are written to the SAS log.
1111.Given the existing SAS program:
proc format;
value agegrp
low-12 =\’Pre-Teen\’
13-high = \’Teen\’;
run;
proc means data=SASHELP.CLASS;
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 51.3 59.8 55.8
Teen 6 56.5 66.5 63.0
M Pre-Teen 4 57.3 64.8 59.7
Teen 6 62.5 72.0 66.8
——————————————————————–- AA. var Height / nobs min max mean maxdec=1;
- BB. proc means data=SASHELP.CLASS maxdec=1 ;
- CC. proc means data=SASHELP.CLASS min max mean maxdec=1;
- DD. output nobs min max mean maxdec=1;
1212.The Excel workbook QTR1.XLS contains the following three worksheets:
JAN
FEB
MAR
Which statement correctly assigns a library reference to the Excel workbook?- AA. libname qtrdata \’qtr1.xls\’;
- BB. libname \’qtr1.xls\’ sheets=3;
- CC. libname jan feb mar \’qtr1.xls\’;
- DD. libname mydata \’qtr1.xls\’ WORK.heets=(jan,feb,mar);
1313.The following SAS program is submitted:
data WORK.TEST;
set WORK.MEASLES(keep=Janpt Febpt Marpt);
array Diff{3} Difcount1-Difcount3;
array Patients{3} Janpt Febpt Marpt;
run;
What new variables are created?- AA. Difcount1, Difcount2 and Difcount3
- BB. Diff1, Diff2 and Diff3
- CC. Janpt, Febpt, and Marpt
- DD. Patients1, Patients2 and Patients3
1414.Which of the following programs correctly invokes the DATA Step Debugger:
- AA.
data WORK.TEST debug;
set WORK.PILOTS;
State=scan(cityState,2,\’ \’);
if State=\’NE\’ then description=\’Central\’;
run; - BB.
data WORK.TEST debugger;
set WORK.PILOTS;
State=scan(cityState,2,\’ \’);
if State=\’NE\’ then description=\’Central\’;
run; - CC.
data WORK.TEST / debug;
set WORK.PILOTS;
State=scan(cityState,2,\’ \’);
if State=\’NE\’ then description=\’Central\’;
run; - DD.
data WORK.TEST / debugger;
set WORK.PILOTS;
State=scan(cityState,2,\’ \’);
if State=\’NE\’ then description=\’Central\’;
run;
- AA.
1515.Which statement is true concerning the SAS automatic variable _ERROR_?
- AA. It cannot be used in an if/then condition.
- BB. It cannot be used in an assignment statement.
- CC. It can be put into a keep statement or keep= option.
- DD. It is automatically dropped.
16 data WORK.DATE_INFO;
X=\’04jul2005\’d;
DayOfMonth=day(x);
MonthOfYear=month(x);
Year=year(x);
run;
What types of variables are DayOfMonth, MonthOfYear, and Year?- AA. DayOfMonth, Year, and MonthOfYear are character.
- BB. DayOfMonth, Year, and MonthOfYear are numeric.
- CC. DayOfMonth and Year are numeric. MonthOfYear is character.
- DD. DayOfMonth, Year, and MonthOfYear are date values.
1717.Given the following data step:
data WORK.GEO;
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 WORK.GEO contain?- AA.
City State Region
———– —– ——-
Tulsa OK Western
Los Angeles CA Western
Bangor Western - BB.
City State Region
———– —– ——-
Tulsa OK Western
Los Angeles CA Western
Bangor - CC.
City State Region
———– —– ——-
Tulsa OK Central
Los Angeles CA Western
Bangor Western - DD.
City State Region
———– —– ——-
Tulsa OK Central
Los CA Western
Bangor
- AA.
18第18题缺(crackman的博客中无此题)。待补充。
- ARight
- BWrong
1919.The SAS data set WORK.ONE contains a numeric variable named Num and a character variable named Char:
WORK.ONE
Num Char
— —-
1 23
3 23
1 77
The following SAS program is submitted:
proc print data=WORK.ONE;
where Num=\’1\’;
run;
What is output?- AA.
Num Char
— —-
1 23 - BB.
Num Char
— —-
1 23
1 77 - CC.
Num Char
— —-
1 23
3 23
1 77 - DD. No output is generated.
- AA.
2020. The data set WORK.REALESTATE 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 WORK.FEE_STRUCTURE;
format LocalFee CountryFee percent7.2;
set WORK.REALESTAT;
LocalFee=LocalFee/100;
CountryFee=CountryFee/100;
run;
What are the formats of the variables LOCALFEE and COUNTRYFEE in the output dataset?- AA. LocalFee has format of 9. and CountryFee has a format of 7.
- BB. LocalFee has format of 9. and CountryFee has a format of percent7.2
- CC. Both LocalFee and CountryFee have a format of percent7.2
- DD. The data step fails execution; there is no format for LocalFee.
2121.Given the SAS data set WORK.PRODUCTS:
ProdId Price ProductType Sales Returns
—— —– ———– —– ——-
K12S 95.50 OUTDOOR 15 2
B132S 2.99 CLOTHING 300 10
R18KY2 51.99 EQUIPMENT 25 5
3KL8BY 6.39 OUTDOOR 125 15
DY65DW 5.60 OUTDOOR 45 5
DGTY23 34.55 EQUIPMENT 67 2
The following SAS program is submitted:
data WORK.OUTDOOR WORK.CLOTH WORK.EQUIP;
set WORK.PRODUCTS;
if Sales GT 30;
if ProductType EQ \’OUTDOOR\’ then output WORK.OUTDOOR;
else if ProductType EQ \’CLOTHING\’ then output WORK.CLOTH;
else if ProductType EQ \’EQUIPMENT\’ then output WORK.EQUIP;
run;
How many observations does the WORK.OUTDOOR data set contain?- AA. 1
- BB. 2
- CC. 3
- DD. 4
2222.Which step displays a listing of all the data sets in the WORK library?
- AA. proc contents lib=WORK run;
- BB. proc contents lib=WORK.all;run;
- CC. proc contents data=WORK._all_; run;
- DD. proc contents data=WORK _ALL_; run;
2323.Which is a valid LIBNAME statement?
- AA. libname \”_SAS_data_library_location_\”;
- BB. sasdata libname \”_SAS_data_library_location_\”;
- CC. libname sasdata \”_SAS_data_library_location_\”;
- DD. libname sasdata sas \”_SAS_data_library_location_\”;
2424.Given 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?- AA.
data employees;
infile \’file specification\’ dlm=\’*\’;
input employee $ bdate : mmddyy10. years;
run; - BB.
data employees;
infile \’file specification\’ dsd=\’*\’;
input employee $ bdate mmddyy10. years;
run; - CC.
data employees;
infile \’file specification\’ dlm dsd;
input employee $ bdate mmddyy10. years;
run; - DD.
data employees;
infile \’file specification\’ dlm=\’*\’ dsd;
input employee $ bdate : mmddyy10. years;
run;
- AA.
2525.Given the following code:
proc print data=SASHELP.CLASS(firstobs=5 obs=15);
where Sex=\’M\’;
run;
How many observations will be displayed?- AA. 11
- BB. 15
- CC. 10 or fewer
- DD. 11 or fewer
2626.Which step sorts the observations of a permanent SAS data set by two variables and
stores the sorted observations in a temporary SAS data set?- AA.
proc sort out=EMPLOYEES data=EMPSORT;
by Lname and Fname;
run; - BB.
proc sort data=SASUSER.EMPLOYEES out=EMPSORT;
by Lname Fname;
run; - CC.
proc sort out=SASUSER.EMPLOYEES data=WORK.EMPSORT;
by Lname Fname;
run; - DD.
proc sort data=SASUSER.EMPLOYEES out=SASUSER.EMPSORT;
by Lname and Fname;
run;
- AA.
2727.Given the SAS data set WORK.TEMPS:
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=WORK.TEMPS;
by descending Month Day;
run;
proc print data=WORK.TEMPS;
run;
Which output is correct?- AA.
Obs Day Month Temp
— — —– —-
1 2 July 85
2 14 July 89
3 3 June 76
4 15 June 80
5 1 May 75
6 15 May 7 - BB.
Obs Day Month Temp
— — —– —-
1 1 May 75
2 2 July 85
3 3 June 76
4 14 July 89
5 15 May 70
6 15 June 80 - CC.
Obs Day Month Temp
— — —– —-
1 1 May 75
2 15 May 70
3 3 June 76
4 15 June 80
5 2 July 85
6 14 July 89 - DD.
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
- AA.
2828.Given the SAS data set WORK.P2000:
Location Pop2000
——– ——-
Alaska 626931
Delaware 783595
Vermont 608826
Wyoming 493782
and the SAS data set WORK.P2008:
State Pop2008
——– ——-
Alaska 686293
Delaware 873092
Wyoming 532668
The following output is desired:
Obs State Pop2000 Pop2008 Difference
1 Alaska 626931 686293 59362
2 Delaware 783595 873092 89497
3 Wyoming 493782 532668 38886
Which SAS program correctly combines the data?- AA.
data compare;
merge WORK.P2000(in=_a Location=State)
WORK.P2008(in=_b);
by State;
if _a and _b;
Difference=Pop2008-Pop2000;
run; - BB.
data compare;
merge WORK.P2000(rename=(Location=State))
WORK.P2008;
by State;
if _a and _b;
Difference=Pop2008-Pop2000;
run; - CC.
data compare;
merge WORK.P2000(in=_a rename=(Location=State))
WORK.P2008(in=_b);
by State;
if _a and _b;
Difference=Pop2008-Pop2000;
run; - DD.
data compare;
merge WORK.P2000(in=_a) (rename=(Location=State))
WORK.P2008(in=_b);
by State;
if _a and _b;
Difference=Pop2008-Pop2000;
run;
- AA.
2929.The following SAS program is sumbitted:
data WORK.INFO;
infile \’DATAFILE.TXT\’;
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?- AA. 1
- BB. 2
- CC. 3
- DD. 4
3030.You\’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:\\employees.dat\’.
The minimum record length was 33.
The maximum record length was 33.
NOTE: The data set WORK.EMPLOYEES has 20 observations and 4 variables.
What does it mean?- AA. A compiler error, triggered by an invalid character for the variable Salary.
- BB. An execution error, triggered by an invalid character for the variable Salary.
- CC. The 1st of potentially many errors, this one occurring on the 4th observation.
- DD. An error on the INPUT statement specification for reading the variable Salary.
3131. Given the following raw data records in DATAFILE.TXT:
—-|—-10—|—-20—|—-30
Kim,Basketball,Golf,Tennis
Bill,Football
Tracy,Soccer,Track
The following program is submitted:
data WORK.SPORTS_INFO;
length Fname Sport1-Sport3 $ 10;
infile \’DATAFILE.TXT\’ dlm=\’,\’;
input Fname $ Sport1 $ Sport2 $ Sport3 $;
run;
proc print data=WORK.SPORTS_INFO;
run;
Which output is correct based on the submitted program?- AA.
Obs Fname Sport1 Sport2 Sport3
1 Kim Basketball Golf Tennis
2 Bill Football
3 Tracy Soccer Track - BB.
Obs Fname Sport1 Sport2 Sport3
1 Kim Basketball Golf Tennis
2 Bill Football Football Football
3 Tracy Soccer Track Track - CC.
Obs Fname Sport1 Sport2 Sport3
1 Kim Basketball Golf Tennis
2 Bill Football Tracy Soccer - DD.
Obs Fname Sport1 Sport2 Sport3
1 Kim Basketball Golf Tennis
2 Bill Football
- AA.
3232.Consider the following data step:
data WORK.NEW;
set WORK.OLD;
Count+1;
run;
The variable Count is created using a sum statement. Which statement regarding this variable is true?- AA. It is assigned a value 0 when the data step begins execution.
- BB. It is assigned a value of missing when the data step begins execution.
- CC. It is assigned a value 0 at compile time.
- DD. It is assigned a value of missing at compile time.
3333.The following SAS program is submitted:
data WORK.TEST;
set WORK.PILOTS;
if Jobcode=\’Pilot2\’ then Description=\’Senior Pilot\’;
else Description=\’Unknown\’;
run;
The value for the variable Jobcode is: PILOT2.What is the value of the variable Description?- AA. PILOT2
- BB. Unknown
- CC. Senior Pilot
- DD. \’ \’ (missing character value)
3434.A user-defined format has been created using the FORMAT procedure.How is it stored?
- AA. in a SAS catalog
- BB. in a memory resident lookup table
- CC. in a SAS dataset in the WORK library
- DD. in a SAS dataset in a permanent SAS data library
3535.given the SAS data set SASDATA.TWO:
X Y
— —
5 2
3 1
5 6
The following SAS program is submitted:
data SASUSER.ONE SASUSER.TWO OTHER;
set SASDATA.TWO;
if X eq 5 then output SASUSER.ONE;
if Y lt 5 then output SASUSER.TWO;
output;
run;
What is the result?- AA.
data set SASUSER.ONE has 5 observations
data set SASUSER.TWO has 5 observations
data set WORK.OTHER has 3 observations - BB.
data set SASUSER.ONE has 2 observations
data set SASUSER.TWO has 2 observations
data set WORK.OTHER has 1 observations - CC.
data set SASUSER.ONE has 2 observations
data set SASUSER.TWO has 2 observations
data set WORK.OTHER has 5 observations - DD. No data sets are output. The DATA step fails execution due to syntax errors.
- AA.
3636.Given the contents of the raw data file \’EMPLOYEE.TXT\’:
—-+—-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 WORK.EMPLOYEE;
infile \’EMPLOYEE.TXT\’ ;
input
@1 FirstName $
@15 StartDate
@25 Department $;
run;
Which SAS informat correctly completes the program?- AA. date9.
- BB. mmddyy10.
- CC. ddmmyy10.
- DD. mondayyr10.
3737.The SAS data set SASUSER.HOUSES 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?- AA.
proc print data=SASUSER.HOUSES label;
label Open_Date \”Starting Date\”;
run; - BB.
proc print data=SASUSER.HOUSES label;
label Open_Date=\”Starting Date\”;
run; - CC.
proc print data=SASUSER.HOUSES;
label Open_Date=\”Starting Date\”;
run; - DD.
proc print data=SASUSER.HOUSES;
Open_Date=\”Starting Date\”;
run;
- AA.
3838.Given the SAS data set WORK.ONE:
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 WORK.TWO;
set WORK.ONE;
by X Y;
if First.Y;
run;
proc print data=WORK.TWO noobs;
run;
Which report is produced?- AA.
X Y Z
— — —
1 B 45
2 A 52
2 B 69
3 B 70
4 A 82
4 C 91 - BB.
X Y Z
— — —
1 A 27
1 B 45
2 A 52
2 B 69
3 B 70
4 A 82
4 C 91 - CC.
X Y Z
— — —
1 A 33
1 B 45
2 A 52
2 B 69
3 B 70
4 A 82
4 C 91 - DD. The PRINT procedure fails because the data set WORK.TWO is not created in the DATA
step.
- AA.
3939.The following SAS program is submitted:
data WORK.AUTHORS;
array Favorites{3} $ 8 (\’Shakespeare\’,\’Hemingway\’,\’McCaffrey\’);
run;
What is the value of the second variable in the dataset WORK.AUTHORS?- AA. Hemingway
- BB. Hemingwa
- CC. \’ \’ (a missing value)
- DD. The program contains errors. No variables are created.
4040.The following SAS program is submitted:
data WORK.PRODUCTS;
Prod=1;
do while(Prod LE 6);
Prod + 1;
end;
run;
What is the value of the variable Prod in the output data set?- AA. 6
- BB. 7
- CC. 8
- DD. . (missing numeric)
4141.Given the raw data record in the file phone.txt:
—-|—-10—|—-20—|—-30—|
Stevens James SALES 304-923-3721 14
The following SAS program is submitted:
data WORK.PHONES;
infile \’phone.txt\’;
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?- AA. FullName=CATX(\’ \’,EmpFName,EmpLName);
- BB. FullName=CAT(\’ \’,EmpFName,EmpLName);
- CC. FullName=EmpFName!!EmpLName;
- DD. FullName=EmpFName + EmpLName;
4242.The following SAS program is submitted:
data WORK.ONE;
Text=\’Australia, US, Denmark\’;
Pos=find(Text,\’US\’,\’i\’,5);
run;
What value will SAS assign to Pos?- AA. 0
- BB. 1
- CC. 2
- DD. 12
4343.Given the SAS data set WORK.ORDERS:
WORK.ORDERS
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?- AA. ship_note=catx(\’ \’,\’Order\’,order_id,\’shipped on\’,input(shipped,date9.),\’to\’,customer);
- BB. ship_note=catx(\’ \’,\’Order\’,order_id,\’shipped on\’,char(shipped,date9.),\’to\’,customer);
- CC. ship_note=catx(\’ \’,\’Order\’,order_id,\’shipped on\’,transwrd(shipped,date9.),\’to\’,customer);
- DD. ship_note=catx(\’ \’,\’Order\’,order_id,\’shipped on\’,put(shipped,date9.),\’to\’,customer);
4444.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?- AA. 2 temporary and 1 permanent SAS data sets are created
- BB. 3 temporary and 2 permanent SAS data sets are created
- CC. 2 temporary and 2 permanent SAS data sets are created
- DD. there is an error and no new data sets are created
4545.The following SAS program is submitted:
ods csvall file=\’c:\\test.cvs\’;
proc print data=WORK.ONE;
var Name Score Grade;
by IdNumber;
run;
ods csvall close;
What is produced as output?- AA. A file named test.cvs that can only be opened in Excel.
- BB. A text file named test.cvs that can be opened in Excel or in any text editor.
- CC. A text file named test.cvs that can only be opened in a text editor.
- DD. A file named test.cvs that can only be opened by SAS.
4646.Given the SAS data set WORK.ONE:
Obs Revenue2008 Revenue2009 Revenue2010
— ———– ———– ———–
1 1.2 1.6 2.0
The following SAS program is submitted:
data WORK.TWO;
set WORK.ONE;
Total=mean(of Rev:);
run;
What value will SAS assign to Total?- AA. 3
- BB. 1.6
- CC. 4.8
- DD. The program fails to execute due to errors.
4747.The 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
| 22.22 | 11.11 | 11.11 | 44.44
| 50.00 | 25.00 | 25.00 |
| 50.00 | 33.33 | 50.00 |
———+——–+——–+——–+
SOUTH | 2 | 2 | 1 | 5
| 22.22 | 22.22 | 11.11 | 55.56
| 40.00 | 40.00 | 20.00 |
| 50.00 | 66.67 | 50.00 |
———+——–+——–+——–+
Total 4 3 2 9
44.44 33.33 22.22 100.00
Which TABLES option(s) would be used to eliminate the
row and column counts and just see the frequencies and percents?- AA. norowcount nocolcount
- BB. freq percent
- CC. norow nocol
- DD. nocounts
4848.The following SAS program is submitted:
data WORK.TEST;
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 WORK.TEST contain?- AA.
Name Address State
————– —————- ——
Joe Conley 123 Main St.
Jane Ngyuen 555 Alpha Ave. NY
Jennifer Jason 666 Mt. Diablo - BB.
Name Address City State
————– —————- ———– ——
Joe Conley 123 Main St. Janesville
Jane Ngyuen 555 Alpha Ave. New York NY
Jennifer Jason 666 Mt. Diablo Eureka - CC.
Name Address State
————– —————- ——
Jane Ngyuen 555 Alpha Ave. NY - DD. O observations,there is a syntax error in the data step.
- AA.
4949.The following SAS program is submitted:
data WORK.TOTALSALES(keep=MonthSales{12});
set WORK.MONTHLYSALES(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?- AA. An array cannot be referenced on a keep= data set option.
- BB. The keep= data set option should be (keep=MonthSales*).
- CC. The keep= data set option should be the statement KEEP MonthSales{12}.
- DD. The variable MonthSales does not exist.
5050.Given the SAS data set WORK.ONE:
Id Char1
— —–
111 A
158 B
329 C
644 D
and the SAS data set WORK.TWO:
Id Char2
— —–
111 E
538 F
644 G
The following program is submitted:
data WORK.BOTH;
set WORK.ONE WORK.TWO;
by Id;
run;
What is the first observation in SAS data set WORK.BOTH?- AA.
Id Char1 Char2
— —– —–
111 A - BB.
Id Char1 Char2
— —– —–
111 E - CC.
Id Char1 Char2
— —– —–
111 A E - DD.
Id Char1 Char2
— —– —–
644 D G
- AA.
5151.The following program is submitted:
proc contents data=_all_;
run;
Which statement best describes the output from the submitted program?- AA. The output contains only a list of the SAS data sets that are contained in the WORK library.
- BB. The output displays only the contents of the SAS data sets that are contained in the WORK library.
- CC. The output displays only the variables in the SAS data sets that are contained in the WORK library.
- DD. 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.
5252.Given the SAS data set WORK.EMP_NAME:
Name EmpID
—- —–
Jill 1864
Jack 2121
Joan 4698
John 5463
Given the SAS data set WORK.EMP_DEPT:
EmpID Department
—– ———-
2121 Accounting
3567 Finance
4698 Marketing
5463 Accounting
The following program is submitted:
data WORK.ALL;
merge WORK.EMP_NAME(in=Emp_N)
WORK.EMP_DEPT(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 WORK.ALL after submitting the program?- AA. 1
- BB. 2
- CC. 3
- DD. 5
5353.The following SAS program is submitted:
data WORK.TOTAL_SALARY;
retain Total;
set WORK.SALARY;
by Department;
if First.Department
then Total=0;
Total=sum(Total, Wagerate);
if Last.Total;
run;
What is the initial value of the variable Total?- AA. 0
- BB. Missing
- CC. The value of the first observations Wagerate
- DD. Cannot be determined from the information given
5454.Consider the following data step:
data WORK.TEST;
set SASHELP.CLASS(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?- AA. The RETAIN statement is fine, but the value of City will be truncated to 8
bytes as the LENGTH statement has been omitted. - BB. 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. - CC. The assignment statement is fine, but the value of City will be truncated
to 8 bytes as the LENGTH statement has been omitted. - DD. City\’s value will be assigned one time, State\’s value 5 times.
- AA. The RETAIN statement is fine, but the value of City will be truncated to 8
5555.The following SAS program is submitted:
data WORK.DATE_INFO;
X=\”01Jan1960\” D ;
run;
Variable X contains what value?- AA. the numeric value 0
- BB. the character value \”01Jan1960\”
- CC. the date value 01011960
- DD. the code contains a syntax error and does not execute.
5656.The 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
| 22.22 | 11.11 | 11.11 | 44.44
| 50.00 | 25.00 | 25.00 |
| 50.00 | 33.33 | 50.00 |
———+——–+——–+——–+
SOUTH | 2 | 2 | 1 | 5
| 22.22 | 22.22 | 11.11 | 55.56
| 40.00 | 40.00 | 20.00 |
| 50.00 | 66.67 | 50.00 |
———+——–+——–+——–+
Total 4 3 2 9
44.44 33.33 22.22 100.00
Which TABLES statement was used to completed the following program
that produced the output?
proc freq data=sales;
<_insert_code_>
run;- AA. tables region product;
- BB. tables region,product;
- CC. tables region/product;
- DD. tables region*product;
5757.Given the SAS data set WORK.ONE:
N BeginDate
– ———
1 09JAN2010
2 12JAN2010
The following SAS program is submitted:
data WORK.TWO;
set WORK.ONE;
Day=<_insert_code_>;
format BeginDate date9.;
run;
The data set WORK.TWO is created, where Day would be 1 for Sunday, 2 for Monday, 3 for Tuesday, … :
WORK.TWO
N BeginDate Day
– ——— —
1 09JAN2010 1
2 12JAN2010 4
Which expression successfully completed the program and creates the variable Day?- AA. day(BeginDate)
- BB. weekday(BeginDate)
- CC. dayofweek(BeginDate)
- DD. getday(BeginDate,today())
5858.The 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=work.employees 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?- AA. The PAGENO option is invalid in the OPTIONS statement.
- BB. The RUN statement is missing after the FORMAT procedure.
- CC. The format name contains a period in the VALUE statement.
- DD. The LABEL option is missing from the PROC PRINT statement.
5959.Given the contents of the raw data file TYPECOLOR.DAT:
—-+—-10—+—-20—+—-30
daisyyellow
The following SAS program is submitted:
data FLOWERS;
infile \’TYPECOLOR.DAT\’ truncover;
length
Type $ 5
Color $ 11;
input
Type $
Color $;
run;
What are the values of the variables Type and Color?- AA. Type=daisy, Color=yellow
- BB. Type=daisy, Color=w
- CC. Type=daisy, Color=daisyyellow
- DD. Type=daisy, Color=
6060.Given the SAS data set WORK.PRODUCTS:
ProdId Price ProductType Sales Returns
—— —– ———– —– ——-
K12S 95.50 OUTDOOR 15 2
B132S 2.99 CLOTHING 300 10
R18KY2 51.99 EQUIPMENT 25 5
3KL8BY 6.39 OUTDOOR 125 15
DY65DW 5.60 OUTDOOR 45 5
DGTY23 34.55 EQUIPMENT 67 2
The following SAS program is submitted:
data WORK.REVENUE(drop=Sales Returns Price);
set WORK.PRODUCTS(keep=ProdId Price Sales Returns);
Revenue=Price*(Sales-Returns);
run;
How many variables does the WORK.REVENUE data set contain?- AA. 2
- BB. 3
- CC. 4
- DD. 6
6161.
Consider the data step:
data WORK.TEST;
infile 'c:\class1.csv' 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?- AA. if Age not in(15,16) then Group=1; else Group=2;
- BB. if (Age NE 16) or (Age NE 15) then Group=1; else Group=2;
- CC. where Age not between 15 and 16 then Group=1; else Group=2;
- DD. both A or C will work.
6262.The following SAS program is submitted:
<_insert_ods_code_>
proc means data=SASUSER.SHOES;
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?- AA.
ods html open=\’sales.html\’;
ods html close; - BB.
ods file=\’sales.html\’ / html;
ods file close; - CC.
ods html file=\’sales.html\’;
ods html close; - DD.
ods file html=\’sales.html\’;
ods file close;
- AA.
6363.
The following SAS program is submitted:
data WORK.OUTDS;
do until(Prod GT 6);
Prod + 1;
end;
run;
What is the value of the variable Prod in the output data set?- AA. . (missing)
- BB. 6
- CC. 7
- DD. Undetermined, infinite loop.
6464题缺。
- ARight
- BWrong
6565.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?- AA. The label of the variable Jobcode is Job (only the first word).
- BB. The label of the variable Jobcode is Job Desc (only the first 8 characters).
- CC. The label of the variable Jobcode is Job Description.
- DD. The program fails to execute due to errors. Labels must be defined in a PROC step.
6666.The following SAS program is submitted:
data WORK.SALES;
do Year=1 to 5;
do Month=1 to 12;
X + 1;
end;
end;
run;
How many observations are written to the WORK.SALES data set?- AA. 0
- BB. 1
- CC. 5
- DD. 60
6767.Consider the following data step:
data WORK.NEW;
set WORK.OLD(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 WORK.OLD, what value new value would be assigned to X if its original value was a missing value?- AA. X would get a value of 1.
- BB. X would get a value of 3.
- CC. X would retain its original value of missing.
- DD. This step does not run because of syntax errors.
6868.The following SAS program is submitted:
data WORK.ACCOUNTING;
set WORK.DEPARTMENT;
length EmpId $6;
CharEmpid=EmpId;
run;
If data set WORK.DEPARTMENT has a numeric variable EmpId,which statement is true about the output dataset?- AA. The type of the variable CharEmpid is numeric.
- BB. The type of the variable CharEmpid is unknown.
- CC. The type of the variable CharEmpid is character.
- DD. The program fails to execute due to errors.
6969.Given the data set WORK.EMPDATA:
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\’?- AA. where substr(Job_Title,(length(Job_Title)-6))=\’Manager\’;
- BB. where upcase(scan(Job_Title,-1,\’ \’))=\’MANAGER\’;
- CC. where Job_Title=\’% Manager \’;
- DD. where Job_Title like \’%Manager%\’;
7070.After a SAS program is submitted, the following is written to the SAS log:
105 data WORK.JANUARY;
106 set WORK.ALLYEAR(keep=Product Month Quantity Cost);
107 if Month=\’JAN\’ then output WORK.JANUARY;
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 WORK.JANUARY to replace the DROP statement that generated the error in the log?- AA. (drop Month Quantity Cost)
- BB. (drop Month, Quantity, Cost)
- CC. (drop=Month, Quantity, Cost)
- DD. (drop=Month Quantity Cost)
Informações
- Descrição
- 跟crackman做sas base认证试题
- Autor
- Terry Yan
- Idioma
- English
- Visualizações
- 6.702
- Etiquetas
- Avaliação
- 5,0 de 5 · 4 avaliações Avalie este quiz