ST445 Exam 1 prep

Ace your homework & exams now with Quizwiz!

Which of the following task is not part of the execution phase in a DATA step? Select one: a. Initialize Program Data Vector b. Create Input Buffer c. Create content portion d. Finalize descriptor portion

b

Which of the followings is false about the PUTLOG statement? Select one: a. Using the _ALL_ keyword in the PUTLOG statement prints out every variable from the PDV, including the automatic variables _N_ and _ERROR_. b. In the PUTLOG statement, a variable name not followed by the equal sign prints out only the variable name and not the value of the variable. c. In the PUTLOG statement, a variable name followed by the equal sign prints out both the value of the variable and the variable name. d. The PUTLOG statement writes the requested information to the log immediately.

b

Which one of the following statements is true? Select one: a. During a DATA step, _ERROR_ is always initialized to 1 and tracks the number of syntax errors. b. In a DATA step, _N_ is initialized to 1 and tracks the number of iterations of the DATA step. c. During a DATA step, _ERROR_ is always initialized to 1 and tracks the number of non-syntax errors. d. In a DATA step, _N_ is initialized to 1 and tracks the number of observations in your data set.

b

Which one of the following statements is true? Select one: a. Syntax errors always prevent the current step from executing. b. User-created variables are added to the PDV in the order of appearance in the DATA step c. Syntax errors are detected during the execution phase d. The IB and PDV are created during the execution phase.

b

Which of the following is not a difference between the $w and $CHAR informats? Select one: a. $w turns a single period into a missing value while $CHAR does not b. $w does trims trailing spaces while $CHAR does not. c. $w trims leading spaces while $CHAR does not. d. There are no differences - these are aliases for the same informatting process.

b

A furniture store has a data set regarding its sales for the month of August. The data set has the following variables: FurnitureType, Item, ItemCode, UnitsSold, UnitPrice. Which is the proper BY statement to sort the data by FurnitureType, UnitsSold in descending order, and UnitPrice in descending order? Select one: a. by FurnitureType descending UnitsSold descending UnitPrice; b. by FurnitureType descending UnitsSold UnitPrice; c. by FurnitureType UnitsSold UnitPrice descending; d. by FurnitureType UnitsSold descending UnitPrice descending;

a

How is the input buffer affected by changing the delimiter from spaces to tabs? Select one: a. It is not affected. b. The input buffer will have tabs in it everywhere there used to be spaces. c. The input buffer will replace all the spaces that were delimiters with tabs and other spaces are unaffected. d. Not enough information - we need to know if DSD was used.

a

Suppose the data set we want to read is in the following form: Note that the ruler provided is not in the text file but only for your convenience. If we would like to read the data set so that it is stored in SAS in the following way, which INPUT statement should we use? Select one: a. input Name $6.+1 Telephone $8. @21 Number 4.2+1 State $quote4.@31 Date mmddyy10.; b. input Name $6.+1 Telephone $8. +5 Number 4.+1 State $quote4.+1 Date mmddyy10.; c. input Name $6.+1 Telephone $8. +5 Number 4.2+1 State $quote4.@31 Date date9.; d. input Name $6.+1 Telephone $8. +1 Number 4.2+1 State $4.+1 Date mmddyy10.;

a

What is not an example of a GPP? Select one: a. Condensing code into as few lines as possible b. Indenting statements c. Commenting on chunks of code to explain their purpose d. Ending each PROC/DATA step with an explicit step boundary

a

Which of the following correctly outputs the lower quartile, 85th percentile, and 99% confidence interval for the mean for the variables Wage and Expenses in the data set Family? Select one: a.proc means data=Family q1 p85 clm alpha=0.01;var Wage Expenses;run; b. proc means data=Family q1 p85 clm alpha=0.99;var Wage Expenses;run; c. proc means data=Family;var Wage Expenses q1 p85 clm alpha=0.99;run; d. proc means data=Family;var Wage Expenses q1 p85 clm alpha=0.01;run;

a

Which one of the following statements is true? Select one: a. Character variables in the LENGTH statement must be accompanied by a dollar sign. b. Numeric variables cannot appear in a LENGTH statement. c. The default length for character variables is 8 and the default length for numeric variables is 16. d. The LENGTH statement must precede the INPUT statement.

a

Which of the following successfully defines a custom format? Select one: a. proc format library=sasuser;value NewFormat;0='Unknown';1-2='Urban';3-4='Rural';other='Unknown';run; b. proc format library=sasuser;value NewFormat0='Unknown'1-2='Urban'3-4='Rural'other='Unknown';run; c. proc format library=sasuser;value NewFormat20='Unknown'1-2='Urban'3-4='Rural'other='Unknown';run; d. proc format library=sasuser;value NewFormat$'0'='Unknown''1'-'2'='Urban''3'-'4'='Rural'other='Unknown';run;

b

----+----1----+----2----+----3 439 JACQUELINE 12/11/19 LAX 921 LUIS 08/01/19 DFW 114 JACK 03/15/19 LAX Suppose the space-delimited raw input data, shown above with the usual ruler, is used with the following INPUT statement.INPUT FlightNum $ FirstName $ Date $ Destination $;What would be the first record of the data set? Select one: a.FlightNum="439"FirstName="JACQUELINE" Date="12/11/19" Destination="LAX" b. FlightNum="439"FirstName="JACQUELI" Date="12/11/19" Destination="LAX" c. FlightNum="439 JACQUE" FirstName="LI 12/11" Date="/19 LAX"Destination="" d.FlightNum="439"FirstName="JACQUELI" Date="NE" Destination="12/11/19"

b

Data temp; INFILE "S:\test.txt"; INPUT Year Month Day Weather $; RUN; How many variables are in the PDV? Select one: a. 5 b. 6 c. 7 d. 4

b

When can you read in variables in an order different from the column order in the raw data file? Select one: a. When you add $ after the variables. b. When you use column input with fixed position data. c. When you used the DSD option. d. When the data is tab-delimited.

b

In which of the following cases can you apply a format to the frequency statistic in PROC FREQ? Select one: a. One-way table only b. Two-way table only c. Any cross-tabular frequency table d. None of the above

c

Suppose a data set is sorted via PROC SORT using the following BY statement. BY state DESCENDING cylinders price; If a PROC PRINT follows this PROC SORT, which of the answer choices contains a BY statement that is valid for use in the PROC PRINT? Select one: a. by state cylinders; b.by descending state; c. by state descending cylinders; d. by state cylinders price;

c

The data set TempChange is stored in a comma-delimited text file and is shown below: Phoenix,3,"yes,19",urban,N/A Chandler,,"no,0",urban,N/A Phoenix,12,"yes,12",urban,N/A Rimrock,,"yes,20",urban,N/A Goodyear,-2,"no,-12",urban,N/A Phoenix,-1,"no,-2",urban,N/A The SAS code to read this data set is below: data MyTemps;length city $ 9 temp_increase $ 8;infile RawData("TempChange.txt") dsd;input city $ degree tempIncrease type $ population $;run; According to the data set and code provided above, which of the following statements is true? Select one: a. There are no missing values in the SAS data set MyTemps. b. The values of TempIncrease include the quotation marks. c. Population has the value N/A for all six records. d. Replacing DSD with DLM=',' would produce the same data set, in this case.

c

To directly print out the data portion of the data set, which of the following should we use? Select one: a. PROC CONTENTS b. DATA step c. PROC PRINT d. PROC MEANS

c

What is the effect on the input buffer if you incorrectly use simple list input to read a variable when you should have used column input? Select one: a. There will be a syntax error that produces an error statement in the log. b. The input buffer will show you the delimiters when it should not. c. There is no effect. d. The input buffer will not show you the delimiters when it should.

c

When successfully comparing these files, if the first difference is found in the 1,037th observation and if you save the differences to a file using the OUT=, OUTBASE, OUTCOMPARE, OUTDIFF, and OUTNOEQUAL options, where does this difference appear in the file? Select one: a. The 1st observation. b. The 1,037th observation. c. The 1st, 2nd, and 3rd observations. d. The 1,307th, 1,308th, and 1,309th observations.

c

Which of the following correctly demonstrates use of the LIBNAME statement to create a user-defined library for the folder ST445? Select one: a.libname st445 "L:\ST445" b.libname st445 c. libname st445 "L:\ST445"; d. libnme st445 "L:\ST445";

c

Which of the following is an automatic variable in the DATA step? Select one: a. _N_ b. _ERROR_ c. Both (a) and (b) d. Neither (a) nor (b)

c

Suppose the original data is stored in the text file in the following way : Note that the ruler provided is not in the text file but only for your convenience. If we read this data using the following INPUT statement: input Name $12. +1 Telephone $8. +5 Number 3.; Which of the following statements is true? Select one: a. The variable Name in the third observation will be The Shark, with the quotation marks stripped b. The INPUT statement could have used modified list input instead of formatted input and obtained exactly the same data set as long as the default delimiter (space) was used. c. The value of Number in the last observation is "071" d. The variable Telephone in the first observation will be 9287**72

d

Which of the following ODS statements contains a syntax error? Select one: a. ODS RTF file="my_report.pdf"; b. ODS RTF file="myreport.rtf" c. ODS HTML file="myreport.html"; d. ODS HTML file=my_report.html;

d

Which of the following statements is always true? Select one: a. Misspelling a keyword, say "PRCO" in a PROC PRINT step, will result in error messages and the procedure won't be executed successfully b. A PROC step can be nested inside another PROC step c. Each statement in a DATA step will compile and take effect individually and immediately d. Invoking PROC MEANS can act as a step boundary for a DATA step

d

Which of the followings are NOT correct for reading in a file? Select one: a. DATA Profile;INFILE "S:\Documents\Profile.txt";INPUT AGE SALARY YEAR;RUN; b. FILENAME PROFILE1 "S:\Documents\Profile.txt";DATA Profile;INFILE PROFILE1;INPUT AGE SALARY YEAR;RUN; c.FILENAME DFOLDER "S:\Documents\";DATA Profile;INFILE DFOLDER("Profile.txt");INPUT AGE SALARY YEAR;RUN; d. DATA Profile;INFILE "S:\Documents\";INPUT AGE SALARY YEAR;RUN;

d

Which of the followings is not a valid WHERE statement? Select one: a. WHERE X BETWEEN 10 AND 20; b. WHERE X IN ("NC", "NY", "AL"); c. WHERE X GE 20 OR X<10; d. WHERE X+Y;

d


Related study sets

Chapters 8,9, and 10 multiple choice

View Set

Experimental Psychology Final Exam Review

View Set

MKT 111 Chapter 12 (Multiple Choice/TF only)

View Set

(Complete) Chapter 13: Local markets, poverty, and Income Distribution

View Set