SAS Advanced Certification
c
According to the data set descriptions below, which of the variables listed qualify as BY variables for a DATA set match merge? a. Code and IDnum b. Manager and Supervisor c. Manager and IDnum d. There are no variables that are common to both of these data sets.
d
According to the data set shown, what is the value of Totalrev in the PDV at the end of the 4th iteration of the datastep? a. The value is missing. b. $350.00 c. $520.00 d. $1100.00
c
According to the global symbol table shown here, what value will a reference to &&teachers&crs resolve to? Global Symbol Table TEACH1 Hallis, Dr. George TEACH2 Wickam, Dr. Alice TEACH3 Forest, Mr. Peter CRS 3 a. &TEACH3 b. TEACH3 c. Forest, Mr. Peter d. none of the above
d
An index a. is an optional file that is associated with a data set. b. provides direct access to specific obserbations of a data set, based on the value of one or more key variables. c. can be classified as simple or composite, either of which can consist of unique values. d. all of the above
d
Array values should be stored in a SAS data set when a. there are too many values to initialize easily in an array. b. the values change frequently. c. the same values are used in many programs. d. all of the above
d
Dictionary tables are a. created each time they are referenced in a SAS program. b. updated automatically. c. limited to read-only access. d. all of the above
d
Dictionary tables can be accessed a. by running a PROC SQL query against the table using the Dictionary libref. b. by referring to the PROC SQL view of the table that is stored in the Sashelp library. c. by referring to the PROC SQL view of the table that is stored in the Sasuserlibrary. d. a and b
a
How many statements does the program below contain? proc sql; select grapes, oranges, grapes + oranges as sumsales from sales.produce order by sumsales; a. two b. three c. four d. five
...
I know some of these flashcards weren't typed out completely. Feel free to edit them if you wish. username: sdahl1113 password: ihatesas good luck!
a
If the current date is March 30, 2003, which table correctly shows the corresponding values of the variables y1, y2, y3, and nextfile? a. When i= nextfile= y1 c:\data\Y2001.dat y2 c:\data\Y2002.dat y3 c:\data\Y2003.dat b. When i= nextfile= y1 Y2001.dat y2 Y2002.dat y3 Y2003.dat c. When i= nextfile= y1 c:\data\Y2003.dat y2 c:\data\Y2002.dat y3 c:\data\Y2001.dat d. When i= nextfile= y1 c:\data\Y3.dat y2 c:\data\Y2.dat y3 c:\data\Y1.dat
a
If the value of Cargosum is $1000 at the end of the first iteration fo the Datasetp shown below, what is the value of Cargosum inteh PDV when the DAta step is in its third iteration? a. $1000 b. $3000 c. The value is missing. d. The value cannot be determined without seeing the dta that is in Sasuser.Summary.
b
Placing the subsetting IF statement at the top rather than near the bottom of a DATA step results in a savings in CPU usage. What happens if the subset is large rather than small? a. The savings in CPU usage increases as the subset grows larger because the I/O increases. b. The savings in CPU usage decreases as the subset grows larger. However, sticking it at the top is always better than the bottom. c. The savings in CPU usage remains constant as the subset grows larger. However, placing the subsetting IF statement near the bottom of a data set is preferable. d. The savings in CPU usage decreases as the subset grows larger. However, placing the subsetting IF statement near the bottom of a data set increases the I/O.
d
Proc sql views can access data from a. a SAS data file. b. another PROC SQL view. c. a relationsal database table. d. all of the above
a
A Cartesian product is returned when a. join conditions are not specified in a PROC SQL join. b. join conditions are not specified in a PROC SQL set operation. c. more than two tables are specified in a PROC SQL join. d. the keyword ALL is used with the OUTER UNION operator.
d
A Dictionary table contains a. information about SAS data libraries b. information abou SAS data sets. c. information about SAS macros. d. all of the above
c
A PROC SQL inner join can combine a. a maximum of 2 tables or in-line views, but multiple joins can be chained together. b. a maximum of 32 tables or 2 in-line views. c. a maximum of 32 tables, which includes any tables referenced by an in-line view. d. a maximum of 2 tables and 32 columns.
c
A public library has several categories of books. Each book in the library is assigned to only one category. The table Library.Inventory contains one row for each book in the library. The Checkouts column indicates the number of times that each book has been checked out. You want to display only the categories that have an average circulation (number of checkouts) that is less than 2500. Does the following PROC SQL query produce the results that you want? proc sql; title 'Categories with Average Circulation'; title2 'Less Than 2500'; select category, avg(checkouts) as AvgCheckouts from library.inventory having avg(checkouts) < 2500 order by 1; a. No. This query will not run because a HAVING clause cannot contain a summary function. b. No. This query will not run because the HAVING clause must include the CALCULATED keyword before the summary function. c. No. Because there is no GROUP BY clause, the HAVING clause treats the entire table as one group. d. Yes.
d
Assuming that you began you SAS session today, which of the following statements correctly sets the macro variable currdate to today's date: a. %let currdate = %sysfunc(today(), worlddate,): b. %let currdate = &sysdate9; c. %let currdate = %sysfunc(date()); d. all of the above
c
By definition, a noncorrelated subquery is a nested query that a. returns a single value to the outer query. b. contains at least one summary function. c. executes independently of the outer query. d. requires only a single value to be passed to it by the outer query.
b
Complete the SELECT clause below to create a new column named Profit by subtracting the values of the column Cost from those of the column Price. select fruit, cost, price, _______________________ a. Profit=price-cost b. price-cost as Profit c. profit=price-cost d.Profit as price-cost
b
Complete the following PROC SQL query to select the columns Address and SqFeet from the table List.Size and select Price from the table List.Price. (Only the Address column appears in both tables.) proc sql; ______________________ from list.size, list.price; a. select address, sqfeet, price b. select size.address, sqfeet, price c. select price.address, sqfeet, price d. either b or c
c
Consider the following PROC SQL query: proc sql; select lastname, firstname, total, since from charity.donors where not exists (select lastname from charity.current where donors.lastname = current.lastname); The query references two tables: • Charity.Donors lists name and contact information for all donors who have made contributions since the charity was founded. The table also contains these two columns: Total, which shows the total dollars given by each donor, and Since, which stores the first year in which each donor gave money. • Charity.Current lists the names of all donors who have made contributions in the current year, and the total dollars each has given this year (YearTotal). Assume that the values of LastName are unique in both tables. The output of this query displays a. all donors whose rows do not contain any missing values. b. all donors who made a contribution in the current year. c. all donors who did not make a contribution in the current year. d. all donors whose current year's donation in Charity.Current has not yet been added to Total in Charity.Donors.
c
Consider this PROC SQL query: proc sql; select flightnumber, count(*) as Flights, avg(boarded) label="Average Boarded" format=3. from sasuser.internationalflights group by flightnumber having avg(boarded) > 150; The table Sasuser.Internationalflights contains 201 rows, 7 unique values of FlightNumber, 115 unique values of Boarded, and 4 different flight numbers that have an average value of Boarded that is greater than 150. How many rows of output will the query generate? a. 150 b. 7 c. 4 d. 1
d
For selecting observations, is a subsetting IF statement or a WHERE statement more efficient? Why? a. A subsetting IF statement is more efficient because it loads all observations sequentially into the program data vector. b. A subsetting IF statement is more efficient because it examines what is in the input buffer and selects observations before they are loaded into the program data vector, which results in a savings in CPU operations. c. A WHERE statement is more efficient because it loads all observations. sequentially into the program data vector. d. A WHERE statement is more efficient because it examines what's in the input buffer and selects obs. before they're loaded into the PDV.
b
Given the PROC SQL query and tables shown below, which output is generated? proc sql; select * from store1, store2 where store1.wk= store2.wk; Store1 Store2 Wk Sales Wk Sales 1 $515.07 1 $1368.99 2 $772.29 2 $1506.23 3 $888.88 3 $1200.57 4 $1000.01 4 $1784.11 5 $43.00 a. Wk Sales Wk Sales 1 $515.07 1 $1368.99 2 $772.29 2 $1506.23 3 $888.88 3 $1200.57 4 $1000.01 4 $1784.11 5 $43.00 b. Wk Sales Wk Sales 1 $515.07 1 $1368.99 2 $772.29 2 $1506.23 3 $888.88 3 $1200.57 4 $1000.01 4 $1784.11 c. Wk Sales 1 $515.07 2 $772.29 3 $888.88 4 $1000.01 d. Wk Sales 1 $515.07 2 $772.29 3 $888.88 4 $1000.01 1 $1368.99 2 $1506.23 3 $1200.57 4 $1784.11
d
Given the PROC SQL query and tables shown below, which output is generated? proc sql; select s.*, bonus from bonus as b right join salary as s on b.id= s.id; Bonus Salary ID Bonus ID Salary 123 5000 123 70000 456 7000 456 80000 744 3500 978 55000 a. ID Salary Bonus 123 70000 5000 456 8000 7000 978 55000 3500 b. ID Salary Bonus 123 70000 5000 456 8000 7000 744 . 3500 c. ID Salary Bonus 123 70000 5000 456 8000 7000 744 55000 3500 d. ID Salary Bonus 123 70000 5000 456 8000 7000 978 55000 .
b
Given the following OPTIONS statement, in what order will SAS search to find a user-defined format? options fmtsearch=(work abs.newfmt sasuser); a. Work.Formats=> Abc.Newfmt =>Sasuser.Formats=>Library.Formats b. Work.Formats=>Library.Formats=>Abc.Newfmt=>Sasuser.Formats c. Work.Formats=>Abc.Newfmt=>Sasuser.Format d. the default search order
c
Given the following PROC FORMAT step, how is the value 6.1 displayed when the SKICOND format is applied? proc format; value skicond 0-3='Poor' 3<-6='Fair' 6<-9='Food' 9<-high='Excellent'; run; a. 6.1 b. Fair c. Good d. .
c
Given the following PROC FORMAT step, how is the value 70 displayed when the AGEGRP.format is applied? a. 000 Senior b. 70 Adult c. 70 Senior d. 070 Senior
a
Given the following code, what option is missing? a. MULTILABEL b. MULTIRANGE c. MLF d. MULTIFORMAT
a
Given the following program, what is the value of points in the fifth observation in the data set Work.Results? a. 40 b. 50 c. 60 d. 70
c
Given the following program, which statement is not true? data work.lookup1; etc. a. The IF-THEN statment specifies that the Targets array is loaded once. b. During the first iteration of the DATA step, the outer DO loop executes three times. c. After the first iteration of the DO loop, the pointer drops down to the second SET statement. d. During the second iteration of the DATA step, the condition _N_=1 is false. So, the DO loop doesn't execute.
b
Given the following program, which table correctly shows the corresponding values of the variables x and readfile? data work.revenue; do x= 8, 9, 10; (etc) a. When x= readfile= 8 month8.dat 9 month9.dat 10 month10.dat b. When x= readfile= 8 c:\data\month8.dat 9 c:\data\month9.dat 10 c:\data\month10.dat c. When x= readfile= 8 c:\data\month 8.dat 9 c:\data\month 9.dat 10 c:\data\month10.dat d. When x= readfile= 8 month8 9 month9. 10 month10.
c
Given the following program, which variable names will appear in the data set Work.New? proc transpose data=work.revenue out=work.new; run; a. Year, Jan, Feb, Mar, Apr b. Year, 2000, 2001, 2002 c. _NAME_, Col1 Col2, Col3 d. _Name_, Jan, Feb, Mar, Apr
c
If you specify a CREATE TABLE statement in your PROC SQL step, a. the results of the query are displayed, and a new tables is created. b. a new tables is created, but it does not contain any summarization that was specified in the PROC SQL step. c. a new table is created, but no report is displayed. d. results are groups by the value of the summarized column.
a
If you store a macro definition in a SAS catalog SOURCE entry a. the macro definition can be submitted for compilation by using the FILENAME and %INCLUDE statements. b. you can use the PROC CATALOG statement to compile the macro. c. the SOURCE entry will be deleted at the end of the session. d. you do not need to compile the macro before you invoke it in a program.
d
If you use a mixed parameter list in your macro program definition, which of the following is false? a. You must list positional parameters before any keyword parameters. b. Values for both positional and keyword parameters are stored in a local symbol table. c. Default values for keyword parameters are the values that are assigned in the macro definition, whereas positional parameters have a default value of null. d. You can assign a null value to a keyword parameter in a call to the macro by omitting the parameter from the call.
d
If you use the Stored Compiled Macro Facility, a. the macro processor does not compile a macro every time it is used. b. the only compiled macros that the Stored Compiled Macro Facility can access are those that are stored in the Sasmacr catalog. c. you need to specify the MSTORED and SASMSTORE=system options. d. all of the above
c
In order for PROC SQL to perform an inner join, a. the tables being joined must contain the same number of columns. b. the tables must be sorted before they are joined. c. the columns that are specified in a join condition in the WHERE clause must have the same data type. d. the columns that are specified in a join condition in the WHERE clause must have the same name.
a
In which of the following situations is sequential access likely to be more efficient than direct access for WHERE processing? a. The subset contains over 75% of the observations in the data set. b. The WHERE expression specifies both key bariables in a single composite index. c. The data is sorted on the key variable. d. The data set is very large.
d
In which of the following situations would you use SYMGET rather than a macro variable reference (&macvar)? a. to create a DATA step variable from a macro variable value during the execution of the DATA step b. to include a macro variable reference in a PROC SQL view c. to access the value of a macro variable during the execution of an SCL program d. all of the above
c
Macro character functions a. can be used to manipulate character strings in macro variable values. b. have the same basic syntax as the corresponding DATA step functions and yield similar results. c. all of the above d. none of the above
a
PROC SQL options are specified in a. the PROC SQL statements. b. an OPTIONS statements. c. a SELECT statement. d. the OPTIONS procedure.
b
Select the program that correctly creates a new dataset named Sasuser.Summary that contains one observation with summary data created from the Salary variable of the Sasuser.Empdata data set. a. proc sum data=sasuser.emdata noprint; output out=sasuser.summary sum=Salarysum; run; b. proc means data=sasuser.empdata noprint; var salary; output out=sasuser.summary sum=Salarysum; run; c. proc sum data=sasuser.empdata noprint; var salary; output out=sasuser.summary sum=Salarysum; run; d. proc means data=sasuser.empdata noprint; output=sasuser.summary sum=Salarysum; run;
b
Suppose that the Sasuser.Revenue data set has a simple index named FlightID. For which of the following programs will the index be used? a. proc print data=sasuser.revenue; where flightid ne 'IA11200'; run; b. data someflights; set sasuser.revenue; where flightid >'IA11200'; run; c. data someflights; set sasuser.revenue; if flightid > 'IA11200'; run; d. proc print data=sasuser.revenue; where origin="RDU' or flightid='IA03400'; run;
b
Suppose you want to merge 3 datasets. Also, 1 and 2 have common variable Startdate, 2 and 3 have Instructor, and no others. How can you use a DATA step to merge these 3 into one? a. You use a MERGE statement in one DATA step to merge Dataset1, Dataset2, and Dataset3 by Startdate and Instructor. b. You sort Dataset1 and Dataset2 by Startdate and merge them into a temporary data set in a Data step. Then you sort the temporary data set and dataset3 by Instructor and merge them into a new data set in a DATA step. c. You can merge these data sets only with a PROC SQL step. d. You cannot merge these three data sets at all because they do not have a common variable.
d
The %INCLUDE statement a. can be used to insert the contents of an external file into a program. b. will cause a macro definition that is stored in an external file to be compiled when the contents of that file are inserted into a program and submitted. c. can be specified with the SOURCE2 option in order to writed the contents of the external file that is inserted into a program to the SAS log. d. all of the above
b
The PROG1 and PROG2 tables list students who took each course, respectively. Which PROC SQL step will give you the names of students who took only PROG1? PROG1 PROG2 PROG1 ONLY FName LName FName LName FName LName Pete Henry Clara Addams Alex Kinsley Mary Johnson Pete Henry Mary Johnson Alex Kinsely Dori O'Neil Dori O'Neil Cindy Phillips Mandi Young a.intersect b.except all c. intersect corr d. union
d
The SYMPUT routine cannot a. be used to assign a data set variable as a value to a macro variable. b. create a series of macro variables in one DATA step. c. automatically convert a numeric value to a character value when used to assign a value to a macro variable in a DATA step. d. be used to assign a numeric value to a macro variable in an SCL program.
c
The automatic variable _IORC_ is created when you use a MODIFY statement with a BY statement or the KEY=option. How can you use the value of _IORC_? a. to determine whether the index specified on the KEY=option is a valid index b. to determine the number of observations that were updated in the master data set c. to determine the status of the I/O operation d. to determine the number of observations that could not be updated in the master data set
b
The four types of tokens that SAS recognizes are a. expressions, literals, names, and special characters. b. literals, names, numbers, and special characters. c. expressions, names, numbers, and special characters. d. expressions, literals, numbers, and special characters.
d
The keyword ALL cannot be used with which of the following set operators? a. EXCEPT b. INTERSECT c. UNION d. OUTER UNION
a
The total number of bytes occupied by a data set equals...? a. the page size multiplied by the number of pages. b. the page size multiplied by the number of observations. c. the sum of the page size and the number of pages. d. the number of pages multiplied by the number of variables.
d
The variable that is created by the Point=option is assigned a value a. automatically during compilation of the DATA step. b. automatically during the execution of the DATA step. c. during compilation of the DATA step, by program statements. d. during execution of the DATA step, by program statements.
d
To create an index on an existing data set, you use a. PROC DATASETS. b. PROC SQL. c. the DATA step with the INDEX=option, to rebuild the data set. d. any of the above
a
To process a default DATA step match-merge, SAS first reads the descriptor portion of each data set and sets up the PDV and the descriptor portion of the new data set. Which of the following accurately describes the rest of the process? a. Next, SAS sequentially match merges observations and writes new observations to PDV, then to the new data set. When the BY values changes in all the input data sets, the PDV is initialized to missing. Missing values for variables, as well as missing values that result from unmatched observations, are written to the new data set. b. Next, SAS sequentially match merges observations and writes new observations to PDV, then to the new data set. After each DATA step iteration, the PDV is initialized to missing. Missing values for variables, as well as missing values that result from unmatched observations, are written to the new data set. c. Next, SAS creates a Cartesian product of all possible combinations of observations and writes them to the PDV, then to the new data set. Then SAS goes through the new data set and eliminates all observations that do not have matching values of the BY variable. d. Next, SAS creates a Cartesian product of all possible combinations of observations and writes them to the PDV, then to the new data set. The new data set is then ordered by values of the BY variable.
b
To view a list of the indexes that are associated with a data set, you use a. PROC COPY or the COPY statement in PROC DATASETS. b. PROC CONTENTS or the CONTENTS statement in PROC DATASETS. c. the MSGLEVEL=system option and a PROC PRINT step. d. any of the above
d
Using an index is not likely to optimize a PROC SQL query in which of the following situations? a. The query contains an IN subquery that references the key column. b. the Key column is specified in a WHERE clause expression that contains a comparison operator, the TRIM or SUBSTR function, the CONTAINS operator, or the LIKE operator. c. The query is an equijoin, and all the columns in the join expression are indexed in one of the tables being joined. d. The key column is specified only in a SELECT clause.
c
What are the resulting values for the macro variables defined here? %let month1= June; %let month2= July; %letperiod1=&month1&month2; %let period2=May&month1; %let period3= &month2.Aug; a. month1 Junemonth2 Julyperiod1 June Julyperiod2 May Juneperiod3 July Aug b.month1 Junemonth2 Julyperiod1 JuneJulyperiod2 MayJuneperiod3 July.Aug c. month1 Junemonth2 Julyperiod1 JuneJulyperiod2 MayJuneperiod3 JulyAug d. month1 Junemonth2 Julyperiod1 junejulyperiod2 Mayjuneperiod3 julyaug
c
What happens if the workspace that is required for completing a sort is less than or equal to the value that is specified in the SORTSIZE= system option or procedure option? a. CPU time is increased. b. I/O is increased. c. The entire sort can take place in memory. d. A temporary utility file is created in the Work directory or in a mainframe temporary area.
c
What happens if you use a GROUP BY clause in a PROC SQL step without a summary function? a. The step does not execute. b. The first numeric column is summed by default. c. The GROUP BY clause is changes to an ORDER BY clause d. The step executes but does not groups or sort data.
a
What happens when SAS processes the last data record in an imput file? a. The END=variable is set to 1 b. The END=variable is set to 0. c. The END=variable is set to the number of records in the input file. d. The END=variable is written to the SAS data set.
a
What happens when the SAS data set Work.NewHires is appended to the SAS data set Work.Employees using PROC APPEND? a. Missing values are assigned to Room for the observations that are read in from Work.NewHires. b. Missing values are assigned to Room for all of the observations in Work.Employees. c. Room is dropped from Work.Employees. d. The values of Name are truncated in the observations that are read in from Work.NewHires.
d
What happens when the following program is submitted? proc append base=staff.marketing data=staff.sales force; run; a. The length of LastName is converted to 20 in Staff.Marketing. b. LastName is dropped from Staff.Marketing. c. Missing values are assigned to LastName observations that are read in from Staff.Sales. d. Some of the values of LastName may be truncated in the observations that are read in from Staff.Sales.
a
What is the purpose of specifying the dataset option IDXWHERE=YES? a. It forces SAS to use the best available index to process the WHERE expression. b. It creates an index from the expression in the WHERE clause. c. It writes messages about index usage to the SAS log. d. It stops SAS from using any index.
d
What option is used with the PROC FORMAT to document the formats in a particular format catalog? a. FMTSEARCH b. FMTERR c. CATALOG d. FMTLIB
d
What value will these statements assign to the macro variable reptitle: %let area= "Southeast"; %let reptitle= Sales Report for &area Area ; a. Sales Report for Southeast Area b. Sales Report for "Southeast" Area c. *Sales Report for "Southeast" Area* d. * Sales Report for "Southeast" Area *
b
What will the following PROC Catalog step do proc catalog cat=mylib.sasmacr; contents; quit; a. Copy the contents of the Sasmacr catalog to a temporary data set. b. List the contents of the Sasmacr catalog as output. c. Copy the contents of the output window to the Sasmacr catalog. d. none of the above
a
When is it more advantageous to create a temporary SAS data set rather than a permanent one? a. When the external file on which the data set is based might change between SAS sessions. b. When the external file on Which the data set is based does not change between SAS sessions. c. When the data set is needed for more than one SAS session. d. When you are converting raw numeric calues to SAS data values.
b
When the NoFMTERR system option is in effect, what happens when SAS encounters a format it cannot locate? a. Creates the format in the default Work.Formats directory and continues processing. b.Substitutes the $w. or w. format and continues processing. c. Stops processing and writes and error message to the log. d. Skips processing at that step and continues with the next step and writes a note to the log.
a
When the following program is submitted, what is the value of the FIRST.Product_Line for the third obs. in the data set Work.Products? a. 1 b. 3 c. 0 d. Clothes & Shoes
d
When you are working with PROC SQL views, it is best to a. avoid using an ORDER BY clause in a view. b. avoid creating views that are based on tables whose structure might chage. c. specify a one-level name in the FROM clause if the view resides in the same SAS data library as the contributing table(s). d. all of the above
c
When you compare the technique of using multile DATASETS procedures to using a single DATASETS procedure to modify the descriptor portion of a data set, which is true? a. A one-step DATASETS procedure results in an increase in I/O operations. b. Multiple DATASETS procedures result in a decrease in I/O operations. c. A one-step DATASETS procedure results in a decrease in CPU usage. d. Multiple DATASETS procedures results in a decrease in CPU usage.
d
When you submit a call to a compiled macro, what happens? a. First, the macro processor checks all macro programming statements in the macro for syntax errors. Then the macro processor executes all statements in the macro. b.The macro processor executes compiled macro programming statements. Then any SAS programming language statements are executed by the macro processor. c. First, all compiled macro programming statements are executed by the macro processor. After all macro statements have been preocessed, any SAS language statements are passed back to the input stack in order to be passed to the compiler and then executed. d. The macro processor executes compiled macro statements. If any SAS language statements are encountered, they are passed back to the input stack.
a
When you submit the following code, what happens? %macro prtlast; proc print data=&syslast (obs=5); title "Listing of &syslast data set"; run; %mend; a. A session-compiled macro named Prtlast is stored in Work.Sasmacr. b. A macro named Prtlast is stored in the autocall library. c. The Prtlast macro is stored as a stored compiled macro. d. The Prtlast macro is stored as a SOURCE entry in a permanent SAS catalog.
d
When you use an %IF-%THEN statement in your macro program, a. you must place %DO and %END statements around code that descries the conditional action, if that code contains multiple statements. b the %ELSE statement is optional. c. you cannot refer to DATA step variables in the logical expression of the %IF statement. d. all of the above.
c
Which DATA step uses the transaction data set Records.Overnight to update the master data set Records.Snowfall by AccumAmt? a. data records.snowfall; modify records.snowfall records.overnight key=accumAmt; run; b. data records. snowfall; modify records.overnight records.snowfall; by accumAmt; run; c. data records.snowfall; modify records.snowfall records.overnight; by accumAmt; run; d. data records.snowfall; modify records.snowfall records.overnight; update accumAmt; run;
d
Which DO statement processes all of the elements in the Yearx array? array Yearx{12} Jan--Dec; a. do i=1 to dim(yearx); b. do i=1 to 12; c. do i=Jan to Dec; d. a and b
d
Which PROC DATASETS step creats an integrity constraint named val_age on the data set survey to ensure that values of the variable age are greater than or equal to 18? a. proc datasets nolist; modify age; ic create val_age=check (where=(age>=18)); quit; b. proc datasets nolist; modify Survey; ic create val_age=check(age>=18); c. proc datasets nolist; modify survey; integrity constraint val_age=check(where=(age>=18)); quit; d. proc datasets nolist; modify survey; ic create val_age=check (where=(age>=18)); quit;
c
Which PROC FORMAT option is used to create a SAS data set from a format? a. CNTLIN= b. LIB= c. CNTLOUT= d. FMTLIB
d
Which PROC SQL query produces the same output as the query shown here? proc sql; select a.*, duration from groupa as a, groupb as b where a.obs=b.obs; Note: Assume that the table Groupa contains the columns Obs and Med. Groupb contains the columns Obs and Duration. a. proc sql; select a.obs label='Obs', med b.obs label='Obs', duration from groupa as a, groupb as b where a.obs=b.obs; b. proc sql; select coalesce(a.obs, b.obs) label='Obs', med, duration from groupa as a full join groupb as b on a.obs=b.obs; c. proc sql; select a.*, duration from groupa as a left join groupb as b where a.obs=b.obs; d. proc sql; select a.*, duration from groupa as a inner join groupb as b on a.obs=b.obs;
c
Which PROC SQL query will generate the same output as the DATA step match- merge and PRINT step shown below? data merged; merge table1 table2; by g3; run; proc print data=merged noobs; title 'Merged'; run; Table1 Table2 Merged G3 Z G3 R G3 Z R 89 FL 46 BC 46 UI BC 46 UI 85 FL 47 BA 47 BA 99 BA 85 FL 89 FL 99 BA a. proc sql; title 'merged'; select a.g3, z, r from table1 as a full join table2 as b on a.g3 = b.g3 order by 1; b. proc sql; title 'Merged'; select a.g3, z, r from table1 as a full join corr table2 as b on a.g3 = b.g3 order by 1; c. proc sql; title 'Merged'; select coalesce (a.g3, b.g3) label='G3', z, r from table1 as a full join table2 as b on a.g3 = b.g3 order by 1; d. proc sql; title 'Merged'; select g3, z, r from table1 as a full join table2 as b on a.g3 = b.g3 order by 1;
d
Which PROC SQL query will remove duplicate values of MemberType from the query output, so that only the unique values are listed? a. proc sql nodup; select membertype from sasuser.frequentflyers; b. proc sql; select distinct(membertype) as MemberType from sasuser.frequentflyers; c. proc sql; select unique membertype from sasuser.frequentflyers group by member type; d. proc sql; select distinct membertype from sasuser.frequentflyers;
a
Which PROC SQL step combines tables but does not overlay any columns? a. proc sql; select * from groupa outer union select * from groupb; b. proc sql; select * from groupa as a outer union corr select * from groupb as b; c.proc sql; select coalesce (a.obs,b.obs) label='obs', med, duration from groupa as a full join select * from groupb as b on a.obs=b.obs; d. procsql; select* from groupa as a intersect select * from groupb as b;
d
Which PROC SQL step combines the table Summer and Winter to produce the output displayed below? Summer Winter Month Temp Precip Mo Temp Precip 7 78 .05 1 29 .15 8 85 .04 2 32 .17 9 83 .15 3 38 .20 2 32 .17 Month Temp Precip 1 29 .15 2 32 .17 3 38 .20 7 78 .05 8 85 .04 9 83 .15 a. proc sql; select * from summer intersect all select * from winter; b. proc sql; select * from summer outer union select * from winter; c. proc sql; select * from summer union corr select * from winter; d. proc sql; select * from summer union select * from winter;
a
Which PROC SQL step correctly references the view DATA.Empview? a. proc sql; select * from data.empview; b. proc sql; select * from view data.empview; c. proc sql; select view * from data.empview; d. proc sql; select * from data where view='empview';
c
Which PROC SQL step creates a view that queries that table Sasuser.Payrollmaster? a. proc sql; insert into sasuser.newview select * from sasuser.payrollmaster; b. proc sql; create sasuser.newview as select * from sasuser.payrollmaster; c. proc sql; create view sasuser.newview as select * from sasuser.payrollmaster; d. proc sql; select * from sasuser.payrollmaster into view sasuser.newview;
c
Which PROC SQL step creates the output shown below? EmpID JobCode LastName FirstName 1124 FA1 FIELDS DIANA 1422 FA1 FLETCHER MARIE 1094 FA1 GOMEZ ALAN 1113 FA1 JONES LESLIE 1103 FA1 MCDANIEL RONDA 1970 FA1 PARKER ANNE 1132 FA1 PEARCE CAROL 1116 FA1 RICHARDS CASEY 1414 FA1 SANDERSON NATHAN 1425 FA1 UNDERWOOD JENNY 1130 FA1 WOOD DEBORAH Row EmpID JobCode LastName FirstName 1 1574 FA2 CAHILL MARSHALL 2 1125 FA2 DUNLAP DONNA 3 1475 FA2 EATON ALICIA 4 1368 FA2 JEPSEN RONALD 5 1411 FA2 JOHNSON JACKSON 6 1441 FA2 LAWRENCE KATHY 7 1477 FA2 MEYERS PRESTON 8 1424 FA2 PATTERSON RENEE 9 1413 FA2 PETERS RANDALL 10 1555 FA2 RODRIGUES JULIA a. proc sql nonumber outobs=10; ... b. proc sql number; ... c. proc sql nonumber ... d. proc sql; ...
a
Which PROC SQL step will generate the same results as the following DATA step? data allstudents; set prog1 prog2; by lname; run; proc print noobs; run; PROG1 PROG2 FName LName FName LName Pete Henry Clara Addams Mary Johnson Pete Henry Alex Kinsley Dori O'Neil Dori O'Neil Cindy Phillips Mandi Young a. outer union corr b. union c. outer union d. union corr
b
Which Proc SQL step generates the following output from the tables Dogs and Pets? Dogs Pets Name Price Name Price Name Price Arr ANA $25 FIFI $101 ANA $25 09JAN2002 GAO $57 GEORGE $75 FIFI $101 14MAR2002 ZEUS $500 SPARKY $136 GAO $57 08DEC2001 TRUFFLE $250 GAO $57 08DEC2001 SPARKY $136 16SEP2002 TRUFFLE $250 20DEC2002 ZEUS $500 08JUN2002 a.proc sql; select name, price from pets except all select * from dogs; b.proc sql; select name, price from pets except select * from dogs; c. proc sql; select name, price from pets except corr all select * from dogs; d. proc sql; select* from dogs except corr select name, price from pets;
c
Which Proc SQL step will return the names of all students who took both classes? PROG1 PROG2 PROG1, & PROG2 FName LName FName LName FName LName Pete Henry Clara Addams Dori O'Neil Mary Johnson Pete Henry Pete Henry Alex Kinsely Dori O'Neil Dori O'Neil Cindy Phillips Mandi Young a. union b. except corr c. intersect all d. union corr
c
Which Proc SQL step will return the names of all the students who took Prog1, Prog2, or both classes? PROG1 PROG2 PROG1, PROG2, or Both FName LName FName LName FName LName Pete Henry Clara Addams Alex Kinsley Mary Johnson Pete Henry Cindy Phillips Alex Kinsely Dori O'Neil Clara Addams Dori O'Neil Cindy Phillips Dori O'Neil Mandi Young Mandi Young Mary Johnson Pete Henry a. intersect b. outer union corr c. union d. except corr
a
Which SAS statement correctly specifies the array Sales as illustrated in the following table? m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 m12 a. array Sales{3,4} m1-m12; b. array Sales{4,3} m1-m12; c. array {3,4} Sales m1-m12; d. array {4,12} Sales m1-m12;
d
Which SAS system option is used to identify the format catalogs to SAS? a. FMTERR b. FMTLIB c. NOFMTERR d. FMTSEARCH=
b
Which SORT procedure option compares all of the variable values for each observation to those for the previous observation that was written to the output data set? a. NODUPKEY b. NODUPRECS c. EQUALS d. NOEQUALS
c
Which clause below specifies that the two tables Produce and Hardware be queried ? Both tables are located in a library to which lib ref Sales has been assigned. a. select sales.produce sales.hardware b. from sales.produce sales.hardware c. from sales.produce, sales.hardware d. where sales.produce, sales.hardware
b
Which clause in the following program is incorrect? proc sql; select sex, mean(weight) as avgweight from company.employees company.health where employees.id=health.id group by sex; a. SELECT b. FROM c. WHERE d. GROUP BY
d
Which code creates an audit trail on the SAS data set Reports.Quarter1? a. proc datasets nolist; audit quarter1; initiate; quit; b. proc datasets lib=reports nolist; audit initiate reports.quarter1; quit; c. proc datasets lib=reports nolist; initiate audit quarter1; quit; d. proc datasets lib=reports nolist; audit quarter1; initiate; quit;
a
Which code deletes all generations of the data set Sasuser.Amounts including the base data set? a. proc datasets lib=sasuser nolist; delete amounts (gennum=ALL); quit; b. proc datasets lib=sasuser nolist; delete amounts (gennum=HIST); quit; c. proc datasets lib=sasuser nolist; delete amounts (gennum=0); quit; d. proc datasets lib=sasuser nolist; delete amounts; quit;
a
Which code initiates generation data sets on the existing SAS data set Sasuser.Amounts and specifies that five historical versions are saved in addition to the base version? a. proc datasets lib=sasuser nolist; modify Amounts (genmax=6); quit; b. proc datasets lib=sasuser nolist; modify Amounts (genmax=5); quit; c. proc datasets lib=sasuser nolist; modify Amounts (gennum=6); quit; d. proc datasets lib=sasuser nolist; modify Amounts (gennum=5); quit;
d
Which isn't true regarding a page? a. A page is the unit of data transfer between the engine and the operating environment. b. A page includes the number of bytes used by the descrptor portion, the data values, and the overhead. c. The size of a page is analogous to buffer size. d. The size of a page can be changed at any time.
b
Which keyword must you add to your index definition in the CREATE INDEX statement to ensure that no duplicate values of the key column can exist? a. KEY b. UNIQUE c. NODUPS d. NODUPKEY
b
Which of the clauses below correctly sorts rows by the values of the columns Price and SqFeet? a. order price, sqfeet b. order by price, sqfeet c. sort by price sqfeet d. sort price sqfeet
a
Which of the clauses in the PROC SQL program below is written incorrectly? proc sql; select style sqfeet bedrooms from choice.houses where sqfeet ge 800; a. SELECT b. FROM c. WHERE d. both a and c
d
Which of the following PROC SQL steps correctly embeds a LIBNAME statement with a view definition? a. proc sql; insert into sasuser.newview select * from airline.supervisors libname airline 'c:\mysql'; b. proc sql; create view sasuser.newview as from airline.supervisors embed libname airline 'c:\mysql'; c. proc sql; using airline 'c:\mysql'; insert into sasuser.newview select * from airline.supervisors; d. proc sql; create view sasuser.newview as select * from airline.supervisors using libname airline 'c:\mysql';
b
Which of the following PROC SQL steps creates a new table by copying only the column structure (but not the rows) of an existing table? a. from b. like c. copy d. describe
a
Which of the following PROC SQL steps creates a table that contains rows for the level-1 flight attendants only? a. proc sql; create table work.newpayroll as select * from sasuser.payrollmaster where jobcode="FA1"; b. proc sql; create work.newpayroll as select * from sasuser.payrollmaster where jobcode="FA1"; c. proc sql; create table work.newpayroll copy sasuser.payrollmaster where jobcode="FA1"; d. proc sql; create table work.newpayroll as sasuser.payrollmaster where jobcode="FA1";
b
Which of the following PROC SQL steps displays information about the Dictionary table Dictionary.Titles? a. proc sql; describe dictionary.titles; b. proc sql; describe table dictionary.titles; c. proc sql describe table dictionary.titles; d. proc sql describe dictionary titles;
a
Which of the following PROC SQL steps displays the name(Memname), modification date (Modate), number of variables (Nvar), and number of observations (Nobs) for each table in the Sasuser library? a. proc sql; select memname, modate, nvar, nobs from dictionary.tables where libname='SASUSER'; b. proc sql; select memname, modate, nvar, nobs from dictionary.tables where libname='sasuser'; c. proc sql; select memname, modate, nvar, nobs from 'SASUSER' where table=dictionary.tables; d. proc sql; select SASUSER from dictionary.tables where cols='memname, modate, nvar, nobs';
b
Which of the following PROC SQL steps enables you to see a description of the view definition? a. select * from b. describe view c. list d. contents view=
b
Which of the following Proc SQL steps gives bonuses (in points) to frequent-flyer program members as follows:50% for <10000, 100% for >10000. a. if b. when c. if d. if
d
Which of the following SQL steps deletes rows for all frequent-flyer program members who traveled less than 10,000 miles? a. delete rows b. drop rows c. drop table d. delete
c
Which of the following about audit trails is true? a. They create historical versions of data so that a copy of the data set is saved each time the data is replaced. b. They record information about changes to observations in a data set each time the data set is replaced. c. They record information about changes to observations in a data set each time the data is modified in place. d. The audit trail file has the same name as the SAS data file it is monitoring, but has #AUDIT at the end of the data set name.
b
Which of the following about the _IORC_ variable is false? a. It is automatically created when you use either a SET statement with the KEY=option or the MODIFY statement with the KEY=option in a DATA step. b. A value of zero for _IORC_ means that the most recent SET statement with the KEY=option (or MODIFY statement with the KEY=option) did not execute successfully. c. A value of zero for _IORC_ means that the most recent SET statement with the KEY=option (or MODIFY statement with the KEY=option) executed successfully. d. You can use the _IORC_ variable to prevent nonmatching data from being included when you use an index to combine data from multiple data sets.
d
Which of the following can be placed onto the input stack? a. only whole steps. b. only whole steps or whole statements. c. only whole statements or pieces of text within a statement. d whole steps, whole statements, or pieces of text within statements.
c
Which of the following correctly creates a data set named Flights from the Sasuser.Revenue dataset, creates a composite index named Fromto that is based ot hte values of Origin and Dest, and prints informational messages about the index to the Sas log? a. options msglevel=i; data flights index=Fromto=origin dest); set sasuser.revenue; run; b. options msglevel=n; data flights (index= (Fromto=origin dest)); set sasuser.revenue; run; c. options msglevel=i; data flights (index=(Fromto=(origin dest))); set sasuser.revenue; run; d. options msglevel=n; data flights (index=Fromto); run;
c
Which of the following correctly creates a macro variable in a PROC SQL step? a. call symput (daily_fee, put(fee/days, dollar8.); b. %let daily_fee=put(fee/days, dollar8.) c. select fee/days format=dollar8. into :daily_fee from sasuser.all; d. select fee/days format=dollar8. into daily_fee from sasuser.all;
a
Which of the following correctly creates a macro variable named region and assigns to it a value that is based on the value of the data set variable Location? a. call symput('region', 'East'); b.%let region=East; c. call symput (region, "East"); d. symput(region, East);
b
Which of the following correctly creates a permanently stored compiled macro? a. libname macrolib 'c:\mylib'; options sasmstore; %macro prtlist; / store proc print data=&syslast (obs=5); title "Listing of &syslast data set"; run; %mend; b.libname macrolib 'c:\mylib'; options mstored samstore=macrolib; %macro prtlist / store; proc print data=&syslast (obs=5); title "Listing of &syslast data set"; run; %mend; c. libname macrolib 'c:\mylib'; options mstored sasmstore=macrolib; %macro prtlast; proc print data=&syslast (obs=5); title "Listing of &syslast data set"; run; %mend; d. libname macrolib 'c:\mylib'; %macro prtlist / store; proc print data=&syslast (obs=5); title "Listing of &syslast data set"; run; %mend;
a
Which of the following correctly creates a simple index named Origin on the Revenue Dataset? a. proc sql; create index origin on revenue(origin); quit: b. proc sql; modify revenue; index=origin; quit; c. proc sql data=revenue; create index origin; quit; d. proc sql; index=origin on revenue; quit;
b
Which of the following correctly defines the macro program Hex? a. %macro hex(start=1, stop=10, incr=1); %local i; data _null; %do i=&start to &stop %by &incr; value= &i; put "Hexadecimal form of &i is " value hex6.; %end; run; %mend hex; b.%macro hex(start=1, stop=10, incr=1); %local i; data _null; %do i=&start %to &stop %by &incr; value= &i; put "Hexadecimal form of &i is " value hex6.; %end; run; %mend hex; c. %macro hex(start=1, stop=10, incr=1); %local i; data _null; %do i=&start to &stop %by &incr; value= &i; put "Hexadecimal form of &i is " value hex6.; run; %mend hex; d. %macro hex(start=1, stop=10, incr=1); %local i; data _null; %do i=&start to &stop %by &incr; value= &i; put "Hexadeciaml form of &i is " value hex6.; %end run; %mend hex;
c
Which of the following correctly produces a title in which the current date is left justified in order to remove extra blanks? a. title "Report for %sysfunc(left(%sysfunc(today(),worddate.)))"; b. title "Report for %sysfunc(left(today(), worddate.))"; c. title "Report for %sysfunc(left(%qsysfunc(today(), worddate.)))"; d. title "Report for %left(today(), worddate.))";
c
Which of the following correctly references the macro named Printdsn as shown here: ¯o printdsn(dsn, vars); %if &vars- %then %do; proc print data= &dsn; title "Full listing of %upcase(&dsn) data set"; run; %end; %else %do; proc print data= &dsn; var &vars; title "Listing of %upcase(&dsn) data set"; run; %end; %mend; a. %printdsn(sasuser.courses, course_title Days); b. %printdsn(dsn=sasuser.courses, vars=course_title days) c. %printdsn(sasuser.courses, course_title days) d. %printdsn(sasuser.courses, course_title, days)
a
Which of the following creates an empty table that contains the 2 columns FullName and Age? a.proc sql; create table work.names (FullName char(25), Age num); b. proc sql; create table work.names as (FullName char(25), Age num); c. proc sql; create work.names (FullName char(25), Age num); d.proc sql; create table work.names set (FullName char(25), Age num);
c
Which of the following displays the structure of a table in the SAS log? a. proc sql; describe as select * from sasuser.payrollmaster; b. proc sql; describe contents sasuser.payrollmaster; c. proc sql; describe table sasuser.payrollmaster; d. proc sql; describe * from sasuser.payrollmaster;
c
Which of the following examples correctly defines a macro named Print that includes parameters named vars and total? a. %macro print(vars, total); var vars; b. %macro print('vars', 'total'); var &vars; c. %macro print(vars, total); var &vars; d. %macro print(vars, total); var :vars;
c
Which of the following expressions will generate a random integer between 1 and 50? a. ceil (ranuni (50)) b. ranuni (50) c. ceil (ranuni (0)*50) d. ceil (ranuni (0))*50
b
Which of the following is NOT a type of integrity constraint? a. CHECK b. NULL c. UNIQUE d. PRIMARY KEY
c
Which of the following is false regarding the IDXNAME=data set option? a. The specified index must exist. b. The specified index must be suitable by having at least its first or only column match a condition in the WHERE expression. c. The option allows you to create and name an index on the table. d. The option directs SAS to use an index that you specify.
c
Which of the following is false regarding the use of an index? a. Equijoins can be performed without internal sorts. b. Indexes provide fast access to a small subset of data. c. Indexes can be created for numeric columns only. d. Indexes can enforce uniqueness.
c
Which of the following is false? a. A %LET statement causes the macro processor to create a macro variable before the program is compiled. b. To create a macro variable that is based on data calculated by the DATA step, you use the SYMPUT function. c. Macro functions are always processed during the execution of the DATA step. d. Macro variable references in a DATA step are always resolved prior to DATA step execution.
b
Which of the following is false? a. A %MACRO statement must always be paired with a %MEND statement. b. A macro definition can include macro variable references, but it cannot include SAS language statements. c. Only macro language statements are checked for syntax errors when the macro is compiled. d. Compiled macros are stored in a temporary SAS catalog by default.
c
Which of the following is false? a. A macro program is compiled when you submit the macro definition b. A macro program is executed when you call it (%macro-name). c. A macro program is stored in a SAS catalog entry only after it is executed d. A macro program is available for execution throughout the SAS session in which it is compiled.
b
Which of the following programs should you use to detect any loss of precision beetween the default-length numeric variables in Company.Regular and the reduced-length numeric variables in the data set Company.Reduced? a. proc contents data=company.regular; compare data=company.reduced; run; b. proc compare base=company.regular compare=company.reduced; run; c. proc print data=company.regular; run; proc print data=company.reduced; run; d. proc datasets library=company; contents data=regular compare=reduced; run;
c
Which of the following is false? a. The SYMPUT routine can be used to create a macro variable during execution of the DATA step or during execution of an SCL program. b. In the DATA step, the SYMPUT routine automatically converts to a character value any numeric value that you attempt to assign as the value of a macro variable. c. PROC SQL automatically converts to a numeric value any macro variable value that you attempt to compare to a numeric value. d. In an SCL program, the SYMPUTN routine can be used to assign a numeric value to a macro variable.
c
Which of the following is not an advantage of BY=group processing with an index that is based on the BY variables? a. The data can be sequenced without using the SORT procedure. b. There is no need to re-sort a data set when observations are modified or added. c. It is generally more efficient than reading a sorted data set sequentially. d. The data can be sequenced by different variables if multiple indexes are used.
c
Which of the following is not true about stored compiled macros? a. Because these stored macros are compiled, you should save and maintain the source for the macro definitions in a different locations. b. The Stored Compiled Macro Facility compiles and saves compiled macros in a permanent catalog, in a library that you specify. c. You do not need to specify any system options in order to use the Stored compiled Macro Facility. d. You cannot move a stored compiled macro to another operating system.
a
Which of the following is not true? a. The autocall macro facility stores compiled SAS macros in a collection of external files called an autocall library. b. Autocall libraries can be concatenated together. c. One disadvantage of the autocall facility is that the first time you call an autocall macro in a SAS session, the macro processor must use system resources to compile it. d. The autocall facility can be used in conjuction with the Stored Compiled Macro Facility.
a
Which of the following is true? a.When you add observations to a dataset, the indexes are automatically updated with additional value/identifier pairs. b. When you rename a variable that is used as the key variable in a simple index, you must re-create the index. c. When you delete a data set, the index file remains until you delete it as well. d. When you copy a data set with the COPY statement, you must also copy the index file in another step.
d
Which of the following options does not affect the appearence of HTML, PDF, or RTF output? a. NUMBER | NONUMBER b. DOUBLE | NODOUBLE c. FLOW | NOFLOW | FLOW=n | FLOW=n m d. b and c
b
Which of the following options restricts the number of rows that PROC SQL takes as an input from any source? a. OUTOBS= b. INOBS= c. OBS= d. none of the above
b
Which of the following programs correctly creates a series of macro variables whose names are values of the data set variable Course_code, then indirectly references one of those macro variables in a later step? a. call symput (course_code, trim(course_title)); &c005 b. call symput(course_code, trim(course_title)); &&&crsid c. call symput('course_code', trim(course_title)); &&&crsid d. call symget (course_code, trim(course_title)); &&&crsid
b
Which of the following programs correctly creates a systematic sample from a dataset with an unknown number of observations and outputs these sample observations to a dataset named Sample? a. data sample; set sasuser.sale2000 point=thisone nobs=totnum; output; stop; run; b. data sample; do thisone=100 to totnum by 100; set sasuser.sale2000 point=thisone nobs=totnum; ouput; end; stop; run; c. data sample; do thisone=100 to totnum by 100; set sasuser.sale2000 point=thisone; output; end; stop; run; d. data sample; do thisone=100 to totnum by 100; set sasuser.sale2000 point=thisone nobs=totnum; end; run;
d
Which of the following programs correctly creates a table with the results of a PROC SQL inner join matched on the values of empcode? a. proc sql; newsals.empcode allemps.lastname newsals.salary contrib.amount from sasuser.allemps, sasuser.contrib, sasuser.newsals where empcode=allemps.empid and empcode=contrib.empid; quit; b. proc sql; create table usesql as select newsals.empcode allemps.lastname newsals.salary contrib.amount from sasuser.allemps, sasuser.contrib, sasuser.newsals quit; c. proc sql; create table usesql as; select newsals.empcode allemps.lastname, newsals.salary contrib.amount; from sasuser.allemps, sasuser.contrib, sasuser.newsals where empcode=allemps.empid and empcode=contrib.empid; quit; d. proc sql; create table usesql as; select newsals.empcode allemps.lastname, newsals.salary contrib.amount from sasuser.allemps, sasuser.contrib, sasuser.newsals where empcode=allemps.empid and empcode=contrib.empid; quit;
c
Which of the following programs correctly creates reduced-length numeric variables? a. data temp; infile file1; input x 4. y 3. z 2.; run; b. data temp; format x 4. y 3. z 2.; infile file1; input x 4. y 3. z 2.; run; c. data temp; length x 4 y 3 z 2; infile file1; input x 4. y 3. z 2.; run; d. data temp; informat x 4. y 3. z 2.; infile file1; input x 4. y 3. z 2.; run;
c
Which of the following programs correctly sets the appropriate system options and calls the macro Prtlast? Assume that Prtlast is stored in an autocall library as a text file and that it has not been compiled during the current SAS session. a. libname mylib 'c:mylib'; filename macsrc 'mylib.macsrc'; options mautosource sasautos=(macsrc, sasautos); %prtlast b. libname mylib 'c:mylib'; filename macsrc catalog 'mylib.macsrc'; %prtlast c.filename mylib 'c:mylib'; options mautosource sasautos=(sasautos,mylib); %prtlast d.libname mylib 'c:mylib'; options mautosource sasautos=mylib; %prtlast
d
Which of the following programs correctly uses an index to combine data from two input data sets? a. data work.profit; set sasuser.sale2000 (keep=route id flightid date rev1st revbusiness revecon revcargo) key=flightgade; set sasuser.dnunder; Profit=sum(rev1st, rvbusiness, revecon, revcargo, -expenses); run; b. data work.profit; set sasuser.dnunder; set sasuser.sale2000 (keep=route id flightid date rev1st revbusiness revecon revcargo) key=flightgade; where routeid='0000103'; Profit=sum(rev1st, rvbusiness, revecon, revcargo, -expenses); run; c. data work.profit; set sasuser.dnunder; set sasuser.sale2000 (keep=route id flightid date rev1st revbusiness revecon revcargo); key=flightgade; profit=sum(rev1st, rvbusiness, revecon, revcargo, -expenses); run; d. data work.profit; set sasuser.dnunder; set sasuser.sale2000 (keep=route id flightid date rev1st revbusiness revecon revcargo) key=flightgade; profit=sum(rev1st, rvbusiness, revecon, revcargo, -expenses); run;
b
Which of the following programs drop (deletes) a view? a. proc sql; delete sasuser.newview; b. proc sql; drop view sasuser.newview; c. proc sql; erase view sasuser.newview; d. proc sql; remove newview from sasuser;
d
Which of the following statement correctly creates a DATA step variable named Price and assigns to it the value of the macro variable daily_fee during DATA step execution? a. price=&daily_fee; b. price=symget (daily_fee); c. price=symget (&daily_fee); d. price=symget ("daily_fee");
a
Which of the following statements about SAS data views is true? a. SAS data views use less disk space but more CPU resources than SAS data files. b. SAS data views can be created only in permanent SAS data libraries. c. SAS data views use less CPU resources but more disk space than SAS data files. d. SAS data views can be created only in temporary SAS data libraries.
b
Which of the following statements about compressed SAS data files is true? a. The descriptor portion is stored on whatever data set page has enough room for it. b. Deleted observation spaced can be reused. c. Compressed SAS data files have a smaller overhead than uncompressed SAS data files. d. In a compressed SAS data set, each observation must be the same size.
d
Which of the following statements about uncompressed SAS data files is true? a. The descriptor portion is stored on whatever page has enough room for it. b. New observations are always added in the first sufficient available space. c. Deleted observation space is tracked. d. New observations are always added at the end of the data set.
c
Which of the following statements associates the fileref OnSale with the raw datafiles London.dat, Paris.dat, and Zurich.dat? The files are stored in the C:\Routes\New directory in the Windows operating Environment. a. filename onsale (c:\routes\new\london.dat, c:\routes\new\paris.dat, c:\routes\new\zurich.dat); b. filename onsale 'c:\routes\new\london.dat' 'c:\routes\new\paris.dat' 'c:\routes\new\zurich.dat'; c. filename onsale ('c:\routes\new\london.dat' 'c:\routes\new\paris.dat' 'c:\routes\new\zurich.dat'); d. filename onsale 'c:\routes\new\london.dat c:\routes\new\paris.dat c:\routes\new\zurich.dat';
b
Which of the following statements creates temporary array elements? a. arrary new {*} _temporary_; b. arrary new {6} _temporary_; c. array new {*} _temporary_Jan Feb Mar Apr May Jun; d. array _temporary_new {6} Jan Feb Mar Apr May Jun;
d
Which of the following statements describes an advantage of using a PROC SQL view? a. Views often save space, because a view is usually quite small compared with the data that it accesses. b. Views prevent users from continually submitting queries to omit unwanted columns or rows. c. Views hide complex joins or queries from users. d. all of the above
c
Which of the following statements is false about using multiple SET statements in one DATA step? a. You can use multiple SET statements to combine observations from several SAS data sets. b. Processing stops when SAS encounters the end-of-file (EOF) marker on either data set (even if there is more data in the other data set). c.You can use multiple SET statements in one DATA step only if the data sets have common variables. d. The variable in the PDV are not reinitialized when a second SET statement is executed.
a
Which of the following statements is false regarding a PROC SQL view? a. A view cannot be used in a join. b. A view accesses the most current underlying data. c. A view follows the same naming conventions as a table. d. A view can be used in SAS programs in place of an actual SAS data file.
b
Which of the following statements is false? a. A macro variable can be defined and referenced anywhere in a SAS program except within data lines. b. Macro variables are always user defined, and their values remain constant until they're changed by the user. c. Macro variables are text strings that are independent of SAS data sets. d. The values of macro variables can be up to 65,534 characters long.
a
Which of the following statements is false? a. The END=variable is set to 0 when SAS processes the last data record in the input file. b. The END=variable is set to 1 when SAS processes the last data record in the input file. c. The END=variable is not written to the data set. d. a and c.
c
Which of the following statements is true about techniques that are used for modifying data and attributes? a. You can use PROC DATASETS to modify both data values and variable attributes. b. You can use PROC DATASETS to modify only data values. c You can use the DATA step to modify both data values and variable attributes. d. You can use the DATA step to modify only variable attributes.
a
Which of the following statements is true regarding a file that is opened with the SASFILE statement? a. The file is available to subsequent DATA and PROC steps or applications until a SASFILE CLOSE statement is executed or until the program ends. b. The file is available to subsequent DATA and PROC steps or applications until a SASFILE END statment is executed. c. The file is available for subsequent utility or output processing until the program ends. d. If the file increases in size during processing, the number of buffers remains the same.
b
Which of the following statements is true regarding the BUFNO= option? a. The BUFNO=option specifies the size of each buffer that is used for reading or writing a SAS data set. b. The BUFNO= option can improve execution time by limiting number of in/output operations that are required. c. Using the BUFNO=option results in permanent changes to the data set. d. Using the BUFNO=option to increase the number of buffers results in decreased memory consumption.
d
Which of the following statements is true regarding the STIMER option in PROC SQL? a. The STIMER option in PROC SQL writes timing information for each statement to the SAS log. b. The STIMER option in PROC SQL writes only cumulative timing information for the entire procedure to the SAS log. c. When using the STIMER option in PROC SQL, the SAS system option STIMER must also be in effect. d. a and c
c
Which of the following statements is true regarding the UNDO_POLICY=REQUIRED option? a. It must be used with the REQUIRED integrity constraint. b. It ignores the specified integrity constraints if any of the rows that you want to insert or update do not meet the constraint criteria. c. It restores your table to it's original state if any of the rows that you try to insert or update do not meet the specified integrity constraint criteriea. d. It allows rows that meet the specified integrity constraint criteria to be inserted or updated, but rejects rows that do not meet the integrity constraint criteria.
d
Which of the following statements is true? a. The FILEVAR=option can be used to dynamically change the currently opened input file to a new physical file. b. The FILEVAR=variable is not written to the data set. c. The FILEVAR=variable must contain a character string that is a physical filename. d. all of the above
a
Which of the following statements is used to add new rows to a table? a. INSERT b. LOAD c. VALUES d. CREATE TABLE
d
Which of the following statements regarding the ALTER TABLE statement is false? a. It allows you to update column attributes. b. It allows you to add new columns in your table. c. It allows you to drop columns in your table. d. It allows you to change a character column to a numeric column.
a
Which of the following statements will generate an error message while trying to display the value of the macro variabe month in the SAS log? a. options &month; b. %PUT &month; c. options symbolgen; d. %PUT the macro variable MONTH has the value &month.;
c
Which of the following statements will generate an error message while trying to display the value of the macro variable month in the saslog? a. title "Total Sales for '&month' "; b. title "Total Sales for 'month' "; c. title "Total Sales for &month"; d. title Total Sales for "&month";
b
Which of the following statements will show you all the indexes that are defined for a table? a. DESCRIVE INDEX b. DESCRIBE TABLE c. SELECT d. IDXNAME
d
Which of the following techniques does not summarize data for specific combinations of class variables? a. the NWAY option in multiple PROC MEANS steps b. the TYPES statement in a PROC MEANS step c. the WHERE=option in a PROC MEANS step d. a basic PROC MEANS step
b
Which of the following techniques is most efficient for summarizing data for specific combinations of class variables? a. the NWAY option in multiple PROC MEANS steps b. the TYPES statement in a PROC MEANS step c. the WHERE=option in a PROC MEANS step d. a basic PROC MEANS step
b
Which of the following variables must be in the dataset that is specified on the CNTLIN= option? a. End b. FmtName c. Value d. Description
d
Which of the following will cause PROC SQL to list rows that have no data in the Address column? a. WHERE address is missing b. WHERE address not exists c. WHERE address is null d. both a and c
d
Which of the following will create a composite index for the table Sasuser.Flightdelays? (Sasuser.Flightdelays contains the following columns: Date Flightnumber Origin Destination DelayCategory DestinationType DayOfWeek and Delay.) a. create index destination b. create composite index places c. create index on flightnumber, destination d. create index places
c
Which of the following will create a macro variable named class in a local symbol table? a. data _null_; b. data _null_; c. %macro sample (dsn); d. %global class;
d
Which of the following will create an index on the column EmpID for the table Sasuser.Staffmaster? a. create simple index(empid) b. create empid index c. create simple index d. create index empid
a
Which of the following will write a message to the SAS log that shows whether PROC SQL has used an index? a.options msglevel=i; b. options index=yes; c.proc sql; d. proc sql;
c
Which option is used with the SORT procedure to store only the BY variables and the obs. numbers in temporary files? a. NOTSORTED b. GROUPFORMAT c. TAGSORT d. SORTEDBY=
a
Which output will the following PROC SQL query generate? proc sql; select * from table1 left join table2 on table1.g3= table2.g3; Table1 Table2 G3 Z G3 R 89 FL 46 BC 46 UI 85 FL 47 BA 99 BA a. G3 Z G3 R 89 FL . 46 UI 46 BC 47 BA . b. G3 Z G3 R 46 FL 46 BC . 85 FL . 99 BA c. G3 Z 46 UI d. G3 Z G3 R 46 UI 46 BC
c
Which program appends Work.April to Work.Y2003? a. proc append base=work.y2003 data=work.april; run; b. proc append base=work.april data=work.y2003 force; run; c. proc append base=work.y2003 data=work.april force; run; d. proc append base=work.april data=work.y2003; run;
b
Which program appends Work.London to Work.Flights? a. proc append base=work.london data=work.flights; run; b. proc append data=work.london base=work.flights; run; c. proc append data=work.london work.flights; run; d. proc append data=work.flights work.london; run;
d
Which program creates the data set Work.Fishsize? a. proc transpose data=work.fishdata out=work.fishsize prefix=Measurement; run; b. proc transpose data=work.fishdata out=work.fishsize prefix=Measurement; by location; run; c. proc transpose data=work.fishdata out=work.fishsize prefix=Measurement; by date; run; d. proc transpose data=work.fishdata out=work.fishsize prefix=Measurement; by location date; run;
b
Which program creates the output data set Work.Temp2? a. proc transpose data=work.temp out=work.temp2 prefix=Quarter; run; b. proc transpose data=work.temp out=work.temp2 name=Month prefix=Quarter; run; c. proc transpose date=work.temp out=work.temp2 prefix=Month name=Quarter; run d. proc transpose data=work.temp out=work.temp2 prefix=Month index=Quarter; run;
b
Which query will produce the report that you want? a. proc sql; select name, spent, 120-spent as calculated Balance from Company.Absences where balance <= 0; b. proc sql; select name, spent, 120-spent as Balance from Company.Absences where calculated balance <= 0; c. proc sql; select name, spent, 120-spent as Balance from Company.Absences where balance <= 0; d. proc sql; select name, spent, 120-spent as calculated Balance from Company.Absences where calculated balance <= 0;
c
Which set of statements would you add to the PROC CATALOG code to copy the LEVELS. and $PICKS. formats from the Sasuser.Formats catalog to the Work.Formats catalog? proc catalog cat=sasuser.formats; ? ? run; a. copy out=sasuser.formats; select levels.format $picks.format; b. copy out=work.formats; select levels $picks; c. copy out=work.formats; select levels.format picks.formatc; d. copy out=work.formats; select levels.format $picks.format;
c
Which statement about data remerging is true? a. When PROC SQL remerges data, it combines data from two tables. b. By using data remerging, PROC SQL can avoid making two passes through the data. c. When PROC SQL remerges data, it displays a related message in the SAS log. d. PROC SQL does not attempt to remerge data unless a subquery is used.
a
Which statement about in-line views is false? a. Once defined, an in-line view can be referenced in any PROC SQL query in the current SAS session. b. An in-line view can be assigned a table alias but not a permanent name. c. In-line views can be combined with tables in PROC SQL joins and set operations. d. This PROC SQL query contains an in-line view that uses valid syntax: proc sql; select name, numvisits from (select name, sum(checkin) as numvisits from facility as f, members as m where area='POOL' and f.id=m.id group by name) where numvisits<=10 order by 1;
a
Which statement about the following PROC SQL query is false? proc sql; validate select name label='Country', rate label='Literacy Rate' from world.literacy where 'Asia' = (select continent from world.continents where literacy.name = continents.country) order by 2; a. The query syntax is not valid. b. The outer query must pass values to the subquery before the subquery can return values to the outer query. c. PROC SQL will not execute this query when it is submitted. d. After the query is submitted, the SAS log will indicate whether the query has valid syntax.
d
Which statement about the use of table aliases is false? a. Table aliases must be used when referencing identical table names from different libraries. b. Table aliases can be referenced by using the keyword AS. c. Table aliases (or full table names) must be used when referencing a column name that is the same in two or more tables. d. Table aliases must be used when using summary functions.
b
Which statement about using the Key= option in the Modify statement is true? a. SAS locates the variables to update using the index specified in the KEY=option and then automatically overlays nonmissing transaction values as it does when you use the MODIFY/BY statments. b. When you use the KEY=option, you must explicitly state the update that you want to make. SAS doesn't automatically overlay nonmission transaction values. c. The KEY=option is used to specify a variable to match for updating observations. d. The index named in the KEY=option must be a simple index.
b
Which statement about using the MODIFY statement in a DATA step is true? a. MODIFY creates a second copy of the data while variables in the data are being matched with a WHERE clause and then deletes the second copy. b. You cannot modify the descriptor portion of the data set using the MODIFY statement. c. You can use the MODIFY statement to change the name of a variable. d. If the system terminates abnormally while a DATA step that is using the WHERE statement is processing, SAS automatically saves a copy of the unaltered data set.
a
Which statement is false regarding the keyword CORRESPONDING? a. It cannot be used with the keyword ALL. b.It overlays columns by name, not by position. c.When used in EXCEPT, INTERSECT and UNION set operations, it removes any columns not found in both tables. d. When used in OUTER UNION set operations, it causes same-named columns to be overlaid.
c
Which statement is false with respect to a set operation that uses the EXCEPT, UNION, or INTERSECT set operator without a keyword? a. Column names in the result set are determined by the first table. b. To be overlaid, columns must be of the same data type. c. To be overlaid, columns must have the same name. d. By default, only unique rows are displayed in the result set.
d
Which statement is true regarding the use of the PROC SQL step to query data that is stored in two or more tables? a. When you join multiple tables, the tables must contain a common column. b. You must specify the table from which you want each column to be read. c. The tables that are being joined must be from the same type of data source. d. If two tables that are being joined contain a same-named column, then you must specify the table from which you want the column to be read.
b
Which statement opens the file Work.Quarter1, allocates enough buffers to hold the entire file in memory, and reads the data into memory? a. sasfile work.quarter1 open; b. sasfile work.quarter1 load; c. sasfile work.quarter1 bufno=max; d. sasfile work.quarter1 bufsize=max;
d
Which statement will create a macro variable named location that has the value storage? a. &let location = storage; b. let &location = storage; c. %let location = "storage"; d. %let location = storage;
c
Which type of integrity constraint would you place on the variable StoreID to ensure that there are no missing values and there are no duplicate values? a. UNIQUE b. CHECK c. PRIMARY KEY d. NOT NULL
b
Which version of the dataset Work.Sales2 is created by the following program? proc transpose data=work.sales out=work.sales2 name=Week; by employee; run; a. Obs Employee Week1 Week2 1 Almers 3393.50 2192.25 2 Bonaventure 5093.75 2247.50 3 Johnson 1813.30 2082.75 4 LaMance 1572.50 2960.00 a. Obs Week COL1 COL2 COL3 COL4 1 Week1 3393.50 5093.75 1813.30 1572.5 2 Week2 2192.25 2247.50 2028.75 2960.0 b. Obs Employee Week COL1 1 Almers Week1 3393.50 2 Almers Week2 2192.25 3 Bonnaventure Week1 5093.75 4 Bonnaventure Week2 2247.50 5 Johnson Week1 1813.30 6 Johnson Week2 2028.75 7 LaMance Week1 1572.50 8 LaMance Week2 2960.00 c. Obs Week Almers Bonnaventure Johnson LaMance 1 Week1 3393.50 5093.75 1813.30 1572.5 2 Week2 2192.25 2247.50 2028.75 2960.0 d.Obs Employee _NAME_ Week 1 Almers Week1 3393.50 2 Bonnaventure Week1 5093.75 3 Johnson Week1 1813.30 4 LaMance Week1 1572.50 5 Almers Week2 2192.25 6 Bonnaventure Week2 2247.50 7 Johnson Week2 2028.75 8 LaMance Week2 2960.00
d
Why can using an index reduce the number if I/O operations that are required for accessing a small subset? a. using an index requires larger input buffers, which can hold more pages. b. The index does not have to be loaded into an input buffer. c. The number of observations that SAS has to load into the program data vector (PDV) is decreased. d. The number of pages that SAS has to load into input buffers is decreased.
d
Why would you want to store your macros in external files? a. You could easily share your macros with others. b. You could edit your macros with any text editor. c. Your macros would be available for use in later SAS sessions. d. all of the above
b
You are writing a PROC SQL query that will display the names of all library cardholders who work as volunteers for the library, and the number of books that each volunteer currently has checked out. You will use one or both of the following tables: • Library.Circulation lists the name and contact information for all library cardholders, and the number of books that each cardholder currently has checked out. • Library.Volunteers lists the name and contact information for all library volunteers. Assume that the values of Name are unique in both tables. Which of the following PROC SQL queries will produce your report? a. proc sql; select name, checkedout from library.circulation where * in (select * from library.volunteers); b. proc sql; select name, checkedout from library.circulation where name in (select name from library.volunteers); c. proc sql; select name from library.volunteers where name, checkedout in (select name, checkedout from library.circulation); d. proc sql; select name, checkedout from library.circulation where name in (select name from library.volunteers;);
c
You can update the data underlying PROC SQL view using the INSERT, DELETE, and UPDATE statements under which of the following conditions: a. The view is joined or linked to another table. b. The view contains a subquery. c. The view contains a WHERE clause. d. all of the above
b
You do not need to use the FORCE option with PROC APPEND when a. the DATA=data set contains variables that are not in the BASE=data set. b. the BASE=data set contains variables that are not in the DATA=data set. c. the variables in the DATA=data set are longer than the corresponding varialbes in the BASE=data set d. the variables in the DATA=data set have a different type than the corresponding variables in the BASE=data set.
b
You want to select a subset of observations in the data set Company.Products and you ahve defined a siimple indeex on the variable Ratin. SAS can't use the index to process which of the WHERE statements? a. where rating is missing; b. where rating=int(rating); c. where rating between 3.5 and 7.5; d. where rating=5.5;
b
You want to summarize data and group it by one variable. Which of the following tools could not be used? a. The DATA step with BY group processing. b. The DATA step without BY group processing. c. PROC SQL with a GROUP BY clause. d. PROC MEANS with a CLASS statement
b
You want to summarize data for one class variable, and you are trying to decide whether to use PROC MEANS (or PROC SUMMARY), PROC REPORT, PROC TABULATE, PROC SQL, or the DATA step with PROC SORT. Which of the following statements about the efficiency of these summarization tools is not true? a. PROC SQL and the DATA step with PROC SORT have similar resource usage. b. The SQL procedure is always the least efficient because it is a general-purpose tool. c. PROC MEANS (or PROC SUMMARY), PROC REPORT, and PROC TABULATE have similar resource usage. d. The efficiency of all these tools is affected by the shape of the data.
b
which of the following statments about the resolution of macro variable references is false? a. Two ampersands resolve to one ampersand. b. If more than four consecutive ampersands preced a name token, the macro processor generates an error message. c. Re-scanning continues until there are no remaining macro triggers that the macro processor can resolve. d. The macro processor always re-scans a name token that is preceded by multiple ampersands or by multiple percent signs.
c
which of the following will drop (delete) an index from a table? a. drop composite index flights b. delete index flights c. drop index flights d. delete index