Health Informatics

Ace your homework & exams now with Quizwiz!

Given the program below: data strings; str="What day is it?"; pos=find(str,'day'); run; What numeric value is assigned to the variable pos when the program executes? __

6

Given the SAS data set WORK.INPUT: Var1 Var2 ------ ------- A one A two B three C four A five The following SAS program is submitted: data WORK.ONE WORK.TWO; set WORK.INPUT; if Var1='A' then output WORK.ONE; output; run; How many observations will be in data set WORK.ONE?

8

workcode:

: is a 12-character code. The first four characters are randomly generated numbers. The next eight characters are based on the hexadecimal process identification number of the SAS session.

Given the following SAS error log 44 data WORK.OUTPUT; 45 set SASHELP.CLASS; 46 BMI=(Weight*703)/Height**2; 47 where bmi ge 20; ERROR: Variable bmi is not on file SASHELP.CLASS. 48 run; What change to the program will correct the error? A. Replace the WHERE statement with an IF statement B. Change the ** in the BMI formula to a single * C. Change bmi to BMI in the WHERE statement D. Add a (Keep=BMI) option to the SET statement

A

The dataPreprocess.impute action preforms data matrix (variable) imputation. Which imputation methods can be used? A. MIDRANGE, MODE, RANDOM, VALUE B. MIDRANGE, MODE, RANDOM, CUSTOM C. MODE, RANDOM, VALUE, CUSTOM D. MIDRANGE, RANDOM, VALUE, CUSTOM

A

Which CASL program will fetch all 428 rows from the cars table? A. proc cas; table.fetch / table={name="cars", caslib="casuser"}, from=1, to=1000; quit; B. proc cas; table.fetch / table={name="cars", caslib="casuser"}, from=1, to=_all_; quit; C. proc cas; table.fetch / table={name="cars", caslib="casuser"}, from=1, to=_maxrows_; quit; D. proc cas; table.fetch / table={name="cars", caslib="casuser"}, from=1; quit;

A

Which two statements are true regarding the KEEP and DROP statements? (Choose two.) A. They can be placed anywhere in the DATA step. B. They affect all data sets that are being created. C. They can be used in PROC steps. D. They control the order of the variables in the output data set.

A,B

Which two actions occur during the execution phase? (Choose two.) A. An observation from the input data set is read into the PDV. B. The descriptor portion is created. C. The PDV is initialized. D. The program is checked for syntax errors

A,C

Given the following data set WORK.CLASS: Name Gender Age Anna F 23 Ben M 25 Bob M 21 Brian M 27 Edward M 26 Emma F 32 Joe M 34 Sam F 32 Tom M 24 The following program is submitted: data WORK.MALES_OVER25; set WORK.CLASS; where Gender="M"; where age>25; run; How many observations are in the data set WORK.MALES_OVER25? A) 3 B) 5 C) 6 D) 9

B

The following SAS program is submitted: proc format; value score 1 - 50 = 'Fail' 51 - 100 = 'Pass'; run; Which one of the following PRINT procedure steps correctly applies the format? A. proc print data = SASUSER.CLASS; var test; format test score; run; B. proc print data = SASUSER.CLASS; var test; format test score.; run; C. proc print data = SASUSER.CLASS format = score; var test; run; D. proc print data = SASUSER.CLASS format = score.; var test; run;

B

This item will ask you to provide a line of missing code; The SAS data set WORK.INPUT contains 10 observations, and includes the numeric variable Cost. The following SAS program is submitted to accumulate the total value of Cost for the 10 observations: data WORK.TOTAL; set WORK.INPUT; <insert code here> Total=Total+Cost; run; Which statement correctly completes the program? A. keep Total; B. retain Total 0; C. Total = 0; D. If _N_= 1 then Total = 0;

B

BRFSS

Behavioral Risk Factor Surveillance System

Given the SAS data set WORK.ONE: Revenue2008 Revenue2009 Revenue2010 ----------- ----------- ----------- 1.2 1.6 2.0 The following SAS program is submitted: data WORK.TWO; set WORK.ONE; Total=sum(of Rev:); run; What value will SAS assign to Total? A) 3 B) 1.6 C) 4.8 D) The program fails to execute due to errors.

C

Given the SAS data set WORK.ONE: Id Char1 --- ----- 182 M 190 N 250 O 720 P and the SAS data set WORK.TWO: Id Char2 --- ----- 182 Q 623 R 720 S The following program is submitted: data WORK.BOTH; merge WORK.ONE WORK.TWO; by Id; run; What is the first observation in the SAS data set WORK.BOTH? A. Id Char1 Char2 --- ----- ----- 182 M B. Id Char1 Char2 --- ----- ----- 182 Q C. Id Char1 Char2 --- ----- ----- 182 M Q D. Id Char1 Char2 --- ----- ----- 720 P S

C

Given the SAS program shown below: title1 "Last Year's Standings"; title2 "Excludes preseason"; proc print data=football; run; title1; title2 "Includes preseason"; proc print data=football2; run; What title appears on the second PROC PRINT report? A. Last Year's Standings Includes preseason B. Last Year's Standings Excludes preseason C. "This line is blank." Includes preseason D. "This line is blank." Excludes preseason

C

Given the following SAS program? caslib _all_ assign; proc sgplot data=casuser.cars; vbar Make; run; What will the program do? A. Produce an error because the SGPLOT procedure cannot access the CAS table. B. Execute the SGPLOT procedure on the CAS server. C. Transfer the data to the Compute Server and then execute the SGPLOT procedure. D. Summarize the results in CAS and process the summarized results on the Compute Server

C

What is the value of x2 in the NUMS data set? data nums; x=7.56; x2=int(x); run; A. 7.5 B. 8 C. 7 D. 7.56

C

Which statement is true regarding PROC IMPORT? A. By default, PROC IMPORT overwrites an existing SAS data set. B. PROC IMPORT writes SAS data to a CSV file. C. The DBMS= option identifies the type of data to import. D. Dates are imported as character values.

C

Which table.update parameter specifies the column to update? A. Assign B. Update C. Set D. ComputedVars

C

Question 5: You have submitted the following SAS SORT procedure step generates an output data set: proc sort data = sasuser.employer out = employee; by style; run; In which library is the output data set stored? 1. WORK 2. REPORT 3. HOUSES 4. SASUSER

Correct Answer: 1 Exp: If libname name is not specified, then the data will be stored in WORK. The Work library is the temporary library that is automatically defined by SAS at the beginning of each SAS session or job. The Work library stores temporary SAS files that you create, as well as files created internally by SAS. To access files in the Work library, specify a one-level name for the file. The libref Work is automatically assigned to these files unless you have assigned the User libref. When you invoke SAS, it assigns the Work libref to a subdirectory of the directory specified in the WORK system option described in System Options under UNIX.

Question 11: For the program below, select an iterative DO statement to process all elements in the contrib array. data work.contrib; array contrib{4} qtr1-qtr4; ... contrib{i}=contrib{i}*1.25; end; run; 1. do i=4; 2. do i=1 to 4; 3. do until i=4; 4. do while i le 4

Correct Answer: 2 Exp: In the DO statement, you specify the index variable that represents the values of the array elements. Then specify the start and stop positions of the array elements. Example : Using the Iterative DO Statement without Infinite Looping In each of the following examples, the DO group executes ten times. The first example demonstrates the preferred approach. do i=1 to 10; ...more SAS statements... end; The next example uses the TO and BY arguments. do i=1 to n by m; ...more SAS statements... if i=10 then leave; end; if i=10 then put 'EXITED LOOP'; Example: Stopping the Execution of the DO Loop In this example, setting the value of the index variable to the current value of EXIT causes the loop to terminate. data iterate1; input x; exit=10; do i=1 to exit; y=x*normal(0) /* if y>25, */ /* changing i's value */ /* stops execution */ if y>25 then i=exit; output; end; datalines; 5 000 2500 ;

Which of the following statements is false regarding the program shown below? data work.hadoopexam; do year=1990 to 2004; Capital+5000; capital+(capital*.10); output; end; run; 1. The OUTPUT statement writes current values to the data set immediately. 2. In this case last value for Year in the new data set is 2005. 3. The OUTPUT statement overrides the automatic output at the end of the DATA step. 4. The DO loop performs 15 iterations.

Correct Answer: 2 Exp: The OUTPUT statement overrides the automatic output at the end of the DATA step. On the last iteration of the DO loop, the value of Year, 2004, is written to the data set. Using OUTPUT without arguments causes the current observation to be written to all data sets that are named in the DATA statement. The OUTPUT statement tells SAS to write the current observation to a SAS data set immediately, not at the end of the DATA step. If no data set name is specified in the OUTPUT statement, the observation is written to the data set or data sets that are listed in the DATA statement.

Question: 12 The following SAS program is submitted: data test; infile `file specification'; input name $ amount@@; run; Which of the following is true? 1. Two @@ together are the same as one c 2. Two @@ hold the data records until the bottom of the DATA step. 3. Two @@ hold the raw data record across iterations of the DATA step. 4. Two @@ are invalid syntax and will cause the program to fail to execute.

Correct Answer: 3 Exp: Using the Double Trailing @ Line-Hold Specifier Sometimes you may need to create multiple observations from a single record of raw data. One way to tell SAS how to read such a record is to use the other line-hold specifier, the double trailing at-sign (@@ or "double trailing @"). The double trailing @ not only prevents SAS from reading a new record into the input buffer when a new INPUT statement is encountered, but it also prevents the record from being released when the program returns to the top of the DATA step. (Remember that the trailing @ does not hold a record in the input buffer across iterations of the DATA step.) For example, this DATA step uses the double trailing @ in the INPUT statement: data body_fat; input Gender $ PercentFat @@; datalines; m 13.3 f 22 m 22 f 23.2 m 16 m 12 ; proc print data=body_fat; title 'Results of Body Fat Testing'; run; The following output shows the resulting data set: Data Set Created with Double Trailing @ Results of Body Fat Testing 1 Percent Obs Gender Fat 1 m 13.3 2 f 22.0 3 m 22.0 4 f 23.2 5 m 16.0 6 m 12.0

Which one of the following is the value of the variable JOIN_DATE in the output data set? 1. This will be a character string with the value '04/01/2000' 2. This will be a character string with the value 'Monday, April 01, 2000' 3. This will be a numeric value 14701, representing the SAS date for April 01, 2000 4. This will be a numeric value 04252000, representing the SAS date for April 01, 2000

Correct Answer: 3 Exp: Today's date is given in the SAS date form The Ans is: the numeric value 14701 The TODAY function produces the current date in the form of a SAS date value, which is the number of days since January 1, 1960.

Question 13: Which SAS statement correctly uses column input to read the values in the raw data file below in this order: Address (4th field), SquareFeet (second field), Style (first field), Bedrooms (third field)? 1. input Address 15-29 SquareFeet 8-11 Style 1-6 Bedrooms 13; 2. input $ 15-29 Address 8-11 SquareFeet $ 1-6 Style 13 Bedrooms; 3. input Address $ 15-29 SquareFeet 8-11 Style $ 1-6 Bedrooms 13; 4. input Address 15-29 $ SquareFeet 8-11 Style 1-6 $ Bedrooms 13;

Correct Answer: 3 Exp: Column input specifies the variable's name, followed by a dollar ($) sign if the values are character values, and the beginning and ending column locations of the raw data values.

Question 6: Which PROC PATIENT_DATA step produced this two-way table?

Correct Answer: 4 Exp: An asterisk is used to join the variables in a two-way TABLES statement. The first variable forms the table rows. The second variable forms the table columns

Question 3: Which one of the following SAS DATA steps saves the temporary data set named HADOOPDATA as a permanent data set? 1. libname sasdata 'SAS-data-library'; data sasdata.hadoopdata; copy hadoopdata; run; 2. libname sasdata 'SAS-data-library'; data sasdata.hadoopdata; keep hadoopdata; run; 3. libname sasdata 'SAS-data-library'; data sasdata.hadoopdata; save hadoopdata; run; 4. libname sasdata 'SAS-data-library'; data sasdata.hadoopdata; set hadoopdata; run;

Correct Answer: 4 Exp: COPY statement exists in SAS. However, it cannot be used inside a Data step so A is not a correct answer. COPY statement cannot be used in datastep. It is used in a proc step as follow: proc copy in=work out=sasuser; select datasetname; run; Required Arguments OUT=libref-1 names the SAS library to copy SAS files to. Aliases: OUTLIB= and OUTDD= Featured in: Manipulating SAS Files IN=libref-2 names the SAS library containing SAS files to copy. Aliases: INLIB= and INDD= Default: the libref of the procedure input library To copy only selected members, use the SELECT or EXCLUDE statements.

Question 2: The following SAS DATA step is submitted: data sasdata.allahabad sasdata.bhilai work.portblair work.pune; set company.prdsales; if region = 'NE' then output bhilai; if region = 'SE' then output allahabad; if region = 'SW' then output pune; if region = 'NW' then output portblair; run; Which one of the following is true regarding the output data sets? 1. No library references are required 2. The data sets listed on all the IF statements require a library reference 3. The data sets listed in the last two IF statements require a library reference. 4. The data sets listed in the first two IF statements require a library reference.

Correct Answer: 4 Exp: SAS automatically assigns the lib Work when a lib is not specified. If you want to assign your data set to a libname other than Work, you must explicitly define (point to a location in a LIBNAME statement) the library before it can be assigned output bhilai; (sasdata.allahabad) output allahabad; (sasdata.bhilai) Note: If a SAS session is terminated improperly (for example, using the kill -9 command), SAS will not delete the SAS_workcode_nodename directory. You might want to use the cleanwork command to delete straggling directories

Question 9: How many observations will the data set Work.Employee contain? data work.employee; Value=2000; do year=1 to 20; Interest=value*.075; value+interest; output; end; run; 1. 0 2. 1 3. 19 4. 20

Correct Answer: 4 Exp: The number of observations is based on the number of times the OUTPUT statement executes. The new data set has 20 observations, one for each iteration of the DO loop. The OUTPUT statement tells SAS to write the current observation to a SAS data set immediately, not at the end of the DATA step. If no data set name is specified in the OUTPUT statement, the observation is written to the data set or data sets that are listed in the DATA statement.

Question 4: You have submitted the SAS DATA step as below: libname temp 'SAS-data-library'; data temp.employee; set sasuser.employer; totalsal = price * 1.04; run; Which one of the following statements is true regarding the program above? 1. The program is reading from a temporary data set and writing to a temporary data set. 2. The program is reading from a temporary data set and writing to a permanent data set. 3. The program is reading from a permanent data set and writing to a temporary data set. 4. The program is reading from a permanent data set and writing to a permanent data set.

Correct Answer: 4 Exp: reading from a permanent data set temp.employee and writing to a permanent data set sasuser.employer

Given a CAS table employees : In the space below, write a CASL statement to create a variable named emp that holds a dictionary to be used in the following CAS action to indicate the table name. Include only a reference to the table name. <enter statement here> simple.summary / table=emp;

Correct answer: emp.name = "employees"; or emp["name"] = "employees";

The following SAS program is submitted: data WORK.LOOP; X = 0; do Index = 1 to 5 by 2; X = Index; end; run; Upon completion of execution, what are the values of the variables X and Index in the SAS data set named WORK.LOOP? A. X = 3, Index = 5 B. X = 5, Index = 5 C. X = 5, Index = 6 D. X = 5, Index = 7

D

The following SAS program is submitted: data WORK.TEMP; Char1='0123456789'; Char2=substr(Char1,3,4); run; What is the value of Char2? A. 23 B. 34 C. 345 D. 2345

D

Which action from the table action set lists the files in a caslib's data source? A. tableInfo B. caslibInfo C. tableDetails D. fileInfo

D

Which program associates the format regnm with the region column in the orders table? A. proc casutil; load data=work.orders casout="orders" outcaslib="public"; format region regnm.; quit; B. proc casutil; load data=work.orders casout="orders" outcaslib="public" format=yes; format region regnm.; quit; C. proc casutil; format region regnm.; load data=work.orders casout="orders" outcaslib="public" format=yes; quit; D. proc casutil; format region regnm.; load data=work.orders casout="orders" outcaslib="public"; quit;

D

Combine character variable

Function (double stroke): to combine two character values

Input

Function: create a SAS data set with specified contents Describes the arrangement of variables in the input data record and assigns input values to the corresponding sass variables

Datalines

Function: create a SAS data set with specified contents Indicates that data lines follow

if-then statement

Function: set conditional statement to execute different functions

Sum function

Function: to add up variables

Square / Square Root

Function: to calculate square and square root of a numeric value

Format

Function: to change the format of the variable

Label

Function: to change the label of the variable Assigns descriptive labels to variables

Length

Function: to change the length of the variable

Proc Freq

Function: to compute frequency count and percentage of a variable The freak procedure produces one way to n-way frequency and contingency (cross tabulation) tables

Proc Means

Function: to compute summary statistics such as mean, standard deviation and median

Mean, Min, Max

Function: to compute the mean, minimum and maximum of a set of numeric values

PUT

Function: to convert a anumeric value into a character value

INPUT

Function: to convert a character value into a numeric value

Proc Transpose

Function: to convert rows into columns in a data set

Upcase, lowcase, propcase

Function: to convert the character value into upper case (UPCASE), lower case (LOWCASE) or proper case (PROPCASE) Note: Proper case = Upper case in the first letter of each word and lower case in the rest

ABS

Function: to convert the numeric value into an absolute value

Log

Function: to convert the numeric value into logarithm

Set statement

Function: to copy the contents from one data set into another

DATA step

Function: to create SAS data sets

Libname Statement

Function: to create a SAS library

Random Variable (Uniform)

Function: to create a random value from a uniform distribution

Random Variable (Exponential

Function: to create a random value from an exponential distribution

Proc Report

Function: to create a report from the data set

Proc GChart

Function: to create pie chart or histogram

Substr

Function: to extract partial text from a character value

Index

Function: to identify the position where the specified text is found from a character value

Keep, drop statement

Function: to keep only the variables needed in the data set

Merge statement

Function: to merge multiple data set into one

Basic mathematical operation

Function: to perform basic mathematical operations

Proc GLM

Function: to perform general linear modeling

Proc Reg

Function: to perform regression analysis

Proc Gplot

Function: to plot graphs

PROC step

Function: to preform data manipulation, statistical analysis and report/ graph production

Proc Print

Function: to print the content of the data set

Infile statement

Function: to read in an external data file

Trim / Compress

Function: to remove trailing space (TRIM) or to remove all spaces (COMPRESS) from a character value

Rename

Function: to rename a variable

Round / Floor

Function: to round a numeric value

Proc Sort

Function: to sort a data set

FILENAME statement

Function: to specify the external data file

Work Library:

The Work library is the temporary library that is automatically defined by SAS at the beginning of each SAS session or job. The Work library stores temporary SAS files that you create, as well as files created internally by SAS. To access files in the Work library, specify a one-level name for the file. The libref Work is automatically assigned to these files unless you have assigned the User libref. When you invoke SAS, it assigns the Work libref to a subdirectory of the directory specified in the WORK system option described in System Options under UNIX. This subdirectory is usually named SAS_workcode_nodename , where:

tables

The table statement requests one-way to n-way frequency and cross tabulation tables and statistics for those tables. By default the tables display the frequency, percent, cumulative frequency, and cumulative percent of every value of the specified variables

weight count;

The weight statement uses count to weigh the observations The wait statement names and numerical variable that provides a weight for each observation in the input dataset

YRBS

Youth Risk Behavior Survey

Which ends a step? A. a RUN statement B. an END statement C. an ENDSTEP statement D. a semicolon

a

Which DATA step function is supported in CAS? A. SYMGET B. CATX C. FILEREF D. RANUNI

b

Which statement is true about the code shown below? data revenue; merge sales(in=sold) stock; by productID; if sold; run; A. Only columns from sales are in revenue. B. Only rows with information from sales are in revenue. C. Only columns from stock are in revenue. D. Only rows with information from stock are in revenue.

b

Given the SAS log shown below: 199 dat students; --- 14 WARNING 14-169: Assuming the symbol DATA was misspelled as dat. 200 set sashelp.class; 201 ratio=height/weight; 202 run; NOTE: There were 19 observations read from the data set SASHELP.CLASS. NOTE: The data set WORK.STUDENTS has 19 observations and 6 variables. 203 204 proc means data=students; 205 class sex; 206 var ratio; 207 run; NOTE: There were 19 observations read from the data set WORK.STUDENTS. Which statement is true? A. The PROC MEANS step failed. B. The DATA step failed. C. The DATA step and PROC MEANS step executed. D. The program stopped processing after the DATA step.

c

Which statement is true regarding variable names? A. Variable names are from 1 to 64 characters in length. B. Variable names must be in all lower case. C. Variable names can start with a number. D. Variable names can end with a number.

d

nodename:

is the name of the UNIX computer where the SAS process is running. This libref cannot be cleared or reassigned during a SAS session.


Related study sets

Insurance Pre-licensing : Chapter 1 quiz

View Set

Test 1: Sissejuhatus anatoomiasse ja füsioloogiasse

View Set

Week 3 Quiz "Electricity" Units 26 & 28

View Set

Network + Chapter 8 Review Questions

View Set

9.7 - Methods of State Registration of Securities

View Set