Busy. Please wait.

show password
Forgot Password?

Don't have an account?  Sign up 

Username is available taken
show password


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
We do not share your email address with others. It is only used to allow you to reset your password. For details read our Privacy Policy and Terms of Service.

Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.

Remove ads
Don't know
remaining cards
To flip the current card, click it or press the Spacebar key.  To move the current card to one of the three colored boxes, click on the box.  You may also press the UP ARROW key to move the card to the "Know" box, the DOWN ARROW key to move the card to the "Don't know" box, or the RIGHT ARROW key to move the card to the Remaining box.  You may also click on the card displayed in any of the three boxes to bring that card back to the center.

Pass complete!

"Know" box contains:
Time elapsed:
restart all cards

Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how


SAS Programming I Fundamentals: Base SAS

This page has been left blank intentionally. Select the 'shuffle' option now. No, really, click on the "shuffle" link below unless you want to review the questions in the order in which they were created.
Which option (keyword) can be used to suppress the printing of page numbers? NONUMBER
What is needed to display a summary statistics report with only two decimal places? Add the option MAXDEC = 2 to the PROC MEANS procedure statement.
Which program creates a listing of all data sets in the SASHELP library? proc contents data = sashelp._all_; run; NOT proc contents lib = sashelp._alI_; run;
What is the value of the variable RESULT in the output data set? data work.sample; fact = 'Russia is the largest country in the world'; result = substr(scan(fact,5,' ,'),1,3); run; cou
True or false. The most recently specified TITLE or FOOTNOTE statement of any number completely replaces any other TITLE or FOOTNOTE statement of that number. In addition, it cancels all TITLE or FOOTNOTE statements of a higher number. True
The value 123500 is stored in a numeric variable named PRICE. Which FORMAT statement displays the value as $123,500.00 in a report? format price dollar11.2;
What is the value of the variable SENTINEL in the output data set? data sample; state = 'Hawaii, Utah, Ohio'; sentinel = find (state, 'h'); run; 12
Assuming that the report generated by the PRINT procedure includes 3 pages of output, what is the page number on the first page of the report generated by the MEANS procedure? 4
What is the value of the variable 'result'? claim = 'A picture is worth a thousand words'; result = scan(claim,4,' ,'); worth
What is the value of the variable CNT in the output data set? data work.result; do until (cnt lt 1); cnt + 1; end; run; Undetermined, infinite loop.
True or false. 'mid2' is a different string than 'Mid2', therefore each variable gets treated separately in if-then statements and other data manipulation processes. True
True or false. The SUM statement ignores missing values. True
What statement best describes the output from the following program? proc contents data = _all_; The output contains a list of the SAS data sets contained in the WORK library and displays the contents of those data sets.
Valid variable names begin with a letter or underscore, and continue with letters, numbers, or ________________. underscores
To cancel a libref, you submit a LIBNAME statement with the _____ option. CLEAR
True or false. PROC SORT replaces the original data set unless you specify an output data set in the OUT= option. True
True or false. The DOLLARw.d format writes numeric values with a leading dollar sign, a comma that separates every three digits, and a period that separates the decimal fraction. True
True or false. A libref is used to access SAS data sets in an SAS data library. The INFILE statement references the raw data file, so you do not need to use a libref to point to it. True
True or false. The LENGTH statement must precede the INPUT statement in order to correctly set the length of the variable. True
True or false. In the most basic type of join, PROC SQL combines each row from the first table with every row from the second table. The result of joining tables in this way is called the ____________ product. Cartesian
Write a statement to match-merge the data sets work.reps, empinfo.sales, and empinfo.bonuses, in that order, by the common variable Emp_ID. Assume that the data sets have been sorted by Emp_ID. merge work.reps empinfo.sales empinfo.bonuses; by Emp_ID;
True or false. The SUM statement ignores missing values. True
True or false. You list TABLES statement options after a forward slash. True Example: tables Gender*Country / nofreq norow nocol;
What's wrong with this code? proc print data = homecountry; where ctrycode = DE; run; DE must be enclosed in quotation marks in the WHERE statement.
Which option do you use with PROC FORMAT to document the format in a particular format catalog? a. FMTSEARCH= b. FMTERR c. FMTLIB c. FMTLIB
Which PROC FORMAT option do you use to create an SAS data set from a format? a. CNTLIN= b. LIBRARY= c. CNTLOUT= d. FMTLIB= c. CNTLOUT=
True or false. You use the < symbol to define a non-inclusive range. True
True or false. A FORMAT statement is used only to apply SAS formats. False. A FORMAT statement is used to apply both SAS and user-defined formats.
Which procedure can be used to view the permanent labels and formats stored in a data set? a. PROC CONTENTS b. PROC PRINT c. PROC FORMAT d. PROC UNIVARIATE a. PROC CONTENTS
True or false. When you use the SAS/ACCESS LIBNAME statement to assign a libref to a Microsoft Excel workbook, you can view the workbook using PROC CONTENTS or Microsoft Excel. False
True or false. You can use a SET statement to read an Oracle table (or any database table). True
True or false. By default, a PROC MEANS step that has no CLASS statement produces all of these statistics except for N Obs. True
True or false. To create an accumulating total for a group, you first have to sort the data by the grouping variable(s). True
True or false. You can use column or formatted input to read data in fixed columns. True
Which statement is false regarding an ARRAY statement? a. It is an executable statement b. It can be used to create variables c. It must contain either all numeric or all character elements. a. It is an executable statement
Fill in the blank. The ______________ option enables you to specify an SAS library where the formats that you are creating in the PROC FORMAT step will be stored. a. CNTLIN= b. FMTLIB= c. LIBRARY= d. CNTLOUT= c. LIBRARY=
Which procedure enables you to manage an SAS catalog? PROC CATALOG
In which location can you not use a FORMAT? a. PUT statement b. TITLE statement c. FORMAT= option d. FORMAT statement b. TITLE statement
PROC SQL stops running when it encounters what? QUIT statement
True or false. When you use an informat with the colon format modifier, SAS ignores the width and reads up to the next delimiter. True
What is the function of the VARNUM option? To print a list of the variables in the order they were created.
True or false. The SELECT clauses in a PROC SQL program must be separated by commas, not just blanks. True
True or false. If any given variable is defined as a numeric variable, but the value the program tries to read into it from the data set is a character value, the result will be a missing value. True
What is the syntax error in the following code: proc sort data=orion.staff; out=work.staff_sort; Answer: the first semicolor causes an run-time error
Which of the following is a valid name for a character format? a) country b) $cntry c) $country. d) _country b) Character formats must start with a dollar sign followed by a letter or underscore. A format name does not end with a period. The period is a required delimiter when using a format in a FORMAT statement.
True or false. The DATE9. format is used to display all dates read from a worksheet regardless of how the date was formatted in the worksheet. True
What does a forward slash (/) indicate when used in an INPUT statement? Load the next record in the input buffer.
The _________ function is best used when you know the exact position of the substring to extract from the character value. SUBSTR
When using an informat with list input, the _______-format modifier is required to correctly associate the informat with the variable name. colon Example: input relation $ first_name $ birthdate : mmddyy8.;
True or false. The DESCENDING keyword is placed after the variable name it modifies in the BY statement. False. It is placed before the variable name.
True or false. An array cannot be referenced on a KEEP data set option. True
True or false. RUN, QUIT, DATA, and PROC statements function as step boundaries, which determine when SAS statements take effect and indicate the end of the current step or the beginning of a new step. True
What is the keyword in the sort procedure so you do not replace the original dataset? Out=
What happens when you use a BY statement and a SUM statement in a PROC PRINT step. It generates subtotals
What procedure in SAS do you use to view the descriptor portion of a data set? PROC CONTENTS
What are the 2 types of sas libraries? permanent or temporary
Which informat below should you use to read the raw data value $1,230,456 as a numeric variable? a. w. b. $w. c. COMMAw. c. COMMAw. - This informat strips out the dollar sign and commas and assigns the value to a numeric variable.
True or false. The MEAN function calculates the arithmetic mean (average) of the arguments. The arguments must be enclosed in parentheses and separated by commas. True
What will this PUTLOG statement do? putlog _all_; Write the values of all the variables to the log
Describe the program's function: proc contents data = _all_; run; The output contains a list of the SAS data sets contained in the WORK library and displays the contents of those data sets.
True or false. The SUM statement ignores missing values, which means that the function will return a value EVEN IF it encounters missing numeric data. True
True or false. To calculate statistics for groups of observations, you use the CLASS statement. True
What will this PUTLOG statement do? putlog _all_; Write the values of all the variables to the log
Fill in the blank. ________ 'file specification' dlm = '?' dsd; infile
Find the syntax error: set work.employees(rename = (sex = gender, b_date = birth)); The comma in the argument
Fill in the blank: ods html file = 'trends.html'; ods html ______; close
In a data set with 100 observations, given the following statement, how many observations will be read? set orion.tests (firstobs = 20 obs = 10); a. 30 observations b. 10 observations c. 0 observations c. 0 obs, the obs= value cannot be less that the firstobs= value
True or false. You can use the DLM= option with the DSD option, but it is not needed for comma-delimited files. True
True or false. Two @@ hold the raw data record across iterations of the DATA step. True
What is the output? data abc; date = '07mar2008'd; format date weekdate.; run; proc print data = abc; run; Friday, March 7, 2008
What does this error mean: "WHERE clause operator requires compatible variables" It means your where condition is expecting a numeric or character variable and you're providing the opposite
Use this procedure to view the descriptor portion of an SAS data set. a. PROC PRINT b. PROC MEANS c. PROC CONTENTS d. PROC DESC c. PROC CONTENTS
Look at this tier statement: 50000 < - 100000; Which number is included and which one is excluded as part of the bounds? Excludes 50000 Includes 100000
Which of the following statements creates a macro variable named rate that has a value of 23? a. let rate="23"; b. &let rate=23; c. %let rate=23; d. %let rate="23"; c. %let rate=23; You use the %LET statement to create a macro variable, and you do not enclose the value in quotation marks.
When you are joining tables using PROC SQL, you never use a WHERE clause. False. (Don't confuse this with PROC PRINT.)
What is the function of the END= option? The END= option creates a variable that can be used to detect the last observation being read.
Fill in the blanks. Use the ___________ procedure to create SAS output that describes the contents of a library. _ALL_ requests a listing of all files in the library and _______ suppresses the printing of detailed information about each file in the output CONTENTS, NODS
Which option enables you to specify the number of extreme observations displayed by PROC UNIVARIATE? a. NEXTROBS= b. NLEVELS c. NOPRINT d. _ALL_ a. NEXTROBS=
True or false. To display a table showing the levels of all variables, you specify the NLEVELS option in the PROC FREQ statement. True
True or false. The PROC UNIVARIATE provides observation numbers for data outliers. True
True or false. By default, the output data set of a DATA step that includes a MERGE statement and a BY statement includes all of the observations from all of the input data sets that are listed in the MERGE statement. True
True or false. The SUM function ignores missing values. True
What does the NOFMTERR option do? This option replaces missing formats with the w. or $w. default format, and issues a note. SAS will continue processing the program.
Where is the macro variable proc stored? In the local symbol table.
To display the number of observations with missing values, use the following option: a) NVAL b) NMISS c) VALMISS d) FMTERR b) NMISS
Which one of the following IF statements writes the last observation to the output data set? A. if end = 0; B. if eof = 0; C. if end = 1; D. if eof = 1; D
What's the symbol for the logical operator NOT? ^ or ~
What's the symbol for the logical operator OR? | (pipe)
True or false. SAS will execute two or more WHERE statements. False. You must use logical operators (AND, OR, NOT).
True or false. You can use the WHERE statement in a PROC PRINT step to subset observations in a report. True
What does adding a space and they keyword NODS do after the _ALL_ option? It suppress the descriptor data for each individual file in the library.
True or false: If a library name is not specified at run time, then the data will be stored in the Work library. True
Which is true regarding the name of an SAS array? A. It is saved with the data set. B. It can be used in procedures. C. It exists only for the duration of the DATA step. D. It can be the same as the name of a variable in the data set. C
True or false. The arguments inside a TRANWRD function are case sensitive. True
True or false. The : indicates that values are read until a blank (or other delimiter) is encountered. True
Which one of the following ODS statement options terminates output being written to an HTML file? A. END B. QUIT C. STOP D. CLOSE D. CLOSE
The value 110700 is stored in a numeric variable. Which one of the following SAS formats is used to display the value as $110,700.00 in a report? A. comma8.2 B. comma11.2 C. dollar8.2 D. dollar11.2 D. dollar11.2
How many obs? data work.sales; do year = 1 to 5; do month = 1 to 12; x + 1; end; end; run; A. 0 B. 1 C. 5 D. 60 B. 1; because there's not output statement.
If you don't want cumulative or percentages in your PROC FREQ tables, what 2 keywords should you use? nocum nopercent
True or false. The RETAIN statement can be used to reorder variables. True
Created by: ronzStack