Pregunta 1
Respuesta
-
3 Observations, 4 Variables
-
3 Observations, 3 Variables
-
4 Observations, 3 Variables
-
Can't tell because some values are missing
Pregunta 2
Pregunta
How many program steps are executed when the program below is processed?
data user.tables;
infile jobs;
input date name $ job $;
run;
proc sort data = user.tables;
by name;
run;
proc print data = user.tables;
run;
SAS Institute (2011-08-08). SAS Certification Prep Guide: Base Programming for SAS 9, Third Edition (Kindle Locations 13475-13478). SAS Institute/SAS Publishing. Kindle Edition.
Pregunta 3
Pregunta 4
Pregunta 5
Pregunta
Which of the following variable names is valid
Respuesta
-
4BirthDate
-
$Cost
-
_Items_
-
Tax-Rate
Pregunta 6
Pregunta
Which of the following files is a permanent SAS file?
Respuesta
-
Sashelp.PrdSale
-
Sasuser.MySales
-
Profits.Quarter1
-
all the above
Pregunta 7
Pregunta
In a DATA step, how can you reference a temporary SAS data set named Forecast?
Pregunta 8
Pregunta 9
Pregunta
How many statements does the following SAS program contain?
proc print data = new.prodsale
label double;
var state day price1 price2; where state =' NC';
label state =' Name of State'; run;
Pregunta 10
Pregunta
What is a SAS library?
Respuesta
-
collection of SAS files, such as SAS data sets and catalogs
-
in some operating environments, a physical collection of SAS files
-
a group of SAS files in the same folder or directory.
-
all the above
Pregunta 11
Pregunta
If you submit the following program, how does the output look?
options pagesize = 55 nonumber;
proc tabulate data = clinic.admit;
class actlevel;
var age height weight;
table actlevel, ( age height weight)* mean;
run;
options linesize = 80;
proc means data = clinic.heart min max maxdec = 1;
var arterial heart cardiac urinary;
class survive sex;
run;
Respuesta
-
The PROC MEANS output has a print line width of 80 characters, but the PROC TABULATE output has no print line width.
-
The PROC TABULATE output has no page numbers, but the PROC MEANS output has page numbers
-
Each page of output from both PROC steps is 55 lines long and has no page numbers, and the PROC MEANS output has a print line width of 80 characters.
-
The date does not appear on output from either PROC step.
Pregunta 12
Pregunta
How can you create SAS output in HTML format on any SAS platform?
Respuesta
-
by specifying system options
-
by using programming statements
-
by using SAS windows to specify the result format
-
you can't create HTML output on all SAS platforms
Pregunta 13
Pregunta
In order for the date values 05May1955 and 04Mar2046 to be read correctly, what value must the YEARCUTOFF = option have?
Pregunta 14
Pregunta
When you specify an engine for a library, you always specify
Respuesta
-
the file format for files that are stored in the library
-
the version of SAS you are using
-
access to other software vendors' files
-
instructions for creating temporary SAS files
Pregunta 15
Pregunta
Which statement prints a summary of all the files stored in the library named Area51?
Respuesta
-
proc contents data=Area51._all_ nods;
-
proc contents data=Area51 _all_ nods;
-
proc contents data=Area51 _all_ noobs
-
proc contents data=Area51 _all_.nods;
Pregunta 16
Pregunta 17
Pregunta
Which of the following programs correctly references a SAS data set named SalesAnalysis that is stored in a permanent SAS library?
Respuesta
-
data saleslibrary.salesanalysis;
set mydata.quarter1sales;
if sales > 100000;
run;
-
data mysales.totals;
set sales_99. salesanalysis;
if totalsales > 50000;
run;
-
aproc print data = salesanalysis.quarter1;
var sales salesrep month;
run;
-
proc freq data = 1999data.salesanalysis; t
ables quarter* sales;
run;
Pregunta 18
Pregunta
Which time span is used to interpret two-digit year values if the YEARCUTOFF = option is set to 1950?
Respuesta
-
1950-2049
-
1950-2050
-
1949-2050
-
1950-2000
Pregunta 19
Pregunta
Assuming you are using SAS code and not special SAS windows, which one of the following statements is false?
Respuesta
-
LIBNAME statements can be stored with a SAS program to reference the SAS library automatically when you submit the program.
-
When you delete a libref, SAS no longer has access to the files in the library. However, the contents of the library still exist on your operating system.
-
Librefs can last from one SAS session to another.
-
You can access files that were created with other vendors' software by submitting a LIBNAME statement.
Pregunta 20
Pregunta
What does the following statement do?
libname osiris spss 'c:\ myfiles\ sasdata\ data.spss';
Respuesta
-
defines a library called Spss using the OSIRIS engine
-
defines a library called Osiris using the SPSS engine
-
defines two libraries called Osiris and Spss using the default engine
-
defines the default library using the OSIRIS and SPSS engines
Pregunta 21
Pregunta
As you write and edit SAS programs it's a good idea to
Respuesta
-
begin DATA and PROC steps in column one
-
indent statements within a step
-
begin RUN statements in column one
-
all the above
Pregunta 22
Pregunta
Suppose you have submitted a SAS program that contains spelling errors. Which set of steps should you perform, in the order shown, to revise and resubmit the program?
Respuesta
-
Correct the errors.
Clear the Log window.
Resubmit the program.
Check the Log window.
-
Correct the errors.
Resubmit the program.
Check the Output window.
Check the Log window.
-
Correct the Errors.
Clear the Log window.
Resubmit the program.
Check the Output window.
-
Correct the errors.
Clear the Output window.
Resubmit the program.
Check the Output window.
Pregunta 23
Pregunta
What happens if you submit the following program?
proc sort data = clinic.stress out = maxrates; by maxhr;
run;
proc print data = maxrates label double noobs;
label rechr =' Recovery Heart Rate;
var resthr maxhr rechr date;
where toler =' I' and resthr > 90;
sum fee;
run;
Respuesta
-
Log messages indicate that the program ran successfully
-
A “PROC SORT running” message appears at the top of the active window, and a log message may indicate an error in a statement that seems to be valid.
-
A log message indicates that an option is not valid or not recognized.
-
A “PROC PRINT running” message appears at the top of the active window, and a log message may indicate that a quoted string has become too long or that the statement is ambiguous.
Pregunta 24
Pregunta
What generally happens when a syntax error is detected?
Respuesta
-
SAS continues processing the step
-
SAS continues to process the step, and the Log window displays messages about the error
-
SAS stops processing the step in which the error occurred and the Log window displays messages about the error
-
SAS stops processing the step in which the error occurred, and the Output window displays messages about the error.
Pregunta 25
Pregunta
A syntax error occurs when
Respuesta
-
Some data values are not appropriate for the SAS statements that are specified in a program.
-
the form of the elements in a SAS statement is correct, but the elements are not valid for that usage.
-
program statements do not conform to the rules of the SAS language.
-
none of the above
Pregunta 26
Pregunta
How can you tell whether you have specified an invalid option in a SAS program?
Respuesta
-
A log message indicates an error in a statement that seems to be valid.
-
A log message indicates that an option is not valid or not recognized.
-
The message “PROC running” or “DATA step running” appears at the top of the active window.
-
You can't tell until you view the output from the program.
Pregunta 27
Pregunta
Which of the following programs contains a syntax error?
Respuesta
-
proc sort data = sasuser.mysales;
by region;
run;
-
dat sasuser.mysales;
set mydata.sales99;
run;
-
proc print data = sasuser.mysales label;
label region =' Sales Region';
run;
-
none of the above
Pregunta 28
Pregunta
What should you do after submitting the following program in the Windows or UNIX operating environment?
proc print data = mysales;
where state =' NC;
run;
Respuesta
-
Submit a RUN statement to complete the PROC step.
-
Recall the program. Then add a quotation mark and resubmit the corrected program.
-
Cancel the submitted statements. Then recall the program, add a quotation mark, and resubmit the corrected program
-
Recall the program. Then replace the invalid option and resubmit the corrected program.
Pregunta 29
Pregunta
Which of the following commands opens a file in the code editing window?
Respuesta
-
file 'd:\ programs\ sas\ newprog.sas'
-
include 'd:\ programs\ sas\ newprog.sas'
-
open 'd:\ programs\ sas\ newprog.sas'
-
all of the above
Pregunta 30
Pregunta
Suppose you submit a short, simple DATA step. If the active window displays the message “DATA step running” for a long time, what probably happened?
Respuesta
-
You misspelled a keyword
-
You forgot to end the DATA step with a RUN statement
-
You specified an invalid data set option
-
Some data values weren't appropriate for the SAS statements that you specified.
Pregunta 31
Respuesta
-
proc print data = flights.laguardia noobs;
var on changed flight;
where on > = 160;
run;
-
proc print data = flights.laguardia;
var date on changed flight;
where changed > 3;
run;
-
proc print data = flights.laguardia label;
id date;
var boarded transferred flight;
label boarded =' On' transferred =' Changed';
where flight =' 219';
run;
-
proc print flights.laguardia noobs;
id date;
var date on changed flight;
where flight =' 219';
run;
Pregunta 32
Pregunta
Which of the following PROC PRINT steps is correct if labels are not stored with the data set?
Respuesta
-
proc print data = allsales.totals label;
label region8 =' Region 8 Yearly Totals';
run;
-
proc print data = allsales.totals;
label region8 =' Region 8 Yearly Totals';
run;
-
proc print data allsales.totals label noobs;
run;
-
proc print allsales.totals label;
run;
Pregunta 33
Pregunta
Which of the following statements selects from a data set only those observations for which the value of the variable Style is RANCH, SPLIT, or TWOSTORY?
Respuesta
-
where style =' RANCH' or 'SPLIT' or 'TWOSTORY';
-
where style in 'RANCH' or 'SPLIT' or 'TWOSTORY';
-
where style in (RANCH, SPLIT, TWOSTORY);
-
where style in (' RANCH',' SPLIT',' TWOSTORY');
Pregunta 34
Pregunta
If you want to sort your data and create a temporary data set named Calc to store the sorted data, which of the following steps should you submit?
Respuesta
-
proc sort data = work.calc out = finance.dividend;
run;
-
proc sort dividend out = calc;
by account;
run;
-
proc sort data = finance.dividend out = work.calc;
by account;
run;
-
proc sort from finance.dividend to calc;
by account;
run;
Pregunta 35
Respuesta
-
the DATE system option and the LABEL option in PROC PRINT
-
the DATE and NONUMBER system options and the DOUBLE and NOOBS options in PROC PRINT
-
the DATE and NONUMBER system options and the DOUBLE option in PROC PRINT
-
the DATE and NONUMBER system options and the NOOBS option in PROC PRINT
Pregunta 36
Pregunta
Which of the following statements can you use in a PROC PRINT step to create this output?
Respuesta
-
var month instructors;
sum instructors aerclass walkjogrun swim;
-
var month;
sum instructors aerclass walkjogrun swim;
-
var month instructors aerclass;
sum instructors aerclass walkjogrun swim;
-
all the above
Pregunta 37
Pregunta
What happens if you submit the following program?
proc sort data = clinic.diabetes;
run;
proc print data = clinic.diabetes;
var age height weight pulse;
where sex =' F';
run
Respuesta
-
The PROC PRINT step runs successfully, printing observations in their sorted order.
-
The PROC SORT step permanently sorts the input data set.
-
The PROC SORT step generates errors and stops processing, but the PROC PRINT step runs successfully, printing observations in their original (unsorted) order.
-
The PROC SORT step runs successfully, but the PROC PRINT step generates errors and stops processing.
Pregunta 38
Pregunta
If you submit the following program, which output does it create?
proc sort data = finance.loans out = work.loans;
by months amount;
run;
proc print data = work.loans noobs;
var months;
sum amount payment;
where months < 360;
run;
Pregunta 39
Pregunta
Choose the statement below that selects rows in which
the amount is less than or equal to $ 5000
the account is 101-1092 or the rate equals 0.095.
Respuesta
-
where amount < = 5000 and account =' 101-1092' or rate = 0.095;
-
where (amount le 5000 and account =' 101-1092') or rate = 0.095;
-
where amount < = 5000 and (account =' 101-1092' or rate eq 0.095);
-
where amount < = 5000 or account =' 101-1092' and rate = 0.095;
Pregunta 40
Pregunta
What does PROC PRINT display by default?
Respuesta
-
PROC PRINT does not create a default report; you must specify the rows and columns to be displayed.
-
PROC PRINT displays all observations and variables in the data set. If you want an additional column for observation numbers, you can request it.
-
PROC PRINT displays columns in the following order: a column for observation numbers, all character variables, and all numeric variables.
-
PROC PRINT displays all observations and variables in the data set, a column for observation numbers on the far left, and variables in the order in which they occur in the data set.
Pregunta 41
Pregunta
Which SAS statement associates the fileref Crime with the raw data file C:\ States\ Data\Crime.dat?
Respuesta
-
filename crime 'c:\ states\ data\ crime.dat';
-
filename crime c:\ states\ data\ crime.dat;
-
fileref crime 'c:\ states\ data\ crime.dat';
-
filename 'c:\ states\ data\ crime' crime.dat;
Pregunta 42
Pregunta
Filerefs remain in effect until . . .
Respuesta
-
You change them
-
You cancel them
-
you end your SAS session
-
all the above
Pregunta 43
Pregunta
Which statement identifies a raw data file to be read with the fileref Products and specifies that the DATA step read only records 1-15?
Pregunta 44
Pregunta
Which of the following programs correctly writes the observations from the data set below to a raw data file?
Respuesta
-
data _null_;
set work.patients;
infile 'c:\ clinic\ patients\ referals.dat';
input id 1-4 sex 6 age 8-9 height 11-12 weight 14-16 pulse 18-20;
run;
-
data referals.dat;
set work.patients;
input id 1-4 sex 6 age 8-9 height 11-12 weight 14-16 pulse 18-20;
run;
-
data _null_;
set work.patients;
file c:\ clinic\ patients\ referals.dat;
put id 1-4 sex 6 age 8-9 height 11-12 weight 14-16 pulse 18-20;
run;
-
data _null_;
set work.patients;
file 'c:\ clinic\ patients\ referals.dat';
put id 1-4 sex 6 age 8-9 height 11-12 weight 14-16 pulse 18-20;
run;
Pregunta 45
Pregunta
Which raw data file can be read using column input?
Pregunta 46
Respuesta
-
data work.salesrep;
infile empdata;
input ID $ 1-4 LastName $ 6-12 FirstName $ 14-18 City $ 20-29;
run;
proc print data = work.salesrep;
run;
-
data work.salesrep;
infile empdata;
input ID $ 1-4 Name $ 6-12 FirstName $ 14-18 City $ 20-29;
run;
proc print data = work.salesrep;
run;
-
data work.salesrep;
infile empdata;
input ID $ 1-4 name1 $ 6-12 name2 $ 14-18 City $ 20-29;
run;
proc print data = work.salesrep;
run;
-
All the above
Pregunta 47
Respuesta
-
input StockNumber $ 1-3 Finish $ 5-9 Style $ 11-18 Item $ 20-24 Price 27-32;
-
input StockNumber $ 1-3 Price 27-32 Item $ 20-24 Finish $ 5-9 Style $ 11-18;
-
input $ StockNumber 1-3 Price 27-32 $ Item 20-24 $ Finish 5-9 $ Style 11-18;
-
input StockNumber $ 1-3 Price $ 27-32 Item $ 20-24 Finish $ 5-9 Style $ 11-18;
Pregunta 48
Pregunta
Which statement correctly re-defines the values of the variable Income as 100 percent higher?
Pregunta 49
Pregunta
Which program correctly reads instream data?
Respuesta
-
data finance.newloan;
input datalines;
if country =' JAPAN';
MonthAvg = amount/ 12;
1998 US CARS 194324.12
1998 US TRUCKS 142290.30
1998 CANADA CARS 10483.44
1998 CANADA TRUCKS 93543.64
1998 MEXICO CARS 22500.57
1998 MEXICO TRUCKS 10098.88
1998 JAPAN CARS 15066.43
1998 JAPAN TRUCKS 40700.34
;
-
data finance.newloan;
input Year 1-4 Country $ 6-11 Vehicle $ 13-18 Amount 20-28;
if country =' JAPAN';
MonthAvg = amount/ 12;
datalines;
run;
-
data finance.newloan;
input Year 1-4 Country 6-11 Vehicle 13-18 Amount 20-28;
if country =' JAPAN';
MonthAvg = amount/ 12;
datalines;
1998 US CARS 194324.12
1998 US TRUCKS 142290.30
1998 CANADA CARS 10483.44
1998 CANADA TRUCKS 93543.64
1998 MEXICO CARS 22500.57
1998 MEXICO TRUCKS 10098.88
1998 JAPAN CARS 15066.43
1998 JAPAN TRUCKS 40700.34
;
-
data finance.newloan;
input Year 1-4 Country $ 6-11 Vehicle $ 13-18 Amount 20-28;
if country =' JAPAN';
MonthAvg = amount/ 12;
datalines;
1998 US CARS 194324.12
1998 US TRUCKS 142290.30
1998 CANADA CARS 10483.44
1998 CANADA TRUCKS 93543.64
1998 MEXICO CARS 22500.57
1998 MEXICO TRUCKS 10098.88
1998 JAPAN CARS 15066.43
1998 JAPAN TRUCKS 40700.34
;
Pregunta 50
Pregunta
Which SAS statement subsets the raw data shown below so that only the observations in which Sex (in the second field) has a value of F are processed?
Respuesta
-
if sex = f;
-
if sex = F;
-
if sex =' F';
-
a or b
Pregunta 51
Pregunta
Which of the following is not created during the compilation phase?
Respuesta
-
a. the data set descriptor
-
b. the first observation
-
c. the program data vector
-
d. the _N_and_ERROR_ automatic variables
Pregunta 52
Pregunta
During the compilation phase, SAS scans each statement in the DATA step, looking for syntax errors. Which of the following is not considered a syntax error?
Respuesta
-
a. incorrect values and formats
-
b. invalid options or variable names
-
c. missing or invalid punctuation
-
d. missing or misspelled keywords
Pregunta 53
Pregunta
Unless otherwise directed, the DATA step executes...
Respuesta
-
a. once for each compilation phase.
-
b. once for each DATA step statement
-
c. once for each record in the input file
-
d. once for each variable in the input file
Pregunta 54
Pregunta
At the beginning of the execution phase, the value of _N_ is 1, the value of _ERROR_ is 0, and the values of the remaining variables are set to:
Respuesta
-
a. 0
-
b. 1
-
c. undefined
-
d. missing
Pregunta 55
Pregunta
Suppose you run a program that causes three DATA errors. What is the value of the automatic variable _ERROR_ when the observation that contains the third error is processed?
Pregunta 56
Pregunta
Which of the following actions occurs at the beginning of an iteration of the DATA step?
Respuesta
-
a. The automatic variables _N_ and _ERROR_ are incremented by one.
-
b. The DATA step stops execution.
-
c. The descriptor portion of the data set is written.
-
d. The values of variables created in programming statements are re-set to missing in the program data vector.
Pregunta 57
Pregunta
Based on the DATA step shown below, in what order will the variables be stored in the new data set?
data perm.update;
infile invent;
input IDnum $ Item $ 1-13 Instock 21-22 BackOrd 24-25;
Total = instock + backord;
run;
Respuesta
-
a. IDnum Item InStock BackOrd Total
-
b. Item IDnum InStock BackOrd Total
-
c. Total IDnum Item InStock BackOrd
-
d. Total Item IDnum InStock BackOrd
Pregunta 58
Pregunta
If SAS detects syntax errors, then...
Respuesta
-
a. data set variables will contain missing values.
-
b. the DATA step does not compile.
-
c. the DATA step still compiles, but it does not execute.
-
d. the DATA step still compiles and executes.
Pregunta 59
Pregunta
What is wrong with this program?
data perm.update;
infile invent
input Item $ 1-13 IDnum $ 15-19 Instock 21-22
BackOrd 24-25;
total = instock + backord;
run;
Respuesta
-
a. missing semicolon on second line
-
b. missing semicolon on third line
-
c. incorrect order of variables
-
d. incorrect variable type
Pregunta 60
Respuesta
-
a. A keyword was misspelled in the DATA step.
-
b. A semicolon was missing from the INFILE statement.
-
c. A variable was misspelled in the INPUT statement.
-
d. A dollar sign was missing in the INPUT statement.
Pregunta 61
Pregunta
If you don't specify the LIBRARY = option on the PROC FORMAT statement, your formats are stored in Work.Formats, and they exist ...
Respuesta
-
a. only for the current procedure.
-
b. only for the current DATA step.
-
c. only for the current SAS session.
-
d. permanently.
Pregunta 62
Pregunta
Which of the following statements will store your formats in a permanent catalog?
Respuesta
-
a. libname library 'c:\ sas\ formats\ lib';
proc format lib = library ...;
-
b. libname library 'c:\ sas\ formats\ lib';
format lib = library ...;
-
c. library =' c:\ sas\ formats\ lib';
proc format library ...;
-
d. library =' c:\ sas\ formats\ lib';
proc library ...;
Pregunta 63
Pregunta
When creating a format with the VALUE statement, the new format's name
-cannot end with a number
-cannot end with a period
-cannot be the name of a SAS format, and...
Respuesta
-
a. cannot be the name of a data set variable.
-
b. must be at least two characters long.
-
c. must be at least eight characters long.
-
d. must begin with a dollar sign ($) if used with a character variable.
Pregunta 64
Pregunta
Which of the following FORMAT procedures is written correctly?
Respuesta
-
a. proc format lib = library value colorfmt; 1 =' Red' 2 =' Green' 3 =' Blue' run;
-
b. proc format lib = library; value colorfmt 1 =' Red' 2 =' Green' 3 =' Blue'; run;
-
c. proc format lib = library; value colorfmt; 1 =' Red' 2 =' Green' 3 =' Blue' run;
-
d. proc format lib = library; value colorfmt 1 =' Red'; 2 =' Green'; 3 =' Blue'; run;
Pregunta 65
Pregunta
Which of these is false? Ranges in the VALUE statement can specify...
Respuesta
-
a. a single value, such as 24 or 'S'.
-
b. a range of numeric values, such as 0-1500.
-
c. a range of character values, such as 'A'-' M'.
-
d. a list of numeric and character values separated by commas, such as 90,' B', 180,' D', 270.
Pregunta 66
Pregunta
How many characters can be used in a label?
Respuesta
-
a. 40
-
b. 96
-
c. 200
-
d. 256
Pregunta 67
Pregunta
Which keyword can be used to label missing numeric values as well as any values that are not specified in a range?
Respuesta
-
a. LOW
-
b. MISS
-
c. MISSING
-
d. OTHER
Pregunta 68
Pregunta
You can place the FORMAT statement in either a DATA step or a PROC step. What happens when you place it in a DATA step?
Respuesta
-
a. You temporarily associate the formats with variables.
-
b. You permanently associate the formats with variables.
-
c. You replace the original data with the format labels.
-
d. You make the formats available to other data sets.
Pregunta 69
Pregunta
The format JOBFMT was created in a FORMAT procedure. Which FORMAT statement will apply it to the variable JobTitle in the program output?
Respuesta
-
a. format jobtitle jobfmt;
-
b. format jobtitle jobfmt.;
-
c. format jobtitle = jobfmt;
-
d. format jobtitle =' jobfmt';
Pregunta 70
Pregunta
Which keyword, when added to the PROC FORMAT statement, will display all the formats in your catalog?
Respuesta
-
a. CATALOG
-
b. LISTFMT
-
c. FMTCAT
-
d. FMTLIB
Pregunta 71
Pregunta
The default statistics produced by the MEANS procedure are n, mean, minimum, maximum, and...
Pregunta 72
Pregunta
Which statement will limit a PROC MEANS analysis to the variables Boarded, Transfer, and Deplane?
Respuesta
-
a. by boarded transfer deplane;
-
b. class boarded transfer deplane;
-
c. output boarded transfer deplane;
-
d. var boarded transfer deplane;
Pregunta 73
Pregunta
The data set Survey.Health includes the following variables. Which is a poor candidate for PROC MEANS analysis?
Respuesta
-
a. IDnum
-
b. Age
-
c. Height
-
d. Weight
Pregunta 74
Pregunta
Which of the following statements is true regarding BY group processing?
Respuesta
-
a. BY variables must be either indexed or sorted.
-
b. Summary statistics are computed for BY variables.
-
c. BY group processing is preferred when you are categorizing data that contains few variables.
-
d. BY group processing overwrites your data set with the newly grouped observations.
Pregunta 75
Pregunta
Which group processing statement produced the PROC MEANS output shown below?
Respuesta
-
a. class sex survive;
-
b. class survive sex;
-
c. by sex survive;
-
d. by survive sex;
Pregunta 76
Pregunta
Which program can be used to create the following output?
Respuesta
-
a. proc means data = clinic.diabetes; var age height weight; class sex; output out = work.sum_gender mean = AvgAge AvgHeight AvgWeight; run;
-
b. proc summary data = clinic.diabetes print; var age height weight; class sex; output out = work.sum_gender mean = AvgAge AvgHeight AvgWeight; run;
-
c. proc means data = clinic.diabetes noprint; var age height weight; class sex; output out = work.sum_gender mean = AvgAge AvgHeight AvgWeight; run;
-
d. Both a and b.
Pregunta 77
Pregunta
By default, PROC FREQ creates a table of frequencies and percentages for which data set variables?
Pregunta 78
Pregunta
Frequency distributions work best with variables that contain
Respuesta
-
a. continuous values.
-
b. numeric values.
-
c. categorical values.
-
d. unique values.
Pregunta 79
Pregunta
Which PROC FREQ step produced this two-way table?
Respuesta
-
a. proc freq data = clinic.diabetes; tables height weight;format height htfmt. weight wtfmt.; run;
-
b. proc freq data = clinic.diabetes; tables weight height; format weight wtfmt. height htfmt.; run;
-
c. proc freq data = clinic.diabetes; tables height* weight; format height htfmt. weight wtfmt.; run;
-
d. proc freq data = clinic.diabetes; tables weight* height; format weight wtfmt. height htfmt.; run;
Pregunta 80
Pregunta
Which PROC FREQ step produced this table?
Respuesta
-
a. proc freq data = clinic.diabetes; tables sex weight / list; format weight wtfmt.; run;
-
b. proc freq data = clinic.diabetes; tables sex* weight / nocol; format weight wtfmt.; run;
-
c. proc freq data = clinic.diabetes; tables sex weight / norow nocol; format weight wtfmt.; run;
-
d. proc freq data = clinic.diabetes; tables sex* weight / nofreq norow nocol; format weight wtfmt.; run;
Pregunta 81
Pregunta
Using ODS statements, how many types of output can you generate at once?
Respuesta
-
a. 1 (only HTML output)
-
b. 2
-
c. 3
-
d. as many as you want
Pregunta 82
Pregunta
If ODS is set to its default settings in the SAS windowing environment for Microsoft Windows and UNIX, , what types of output are created by the code below?
ods html file =' c:\ myhtml.htm';
ods pdf file =' c:\ mypdf.pdf';
Respuesta
-
a. HTML and PDF
-
b. PDF only
-
c. HTML, PDF, and listing
-
d. No output is created because ODS is closed by default.
Pregunta 83
Pregunta
In the SAS windowing environment for Microsoft Windows and UNIX, what is the purpose of closing the HTML destination in the code shown below?
ods html close;
ods rtf ... ;
Respuesta
-
a. It conserves system resources.
-
b. It simplifies your program.
-
c. It makes your program compatible with other hardware platforms.
-
d. It makes your program compatible with previous versions of SAS.
Pregunta 84
Pregunta
When the code shown below is run, what will the file D:\ Output\ body.html contain?
ods html body =' d:\ output\ body.html';
proc print data = work.alpha;
run;
proc print data = work.beta;
run;
ods html close;
Respuesta
-
a. The PROC PRINT output for Work.Alpha.
-
b. The PROC PRINT output for Work.Beta.
-
c. The PROC PRINT output for both Work.Alpha and Work.Beta.
-
d. Nothing. No output will be written to D:\ Output\body.html.
Pregunta 85
Pregunta
When the code shown below is run, what file will be referenced by the links in D:\ Output\contents.html?
ods html body =' d:\ output\ body.html'
contents =' d:\ output\ contents.html'
frame =' d:\ output\ frame.html';
Respuesta
-
a. D:\ Output\ body.html
-
b. D:\ Output\ contents.html
-
c. D:\ Output\ frame.html
-
d. There are no links from the file D:\ Output\contents.html.
Pregunta 86
Pregunta
The table of contents created by the CONTENTS = option contains a numbered heading for
Respuesta
-
a. each procedure
-
b. each procedure that creates output.
-
c. each procedure and DATA step.
-
d. each HTML file created by your program.
Pregunta 87
Pregunta
When the code shown below is run, what will the file D:\ Output\ frame.html display?
ods html body =' d:\ output\ body.html'
contents =' d:\ output\ contents.html'
frame =' d:\ output\ frame.html';
Respuesta
-
a. The file D:\ Output\contents.html.
-
b. The file D:\ Output\frame.html.
-
c. The files D:\ Output\ contents.html and D:\ Output\body.html.
-
d. It displays no other files.
Pregunta 88
Pregunta
What is the purpose of the URL = suboptions shown below?
ods html body =' d:\ output\ body.html' (url =' body.html')
contents =' d:\ output\ contents.html'
(url =' contents.html')
frame =' d:\ output\ frame.html';
Respuesta
-
a. To create absolute link addresses for loading the files from a server.
-
b. To create relative link addresses for loading the files from a server.
-
c. To allow HTML files to be loaded from a local drive.
-
d. To send HTML output to two locations.
Pregunta 89
Pregunta
Which ODS HTML option was used in creating the following table?
Respuesta
-
a. format = brown
-
b. format =' brown'
-
c. style = brown
-
d. style =' brown'
Pregunta 90
Pregunta
What is the purpose of the PATH = option?
ods html path =' d:\ output' (url = none)
body =' body.html'
contents =' contents.html'
frame =' frame.html';
Respuesta
-
a. It creates absolute link addresses for loading HTML files from a server.
-
b. It creates relative link addresses for loading HTML files from a server.
-
c. It allows HTML files to be loaded from a local drive.
-
d. It specifies the location of HTML file output.
Pregunta 91
Pregunta
Which program creates the output shown below?
Respuesta
-
a. data test2; infile furnture; input StockNum $ 1-3 Finish $ 5-9 Style $ 11-18 Item $ 20-24 Price 26-31; if finish =' oak' then delete; retain TotPrice 100; totalprice + price; drop price; run; proc print data = test2 noobs; run;
-
b. data test2; infile furnture; input StockNum $ 1-3 Finish $ 5-9 Style $ 11-18 Item $ 20-24 Price 26-31; if finish =' oak' and price < 200 then delete; TotalPrice + price; run; proc print data = test2 noobs; run;
-
c. data test2( drop = price); infile furnture; input StockNum $ 1-3 Finish $ 5-9 Style $ 11-18 Item $ 20-24 Price 26-31; if finish =' oak' and price < 200 then delete; TotalPrice + price; run; proc print data = test2 noobs; run;
-
d. data test2; infile furnture; input StockNum $ 1-3 Finish $ 5-9 Style $ 11-18 Item $ 20-24 Price 26-31; if finish = oak and price < 200 then delete price; TotalPrice + price; run; proc print data = test2 noobs; run;
Pregunta 92
Pregunta
How is the variable Amount labeled and formatted in the PROC PRINT output? data credit; infile creddata; input Account $ 1-5 Name $ 7-25 Type $ 27 Transact $ 29-35 Amount 37-50; label amount =' Amount of Loan'; format amount dollar12.2; run; proc print data = credit label; label amount =' Total Amount Loaned'; format amount comma10.; run;
Respuesta
-
a. label Amount of Loan, format DOLLAR12.2
-
b. label Total Amount Loaned, format COMMA10.
-
c. label Amount, default format
-
d. The PROC PRINT step does not execute because two labels and two formats are assigned to the same variable.
Pregunta 93
Pregunta
Consider the IF-THEN statement shown below. When the statement is executed, which expression is evaluated first?
if finlexam > = 95 and (research =' A' or (project =' A' and present =' A')) then Grade =' A +';
Pregunta 94
Pregunta
Consider the small raw data file and program shown below. What is the value of Count after the fourth record is processed?
data work.newnums; infile numbers; input Tens 2-3; Count + tens; run;
Respuesta
-
a. missing
-
b. 0
-
c. 30
-
d. 70
Pregunta 95
Pregunta
Now consider the revised program below. What is the value of Count after the third observation is read?
data work.newnums; infile numbers; input Tens 2-3; retain Count 100; count + tens; run;
Respuesta
-
a. missing
-
b. 0
-
c. 100
-
d. 130
Pregunta 96
Pregunta
For the observation shown below, what is the result of the IF-THEN statements?
if status =' OK' and type = 3 then Count + 1;
if status =' S' or action =' E' then Control =' Stop';
Respuesta
-
a. Count = 12 Control = Go
-
b. Count = 13 Control = Stop
-
c. Count = 12 Control = Stop
-
d. Count = 13 Control = Go
Pregunta 97
Pregunta
Which of the following can determine the length of a new variable?
Pregunta 98
Pregunta
Which set of statements is equivalent to the code shown below?
if code =' 1' then Type =' Fixed';
if code =' 2' then Type =' Variable';
if code ^ =' 1' and code ^ =' 2' then Type =' Unknown';
Respuesta
-
a. if code =' 1' then Type =' Fixed'; else if code =' 2' then Type =' Variable'; else Type =' Unknown';
-
b. if code =' 1' then Type =' Fixed'; if code =' 2' then Type =' Variable'; else Type =' Unknown';
-
c. if code =' 1' then type =' Fixed'; else code =' 2' and type =' Variable'; else type =' Unknown';
-
d. if code =' 1' and type =' Fixed'; then code =' 2' and type =' Variable'; else type =' Unknown';
Pregunta 99
Pregunta
What is the length of the variable Type, as created in the DATA step below?
data finance.newloan; set finance.records; TotLoan + payment; if code =' 1' then Type =' Fixed'; else Type =' Variable'; length type $ 10; run;
Pregunta 100
Pregunta
Which program contains an error?
Respuesta
-
a. data clinic.stress( drop = timemin timesec); infile tests; input ID $ 1-4 Name $ 6-25 RestHR 27-29 MaxHR 31-33 RecHR 35-37 TimeMin 39-40 TimeSec 42-43 Tolerance $ 45; TotalTime =( timemin* 60) + timesec; SumSec + totaltime; run;
-
b. proc print data = clinic.stress; label totaltime =' Total Duration of Test'; format timemin 5.2; drop sumsec; run;
-
c. proc print data = clinic.stress( keep = totaltime timemin); label totaltime =' Total Duration of Test'; format timemin 5.2; run;
-
d. data clinic.stress; infile tests; input ID $ 1-4 Name $ 6-25 RestHR 27-29 MaxHR 31-33 RecHR 35-37 TimeMin 39-40 TimeSec 42-43 Tolerance $ 45; TotalTime =( timemin* 60) + timesec; keep id totaltime tolerance; run;
Pregunta 101
Pregunta
If you submit the following program, which variables appear in the new data set?
data work.cardiac( drop = age group); set clinic.fitness( keep = age weight group); if group = 2 and age > 40; run;
Respuesta
-
a. none
-
b. Weight
-
c. Age, Group
-
d. Age, Weight, Group
Pregunta 102
Pregunta
Which of the following programs correctly reads the data set Orders and creates the data set FastOrdr?
Respuesta
-
a. data catalog.fastordr( drop = ordrtime); set july.orders( keep = product units price); if ordrtime < 4; Total = units* price; run;
-
b. data catalog.orders( drop = ordrtime); set july.fastordr( keep = product units price); if ordrtime < 4; Total = units* price; run;
-
c. data catalog.fastordr( drop = ordrtime); set july.orders( keep = product units price ordrtime); if ordrtime < 4; Total = units* price; run;
-
d. None of the above
Pregunta 103
Pregunta
Which of the following statements is false about BY-group processing?
When you use the BY statement with the SET statement:
Respuesta
-
a. The data sets listed in the SET statement must be indexed or sorted by the values of the BY variable( s).
-
b. The DATA step automatically creates two variables, FIRST. and LAST., for each variable in the BY statement.
-
c. FIRST. and LAST. identify the first and last observation in each BY group, respectively.
-
d. FIRST. and LAST. are stored in the data set.
Pregunta 104
Pregunta
There are 500 observations in the data set Usa. What is the result of submitting the following program?
data work.getobs5; obsnum = 5; set company.usa( keep = manager payroll) point = obsnum; stop; run;
Pregunta 105
Pregunta
There is no end-of-file condition when you use direct access to read data, so how can your program prevent a continuous loop?
Respuesta
-
a. Do not use a POINT = variable.
-
b. Check for an invalid value of the POINT = variable.
-
c. Do not use an END = variable.
-
d. Include an OUTPUT statement.
Pregunta 106
Pregunta
Assuming that the data set Company.USA has five or more observations, what is the result of submitting the following program?
data work.getobs5; obsnum = 5; set company.usa( keep = manager payroll) point = obsnum; output; stop; run;
Pregunta 107
Pregunta
Which of the following statements is true regarding direct access of data sets?
Respuesta
-
a. You cannot specify END = with POINT =.
-
b. You cannot specify OUTPUT with POINT =.
-
c. You cannot specify STOP with END =.
-
d. You cannot specify FIRST. with LAST.
Pregunta 108
Pregunta
What is the result of submitting the following program?
data work.addtoend;
set clinic.stress2 end = last;
if last;
run;
Pregunta 109
Pregunta
At the start of DATA step processing, during the compilation phase, variables are created in the program data vector (PDV), and observations are set to:
Pregunta 110
Pregunta
The DATA step executes:
Respuesta
-
a. continuously if you use the POINT = option and the STOP statement.
-
b. once for each variable in the output data set.
-
c. once for each observation in the input data set.
-
d. until it encounters an OUTPUT statement.