201. The following program is submitted.
data test;
input name $ age;
cards;
John +35
;run;
Which values are stored in the output data set?
A. name age
John 35
B. name age
John (missing value)
C. name age
(missing value) (missing value)
D. The DATA step fails execution due to data errors.
202.The following observation is stored in a SAS data set named EMPLOYEES:
LNAME FNAME JOBCODE
----------------------------------------------------------------------
Whitley Sam na1
If the DATA step below is executed, what will be the value of the variable JOBDESC in the output SAS data
set when this observation is processed:
data navigate;
set employees;
if jobcode = 'NA1' then jobdesc = 'Navigator';
run;
A. navigator
B. Navigator
C. NAVIGATOR
D. a missing value
203.The following SAS program is submitted: set employees;
if jobcode = 'NA1' then jobdesc = 'Navigator';
run;
A. navigator
B. Navigator
C. NAVIGATOR
D. a missing value
proc format;
value score 1 - 50 = 'Fail'
51 - 100 = 'Pass';
run;
Which one of the following PRINT procedure steps correctly applies the format?
A. proc print data = sasuser.class;
var test;
format test score;
run;
B. proc print data = sasuser.class;
var test;
format test score.;
run;
var test;
format test score;
run;
B. proc print data = sasuser.class;
var test;
format test score.;
run;
C. proc print data = sasuser.class format = score;
var test;
run;
D. proc print data = sasuser.class format = score.;
var test;
run;
204 Given the following DATA step: var test;
run;
D. proc print data = sasuser.class format = score.;
var test;
run;
data loop;
x = 0;
do index = 1 to 5 by 2;
x = index ;
end;
run;
Upon completion of execution, what are the values of the variables X and INDEX in the SAS data set named
LOOP ?
A. x = 3, index = 3
B. x = 3, index = 4
C. x = 5, index = 5
D. x = 5, index = 6
E. x = 5, index = 7
205 Given that the data set named ONE contains 10 observations and the data set named TWO contains 10 A. x = 3, index = 3
B. x = 3, index = 4
C. x = 5, index = 5
D. x = 5, index = 6
E. x = 5, index = 7
observations, how many observations will be contained in the data set named COMBINE that is created in
the following DATA step?
data combine;
set one two;
run;
A. 10
B. 20
C. 0, the DATA step will fail due to syntax errors
D. 10 to 20, depending on how many observations match
206. A format statement should be specified before the CARDS statement when we read internal raw data.
a. True
b. False
207. An external file with a maximum record length of 225 is read into SAS in a DATA step. Select all statements that reads the data correctly.
a. INFILE ‘C:\mydata.dat’ LRECL=2000;
b. INFILE ‘C:\mydata.dat’ LRECL=225;
c. INFILE ‘C:\mydata.dat’ ;
208. Select the False statement about List Input method of reading data
a. Reads data separated by several spaces.
b. Does not skip over unwanted values in the input data.
c. Reads a date.
209. Column Input style can read a character data value with space embedding
a. True
b. False
210. A standard numeric data in SAS can contain a ‘-‘ (negative) sign and ‘E’ for scientific notations
a. True
b. False
211. A non standard data (Numbers with comma, dates like ’03-OCT-2005’ ) can be read with the following INPUT styles (select all correct answers)
a. Formatted Input
b. Modified List Input
c. Using Informats in INPUT statement
212. Given the line of raw data:
112233 SCODES Z M N
And the data statement:
INPUT @'SCODES' statuscodes :$10.;
When executed in a DATA step correctly, what value the variable ‘Statuscodes’ gets?
a. Z
b. Z M N
c. . (Missing)
213. The following statement is submitted:
Data Test;
INPUT accnum $ / fname $ lname $ ;
cards;
12223242 Johny Smith
Peter Smith Thomas Joseph
;run;
The output dataset will show which of the following?
a. accnum fname lname
12223242 Johny Smith
b. accnum fname lname
12223242 Peter Smith
c. None of the above
214. The following statement is submitted:
Data Test;
INPUT accnum $ #2 fname $ lname $ ;
cards;
12223242 Johny Smith
Peter Smith Thomas Joseph
;run;
The output dataset will show which of the following?
a. accnum fname lname
12223242 Johny Smith
b. accnum fname lname
12223242 Peter Smith
c. None of the above
215. The following INPUT statements are submitted:
Data Test;
INPUT accnum $ fname $ lname $ @@ ;
cards;
122232 Johny Smith 132343 Peter Smith 142434 Thomas Joseph;
run;
Which of the following statement is correct?
a. Output record set will have only one record
b. Output record set will have 3 records
c. Data step incomplete due to incorrect syntax
216. Datafile ‘c:\mydata.dat’ contains account number, first name and last name of account holders with following structure.
122232 Johny Smith
142434 Thomas
152535 Dan Paul
Which statement below reads the data correctly into SAS.
a. Data Test;
INFILE 'c:\mydata.dat' MISSOVER;
INPUT accnum $ 1-6 fname $ 8-14 lname $ 16-20;
run;
b. Data Test;
INFILE 'c:\mydata.dat' TRUNCOVER;
INPUT accnum $ 1-6 fname $ 8-14 lname $ 16-20;
run;
c. Data Test;
INFILE 'c:\mydata.dat' ;
INPUT accnum $ fname $ lname $;
run;
217. The following statement is submitted
Data Test;
INFILE 'c:\mydata.dat’;
INPUT client_id $ 1-3 @;
IF client_id 'JCP' then delete;
INPUT accnum $ 4-8 fname $ 9-14 lname $ 16-20;
run;
How many columns will be there in dataset ‘Test’ ?
a. None
b. 3
c. 4
218. An external data file has account open date in the following format .
01-13-95
01-14-96
01-15-97
Which of the following is a correct INPUT statement in DATA step to read this data.
a. INPUT Account_no mmddyy8. ;
b. INPUT Account_no mmddyy6. ;
c. INPUT Account_no ddmmyy8. ;
219. The following statements are submitted
Data Test;
today = '20dec2005'd;
format today mmddyy10.;
run;
Which of the following statement is true ?
a. ‘Today’ variable displays like ‘12/20/2005’
b. Data step not executed due to wrong format ‘mmddyy’.
c. Today is displayed as ‘20DEC2005’
220. Following statements are submitted:
proc export data = Account_perf outfile = 'd:\text1.csv';
run;
proc export data = Account_perf outfile = 'd:\text2.csv'
DBMS =DLM REPLACE;
DELIMITER =',';
run;
Select all false statements:
a. There are two files , text1.csv and text2.csv , created in d:\
b. Both text1 and text2 files have the same data values delimited by a comma
c. Text1 data file will have a space-delimited data as a standard SAS output.
d. Only text2.csv is created with values delimited by a comma.
Note: the programs in the example e expects no errors due to improper use of ;, ‘’, ) etc.
221. File C:\mydata.dat contains 100 complete records and the following program is submitted.
options obs=10;
Data Test;
INFILE 'c:\mydata.dat' firstobs=3;
INPUT accnum $ fname $ lname $;
run;
Which of the following statement is correct?
a. Test data set will have 98 rows
b. Test dataset will have first 10 observations
c. Test dataset will have 10 observations read starting from third data line in mydata.dat
d. Test dataset will have 8 observations read starting from third data line in mydata.dat
222. The following program is submitted to read a delimited file
Data Test;
INFILE 'c:\mydata.dat' DLM='$' DSD ;
INPUT accnum $ fname $ lname $;
run;
What ‘DSD’ keyword does here? (Select all correct answers)
a. It does not treat ‘$’ character as part of the data value and treat it as delimiter.
b. It recognize two consecutive ‘$’ characters as a missing value for the variable read
c. If data value is specified in quotes with embedded ‘$’ character DSD option treats it as part of the data.
223. A PROC DATATSETS is used as follows(assumption: all libraries are and datasets are existing):
proc datasets library=mylib details;
copy out=rloc;
select scoredata;
delete tension ;
run;
Which statement below explains the operations above most correctly?
a. It lists all SAS data files with file size and date modified in ‘mylib’ library and makes a copy of ‘scoredata’ file in ‘rloc’ library and deletes ‘tension’ dataset..
b. It lists all SAS data files with file size and date modified in ‘mylib’ library and deletes ‘tension’ file from ‘rloc’ library.
c. It lists all SAS data files with file size and date modified in ‘mylib’ library and makes a copy of ‘scoredata’ file in ‘rloc’ library and also copies the ‘scoredata’ file in ‘rloc’ library.
d. It lists all sas data files with file size and date modified in ‘mylib’ library and makes a copy of ‘scoredata’ file in ‘rloc’ library.
224. The following program is submitted. Which is a false statement about the output of this program?
proc contents data=scoredata;
run;
a. Prints # of observations in ‘scoredata’
b. Prints a snapshot of the data into the screen.
c. Prints the date ‘scoredata’ was created
d. Lists all labels associated with variables in ‘scoredata’
225. The following line of code is used in a SAS data step .
Data xx;
Set yy;
attrib status_codes length=$4 label ='Status Codes' format =$upcase8.;
run;
If yy has a variable names status_codes and the user wants the attributes to be changed in xx . Will this statement change the length, label and format in xx dataset?
a. YES
b. NO
c. No Sufficient Information
226. The below three program blocks are submitted
A) Data target_data ;
Set base_data((keep = var1 var2 var3 );
Run;
B) Data target_data ;
Set base_data;
keep = var1 var2 var3 ;
Run;
C) Data target_data (keep = var1 var2 var3 );
Set base_data;
Run;
If the user needs only var1, var2 and var3 to work with, which step is most efficient?
a. A
b. B
c. C
d. A&B
e. None
227. The following program is submitted (Assumption is os_dollars is an existing dataset with client groups (client_group) and dollar outstanding (os) fields. ) .
Data test;
SET os_dollars END=FIN ;
BY client_group;
t_os +os;
IF LAST.clinet_group THEN DO ;
g_os +t_os ;
t_os=0;END;run;
What this program does?
a. Computes the gross outstanding across the groups and store it in g_os variable, last row.
b. Computes the oustandings for client groups and retain them in t_os variable
c. None of the above.
228. The following program was submitted to SAS
data temp;
length my_number $ 4;
input my_number;
cards;
1234
0009
;run;
data new(drop=x);
set temp(rename=(my_number=x));
my_number=input(x,best4.);run;
proc print data=new;run;
What’s the output would be?
A) Obs my_number
1 1234
2 9
B) Obs my_number
1 1234
2 0009
C) Obs my_number
. .
229. The following program is submitted:
x='20jan94'd;
y=qtr(x);
put y=;
What value would be printed to the SAS log?
a. 1
b. 2
c. 3
d. None
230. The following program submitted:
data xx;
date1=122591;
date2=put(date1,z6.);run;
What’s the data type of date1 and date 2 ?
a. Date1 Character, Date 2 Numeric
b. Date1 numeric, Date 2 character
c. Syntax error, not executed
231. The following statement forms a part of SAS dataset (no syntax errors)
Data xx;
Set yy;
array weight wt1-wt50;
do i=1 to 50;
if weight{i}=999 then weight{i}=’missing’;
end;
run;
Select all correct statements below:
a. Creates a variable weight and assigns w1-wt50 (wt1, wt2, wt3 etc)
b. Variables named wt1-wt50 exist in the’ yy’ data set.
c. If any of the fields in wt1-wt50 have a value of ‘999’ then it will be reset with a ‘missing’ .
d. Evaluated all 50 fields and the entire table looking for value ‘999’ in any of the fields
232. The following program is submitted:
proc report data =xx nowindows headline headskip ;
Title 'Summary across groups’;
column s_g N (os co), MEAN ;
define s_g /group;
run;
What’s the objective of using MEAN?
a. Compute mean (Average) of variables OS and CO
b. Compute mean and N(count) of s_g and MEAN of OS and CO
c. Compute mean and N(count) of s_g and MEAN of OS and CO by s_g groups.
How many observations and variables does the data set below contain?
a. 3 observations, 4 variables b. 3 observations, 3 variables c. 4 observations, 3 variables d. can't tell because some values are missing | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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; a. three b. four c. five d. six | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
What type of variable is the variable AcctNum in the data set below?
a. numeric b. character c. can be either character or numeric d. can't tell from the data shown | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
What type of variable is the variable Wear in the data set below?
A. numeric B. character C. can be either character or numeric D. can't tell from the data shown | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which of the following variable names is valid? a. 4BirthDate b. $Cost c. _Items_ d. Tax-Rate | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which of the following files is a permanent SAS file? a. Sashelp.PrdSale b. Sasuser.MySales c. Profits.Quarter1 d. all of the above | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
In a DATA step, how can you reference a temporary SAS data set named Forecast? a. Forecast b. Work.Forecast c. Sales.Forecast (after assigning the libref Sales) d. only a and b above | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
What is the default length for the numeric variable Balance?
a. 5 b. 6 c. 7 d. 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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; a. three b. four c. five d. six | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
What is a SAS data library? a. a collection of SAS files, such as SAS data sets and catalogs b. in some operating environments, a physical collection of SAS files c. in some operating environments, a logically related collection of SAS files d. all of the above | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
243. | 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; a. The PROC MEANS output has a print line width of 80 characters, but the PROC TABULATE output has no print line width. b. The PROC TABULATE output has no page numbers, but the PROC MEANS output has page numbers. c. 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. d. The date does not appear on output from either PROC step. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
In order for the date values 05May1955 and 04Mar2046 to be read correctly, what value must the YEARCUTOFF= option have? a. a value between 1947 and 1954, inclusive b. 1955 or higher c. 1946 or higher d. any value | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
When you specify an engine for a library, you are always specifying a. the file format for files that are stored in the library. b. the version of SAS that you are using. c. access to other software vendors' files. d. instructions for creating temporary SAS files. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which statement prints a summary of all the files stored in the library named Area51? a. proc contents data=area51._all_ nods; b. proc contents data=area51 _all_ nods; c. proc contents data=area51 _all_ noobs; d. proc contents data=area51 _all_.nods; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The following PROC PRINT output was created immediately after PROC TABULATE output. Which SAS system options were specified when the report was created? 1 10:03 Friday, March 17, 2000 Act Obs ID Height Weight Level Fee 1 2458 72 168 HIGH 85.20 2 2462 66 152 HIGH 124.80 3 2501 61 123 LOW 149.75 4 2523 63 137 MOD 149.75 5 2539 71 158 LOW 124.80 6 2544 76 193 HIGH 124.80 7 2552 67 151 MOD 149.75 8 2555 70 173 MOD 149.75 9 2563 73 154 LOW 124.80 a. OBS=, DATE, and NONUMBER b. PAGENO=1 and DATE c. NUMBER and DATE only d. none of the above | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which of the following programs correctly references a SAS data set named SalesAnalysis that is stored in a permanent SAS library? a. data saleslibrary.salesanalysis; b. set mydata.quarter1sales; c. if sales>100000; d. run; e. data mysales.totals; f. set sales_99.salesanalysis; g. if totalsales>50000; h. run; i. proc print data=salesanalysis.quarter1; j. var sales salesrep month; k. run; l. proc freq data=1999data.salesanalysis; m. tables quarter*sales; n. run; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which time span is used to interpret two-digit year values if the YEARCUTOFF= option is set to 1950? a. 1950-2049 b. 1950-2050 c. 1949-2050 d. 1950-2000 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Assuming you are using SAS code and not special SAS windows, which one of the following statements is false? a. LIBNAME statements can be stored with a SAS program to reference the SAS library automatically when you submit the program. b. 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. c. Librefs can last from one SAS session to another. d. You can access files that were created with other vendors' software by submitting a LIBNAME statement. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
What does the following statement do? libname osiris spss 'c:\myfiles\sasdata\data'; a. defines a library called Spss using the OSIRIS engine b. defines a library called Osiris using the SPSS engine c. defines two libraries called Osiris and Spss using the default engine d. defines the default library using the OSIRIS and SPSS engines | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
What does the following OPTIONS statement do? options pagesize=15 nodate; a. suppresses the date and limits the page size of the log b. suppresses the date and limits the vertical page size for text output c. suppresses the date and limits the vertical page size for text and HTML output d. suppresses the date and limits the horizontal page size for text output | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
As you write and edit SAS programs, it’s a good idea to a. begin DATA and PROC steps in column one. b. indent statements within a step. c. begin RUN statements in column one. d. all of the above. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
What usually happens when a syntax error is detected? a. SAS continues processing the step. b. SAS continues to process the step, and the SAS log displays messages about the error. c. SAS stops processing the step in which the error occurred, and the SAS log displays messages about the error. d. SAS stops processing the step in which the error occurred, and the Output window displays messages about the error. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A syntax error occurs when a. some data values are not appropriate for the SAS statements that are specified in a program. b. the form of the elements in a SAS statement is correct, but the elements are not valid for that usage. c. program statements do not conform to the rules of the SAS language. d. none of the above. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
How can you tell whether you have specified an invalid option in a SAS program? a. A log message indicates an error in a statement that seems to be valid. b. A log message indicates that an option is not valid or not recognized. c. The message "PROC running" or "DATA step running" appears at the top of the active window. d. You can't tell until you view the output from the program. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which of the following programs contain a syntax error? a. proc sort data=sasuser.mysales; b. by region; c. run; d. dat sasuser.mysales; e. set mydata.sales99; f. run; g. proc print data=sasuser.mysales label; h. label region='Sales Region'; i. run; j. none of the above. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
What does the following log indicate about your program?
proc print data=sasuser.cargo99 var origin dest cargorev; 22 76 ERROR 22-322: Syntax error, expecting one of the following: ;, (, DATA, DOUBLE, HEADING, LABEL, N, NOOBS, OBS, ROUND, ROWS, UNIFORM, WIDTH. ERROR 76-322: Syntax error, statement will be ignored. 11 run;
a. SAS identifies a syntax error at the position of the VAR statement. b. SAS is reading VAR as an option in the PROC PRINT statement. c. SAS has stopped processing the program because of errors. d. all of the above | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which PROC PRINT step below creates the following output?
a. roc print data=flights.laguardia noobs; b. var on changed flight; c. where on>=160; d. run; e. proc print data=flights.laguardia; f. var date on changed flight; g. where changed>3; h. run; i. proc print data=flights.laguardia label; j. id date; k. var boarded transferred flight; l. label boarded='On' transferred='Changed'; m. where flight='219'; n. run; o. proc print flights.laguardia noobs; p. id date; q. var date on changed flight; r. where flight='219'; s. run; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which of the following PROC PRINT steps is correct if labels are not stored with the data set? a. proc print data=allsales.totals label; b. label region8='Region 8 Yearly Totals'; c. run; d. proc print data=allsales.totals; label region8='Region 8 Yearly Totals'; e. run; f. proc print data allsales.totals label noobs; g. run; h. proc print allsales.totals label; i. run; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which of the following statements selects from a data set only those observations for which the value of the variable Style is RANCH, a. where style='RANCH' or 'SPLIT' or 'TWOSTORY'; b. where style in 'RANCH' or 'SPLIT' or 'TWOSTORY'; c. where style in (RANCH, d. where style in ('RANCH',' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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? a. proc sort data=work.calc out=finance.dividend; b. run; c. proc sort dividend out=calc; d. by account; e. run; f. proc sort data=finance.dividend out=work.calc; g. by account; h. run; i. proc sort from finance.dividend to calc; j. by account; k. run; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which options are used to create the following PROC PRINT output?
13:27 Monday, March 22, 1999 Patient Arterial Heart Cardiac Urinary 203 88 95 66 110 54 83 183 95 0 664 72 111 332 12 210 74 97 369 0 101 80 130 291 0
a. the DATE system option and the LABEL option in PROC PRINT b. the DATE and NONUMBER system options and the DOUBLE and NOOBS options in PROC PRINT c. the DATE and NONUMBER system options and the DOUBLE option in PROC PRINT d. the DATE and NONUMBER system options and the NOOBS option in PROC PRINT | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which of the following statements can you use in a PROC PRINT step to create this output?
a. var month instructors; b. sum instructors aerclass walkjogrun swim; c. var month; d. sum instructors aerclass walkjogrun swim; e. var month instructors aerclass; f. sum instructors aerclass walkjogrun swim; g. all of the above | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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; a. The PROC PRINT step runs successfully, printing observations in their sorted order. b. The PROC SORT step permanently sorts the input data set. c. The PROC SORT step generates errors and stops processing, but the PROC PRINT step runs successfully, printing observations in their original (unsorted) order. d. The PROC SORT step runs successfully, but the PROC PRINT step generates errors and stops processing. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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; a.
b.
c.
d.
e. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. a. where amount <= 5000 and b. account='101-1092' or rate = 0.095; c. where (amount le 5000 and account='101-1092') d. or rate = 0.095; e. where amount <= 5000 and f. (account='101-1092' or rate eq 0.095); g. where amount <= 5000 or account='101-1092' h. and rate = 0.095; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
What does PROC PRINT display by default? a. PROC PRINT does not create a default report; you must specify the rows and columns to be displayed. b. PROC PRINT displays all observations and variables in the data set. If you want an additional column for observation numbers, you can request it. c. PROC PRINT displays columns in the following order: a column for observation numbers, all character variables, and all numeric variables. d. 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. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which SAS statement associates the fileref Crime with the raw data file C:\States\Data\Crime? a. filename crime 'c:\states\data\crime'; b. filename crime c:\states\data\crime; c. fileref crime 'c:\states\data\crime'; d. filename 'c:\states\data\crime' crime; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Filerefs remain in effect until a. you change them. b. you cancel them. c. you end your SAS session. d. all of the above | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which statement identifies the name of a raw data file to be read with the fileref Products and specifies that the DATA step read only records 1–15? a. infile products obs 15; b. infile products obs=15; c. input products obs=15; d. input products 1-15; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which of the following programs correctly writes the observations from the data set below to a raw data file?
a. data _null_; b. set work.patients; c. infile 'c:\clinic\patients\referrals.dat'; d. input id 1-4 sex 6 age 8-9 height 11-12 e. weight 14-16 pulse 18-20; f. run; g. h. data referrals.dat; i. set work.patients; j. input id 1-4 sex 6 age 8-9 height 11-12 k. weight 14-16 pulse 18-20; l. run; m. n. data _null_; o. set work.patients; p. file c:\clinic\patients\referrals.dat; q. put id 1-4 sex 6 age 8-9 height 11-12 r. weight 14-16 pulse 18-20; s. run; t. u. data _null_; v. set work.patients; w. file 'c:\clinic\patients\referrals.dat'; x. put id 1-4 sex 6 age 8-9 height 11-12 y. weight 14-16 pulse 18-20; z. run; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which raw data file can be read using column input? a. ![]() b. ![]() c. ![]() d. all of the above | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which program creates the output shown below? ![]()
a. data work.salesrep; b. infile empdata; c. input ID $ 1-4 LastName $ 6-12 d. FirstName $ 14-18 City $ 20-29; e. run; f. proc print data=work.salesrep; g. run; h. data work.salesrep; i. infile empdata; j. input ID $ 1-4 Name $ 6-12 k. FirstName $ 14-18 City $ 20-29; l. run; m. proc print data=work.salesrep; n. run; o. data work.salesrep; p. infile empdata; q. input ID $ 1-4 name1 $ 6-12 r. name2 $ 14-18 City $ 20-29; s. run; t. proc print data=work.salesrep; u. run; v. all of the above | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which statement correctly reads the fields in the following order: StockNumber, Price, Item, Finish, Style? Field Name Start Column End Column Data Type StockNumber 1 3 character Finish 5 9 character Style 11 18 character Item 20 24 character Price 27 32 numeric ![]() a. input StockNumber $ 1-3 Finish $ 5-9 Style $ 11-18 b. Item $ 20-24 Price 27-32; c. input StockNumber $ 1-3 Price 27-32 d. Item $ 20-24 Finish $ 5-9 Style $ 11-18; e. input $ StockNumber 1-3 Price 27-32 f. $ Item 20-24 $ Finish 5-9 $ Style 11-18; g. input StockNumber $ 1-3 Price $ 27-32 h. Item $ 20-24 Finish $ 5-9 Style $ 11-18; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which statement correctly re-defines the values of the variable Income as 100 percent higher? a. income=income*1.00; b. income=income+(income*2.00); c. income=income*2; d. income= *2; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which program correctly reads instream data? a. data finance.newloan; b. input datalines; c. if country=' d. MonthAvg=amount/12; e. 1998 f. 1998 g. 1998 h. 1998 i. 1998 j. 1998 k. 1998 JAPAN CARS 15066.43 l. 1998 m. ; n. data finance.newloan; o. input Year 1-4 Country $ 6-11 p. Vehicle $ 13-18 Amount 20-28; q. if country=' r. MonthAvg=amount/12; s. datalines; t. run; u. data finance.newloan; v. input Year 1-4 Country 6-11 w. Vehicle 13-18 Amount 20-28; x. if country=' y. MonthAvg=amount/12; z. datalines; aa. 1998 bb. 1998 cc. 1998 dd. 1998 ee. 1998 ff. 1998 gg. 1998 JAPAN CARS 15066.43 hh. 1998 ii. ; jj. data finance.newloan; kk. input Year 1-4 Country $ 6-11 ll. Vehicle $ 13-18 Amount 20-28; mm. if country=' nn. MonthAvg=amount/12; oo. datalines; pp. 1998 qq. 1998 rr. 1998 ss. 1998 tt. 1998 uu. 1998 vv. 1998 JAPAN CARS 15066.43 ww.1998 xx. ; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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? ![]() a. if sex=f; b. if sex=F; c. if sex='F'; d. a or b | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which of the following is not created during the compilation phase? a. the data set descriptor b. the first observation c. the program data vector d. the _N_ and _ERROR_ automatic variables | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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? a. incorrect values and formats b. invalid options or variable names c. missing or invalid punctuation d. missing or misspelled keywords | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Unless otherwise directed, the DATA step executes 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. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 a. 0 b. 1 c. undefined d. missing | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Suppose you run a program that causes three DATA step errors. What is the value of the automatic variable _ERROR_ when the observation that contains the third error is processed? a. 0 b. 1 c. 2 d. 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which of the following actions occurs at the end of the DATA step? 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. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Look carefully at the DATA step shown below. Based on the INPUT statement, in what order will the variables be stored in the new data set? data perm.update; infile invent; input IDnum $ 15-19 Item $ 1-13 Instock 21-22 BackOrd 24-25; Total=instock+backord; run; a. IDnum Item InStock BackOrd Total b. Item IDnum InStock BackOrd Total c. Total IDnum Item InStock BackOrd d. Total Item IDnum InStock BackOrd | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If SAS cannot interpret syntax errors, then 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. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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; a. missing semicolon on second line b. missing semicolon on third line c. incorrect order of variables d. incorrect variable type | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Look carefully at this section of a SAS session log. Based on the note, what was the most likely problem with the DATA step?
NOTE: Invalid data for IDnum in line 7 15-19. RULE: ----+----1----+----2----+----3----+----4 7 Bird Feeder LG088 3 20 Item=Bird Feeder IDnum=. InStock=3 BackOrd=20 Total=23 _ERROR_=1 _N_=1
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. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If you don't specify the LIBRARY= option, your formats are stored in Work.Formats, and they exist 1. only for the current procedure. 2. only for the current DATA step. 3. only for the current SAS session. 4. permanently. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
290. | Which of the following statements will store your formats in a permanent catalog? 1. libname library 'c:\sas\formats\lib';proc format lib=library ...; 2. libname library 'c:\sas\formats\lib';format lib=library ...; 3. library='c:\sas\formats\lib';proc format library ...; 4. library='c:\sas\formats\lib';proc library ...; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 1. cannot be the name of a data set variable. 2. must be at least two characters long. 3. must be at least eight characters long. 4. must begin with a dollar sign ($) if used with a character variable. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which of the following FORMAT procedures is written correctly? 1. proc format lib=library value colorfmt; 1='Red' 2='Green' 3='Blue' run; 2. proc format lib=library; value colorfmt 1='Red' 2='Green' 3='Blue'; run; 3. proc format lib=library; value colorfmt; 1='Red' 2='Green' 3='Blue' run; 4. proc format lib=library; value colorfmt 1='Red'; 2='Green'; 3='Blue'; run; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which of these is false? Ranges in the VALUE statement can specify 1. a single value, such as 24 or 'S'. 2. a range of numeric values, such as 0–1500. 3. a range of character values, such as 'A'–'M'. 4. a list of numeric and character values separated by commas, such as 90,'B',180,'D',270. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
How many characters can be used in a label? 1. 40 2. 96 3. 200 4. 256 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which keyword can be used to label missing values as well as any values that are not specified in a range? 1. LOW 2. MISS 3. MISSING 4. OTHER | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
You can place the FORMAT statement in either a DATA step or a PROC step. What happens when you place the FORMAT statement in a DATA step? 1. You temporarily associate the formats with variables. 2. You permanently associate the formats with variables. 3. You replace the original data with the format labels. 4. You make the formats available to other data sets. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The format JOBFMT was created in a FORMAT procedure. Which FORMAT statement will apply it to the variable JobTitle in the program output? 1. format jobtitle jobfmt; 2. format jobtitle jobfmt.; 3. format jobtitle=jobfmt; 4. format jobtitle='jobfmt'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Which keyword, when added to the PROC FORMAT statement, will display all the formats in your catalog? 1. CATALOG 2. LISTFMT 3. FMTCAT 4. FMTLIB | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If Style has four unique values and you submit the following program, which output do you get? (Assume that all the other variables are numeric.) proc report data=sasuser.houses nowd; column style sqfeet bedrooms price; define style / group; run; a.
b.
c.
d.
e. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
When you define an order variable, a. the detail rows are ordered according to their formatted values. b. you can't create summary reports. c. PROC REPORT displays only the first occurrence of each order variable value in a set of rows that have the same value for all order variables. d. all of the above |
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.