Shared Flashcard Set

Details

SAS Programming EOC
EOC review
40
Other
12th Grade
01/05/2010

Additional Other Flashcards

 


 

Cards

Term

A SAS program is

  

 

a. a sequence of steps that the user submits for execution.

b. all answer choices

c. compiles, then executes.

d. always made up of either data steps and proc steps.  

 

 

 

 

 

 

 

 

 

 

Definition
[image]
Term

SAS detects the end of a step when it encounters

 

I.   a RUN statement
II.  a QUIT statement
III. the beginning of another step
      

 

 

  1. I only
  2. I and II only
  3. I and III only

d.  I, II and III

Definition
[image]
Term

DROP= and KEEP= statements apply to what data sets?

 

 

a. Output data sets only

b. Input data sets only

c. Both input and output data sets

d. Neither the input nor the output data sets.

Definition
[image]
Term

The default statistics produced by the MEANS procedure are n-count (N), mean, minimum, maximum, and

 

 

a)     range.

b)     standard deviation.

c)      median.

d)     standard error of the mean.

Definition
[image]
Term

When would you use the ODS CSVALL statement?

 

 

 

a.      To create a tab-delimited file

b.     To read a comma-delimited file

c.      To create a comma-delimited file

d.     To read a tab-delimited file to a comma-delimited file

Definition
[image]
Term

What does PROC PRINT display by default?

 

a)     PROC PRINT does not create a default report; you must specify the rows and columns to be displayed.

b)     PROC PRINT displays all observations and variables in the data set, a column for observation numbers on the far left, and variables in the order in which they occur in the data set.

c)      PROC PRINT displays all observations and variables in the data set. If you want an additional column for observation numbers, you can request it.

Definition
[image]
Term

Which function calculates the average of the variables Var1, Var2, Var3, and Var4?

 

a. mean(of var1-var4)

b. mean(of var1, var4)

c. mean(var1-var4

d. mean(var1, var4)

Definition
[image]
Term

A typical value for the character variable Target is 123,456. Which statement correctly converts the values of Target to numeric values when creating the variable TargetNo?

 

a. TargetNo=input(target,comma6.);

b. TargetNo=input(target,comma7.);

c. TargetNo=put(target,comma6.);

d. TargetNo=put(target,comma7.);

Definition
[image]
Term

What is a specially structured file that contains data values?

 

 

    1. SAS program
    2. SAS data set
    3. SAS code
    4. SAS proc step

Definition
[image]
Term

In the SAS Log, notes are written in ___________, warnings are written in ______________, and errors are written in _________________.

 

    1. green, blue, red
    2. black, blue, red
    3. black, green, red
    4. blue, green, red
Definition
[image]
Term

Which of the following SAS names is valid?

 

 

  1. 2006PromCosts 
  2. yr  2006  PromCosts
  3. $2006Prom_Costs
  4. _2006Prom_Costs
Definition
[image]
Term

What happens if you submit the following program?

proc sort data=pe.fit_test;
run;

proc print data=pe.fit_test;
   var age height weight pulse;
   where sex='F';
run;

 

  1. The PROC PRINT step runs successfully, printing observations in their sorted order.
  2. The PROC SORT step permanently sorts the input data set.
  3. The PROC SORT step generates errors and stops processing, but the PROC PRINT step runs successfully, printing observations in their original (unsorted) order.
  4. The PROC SORT step runs successfully, but the PROC PRINT step generates errors and stops processing.
Definition
[image]
Term

All of the following are created at compile time, except

 

 

  1. the input buffer.
  2. the program data vector
  3. the descriptor portion
  4. the data portion
Definition
[image]
Term

What is the product of each of the phases of the DATA step?

 

 

 

  1. The compilation phase creates the data portion and the execution phase creates the descriptor portion.
  2. The compilation phase creates the descriptor portion and the execution phase creates the data portion.
  3. The compilation phase and the execution phase creates the data portion.
  4. The compilation phase and the execution phase creates the descriptor portion.
Definition
[image]
Term

Which of the following PROC PRINT steps is correct if labels are not stored with the data set?

 

 

  1. proc print data=univ.public label;
         label acc='ACC Universities';
    run;
  2. proc print data=univ.public;
         label ACC='ACC Universities';
    run;
  3. proc print data univ.public label noobs;
    run;
  4. proc print univ.public label;
    run;
Definition
[image]
Term

Which of the following statements would apply the DOLLARw.d to the value Tuition if you want to show the dollar sign, a comma and no decimal places. The largest value is 15000.

 

 

 

  1. format tuition dollar5.0;
  2. format tuition dollar5;
  3. format tuition dollar8;
  4. format tuition dollar8.0;
Definition
[image]
Term

Which of the following FORMAT procedures is written correctly?

 

 

  1. proc format lib=library;
       value colorfmt
         1='Red'
         2='Green'
         3='Blue';
    run;
  2. proc format lib=library
       value colorfmt;
         1='Red'
         2='Green'
         3='Blue';
    run;
  3. proc format lib=library;
       value colorfmt;
         1='Red'
         2='Green'
         3='Blue'
    run;
  4. proc format lib=library;
       value colorfmt;
         1='Red';
         2='Green';
         3='Blue';
    run;
Definition
[image]
Term

Suppose the YEARCUTOFF= system option is set to 1920. Which MDY function creates the date value for January 3, 2020?

 

 

  1. MDY(1,3,20)
  2. MDY(3,1,20)
  3. MDY(1,3,2020)
  4. MDY(3,1,2020)
Definition
[image]
Term

A typical value for GPA is 3.26541. Which statement correctly rounds to the hundredth position?

 

 

  1. newgpa = round(gpa, 100)
  2. newgpa = round(gpa, 2)
  3. newgpa = round(gpa, .01)
  4. newgpa = round(gpa, '.01')
Definition
[image]
Term

You can position the input pointer on a specific record by using

 

 

  1. line hold specifiers.
  2. line pointer controls.
  3. column specifications.
  4. column pointer controls.
Definition
[image]
Term

Which statement is false regarding the sum statement?

 

 

  1. The sum statement ignores missing values.
  2. The sum statement requires a retain statement.
  3. The sum statement initializes the variable to zero before the first iteration of the DATA step.
  4. The sum statement creates the variable on the left side of the plus sign if it does not already exist.
Definition
[image]
Term

What is the result of submitting the following program? There are 453 students with class = 'F', 436 students with class='S', 398 students with class='J' and 412 students with class = 'Sr'. There are a total of 1752 observations.

 

data frshmn soph junr senr undef;
    set ahs.students;
    if class = 'F' then
         output frshmn;
   else if class = 'S' then
         output soph;
   else if class = 'J' then
         ouput junr;
   else if class = 'Sr' then
         output senr;
run;

 

 

  1. one data set with 752 observations
  2. four data sets -
      frshnm with 453 observations
      soph with 436 observations
      junr with 398 observations
      senr with 412 observations
  3. four data sets -
      frshnm with 605 observations
      soph with 588 observations
      junr with 600 observations
      senr with 564 observations
  4. No new data sets were created.
Definition
[image]
Term

What is the result of putting an output statement without a data set name?

 

 

  1. SAS will ignore the current observation.
  2. SAS will output to every data set on the DATA statement.
  3. SAS will create a new data set in which to output these observations.
  4. SAS will not output observations to the data sets in the DATA statement.
Definition
[image]
Term

If you submit the following program, which variables appear in the new data set?

 

data work.cardiac(drop=age group);
   set clinic.fitness(keep=age weight group);
   if group=2 and age>40;
run;

 

 

  1. weight
  2. group
  3. age, group
  4. age, weight
Definition
[image]
Term

The data set student.seniors includes the following variables. Which is a poor candidate for the PROC MEANS analysis?

 

 

  1. StudID
  2. GPA
  3. Age
  4. SAT
Definition
[image]
Term

Which statement correctly re-defines the values of the variable Allowance as 100 percent higher?

 

 

  1. allowance=*200;
  2. allowance=allowance*1.00;
  3. allowance = allowance*2;
  4. allowance=allowance+(allowance*2.00);
Definition
[image]
Term

Which statement correctly creates a SAS data set using a SAS data set as input?

 

 

  1. set vacation.beach;
  2. set=vacation.beach;
  3. input vacation.beach;
  4. input=vacation.beach;
Definition
[image]
Term

Which function statement will return the same value as the following expression?

 

save = allow – exp;

 

 

  1. save = diff(allow, -exp)
  2. save = sum(allow, -exp)
  3. save = diff(allow, exp)
  4. save = sum(allow, exp)
Definition
[image]
Term

Which statement would correctly assign the day of the week from today's date to the variable Day?

 

 

  1. Day = today();
  2. Day = weekday(today);
  3. Day = weekday(today());
  4. Day = today(weekday());
Definition
[image]
Term

The default title is

  

  1. The SAS System
  2. SAS Programming
  3. SAS v. 9
  4. The SAS System v. 9
Definition
[image]
Term

Which statement is false regarding the use of DO loops?

 

  1. They can be used to read data.
  2. They can contain conditional clauses.
  3. They can generate multiple observations.
  4. They can be used to combine DATA and PROC steps.
Definition
[image]
Term

During each execution of the following DO loop, the value of Earned is calculated and is added to its previous value. How many times does this DO loop execute?

data finance.earnings;
     Amount=1000;
     Rate=.075/12;
     do month=1 to 12;
          Earned+(amount+earned)*rate;
     end;
run;

 

 

  1. 0
  2. 1
  3. 12
  4. 13
Definition
[image]
Term

On January 1 of each year, $5,000 is invested in an account. Complete the DATA step below to determine the value of the account after 15 years if a constant interest rate of 10% is expected.

 

     data work.invest;
         ____________
             Capital+5000;
             capital+(capital*.10);
         end;
     run;

 

 

  1. do count=1 to 15;
  2. do count=1 to 15 by 10%;
  3. do count=1 to capital;
  4. do count=capital to (capital*.10);
Definition
[image]
Term

Which statement is false regarding DO UNTIL statements?

 

 

  1. The condition is evaluated at the top of the loop, before the enclosed statements are executed.
  2. The enclosed statements are always executed at least once.
  3. SAS statements in the DO loop are executed until the specified condition is true.
  4. The DO loop must have a closing END statement.
Definition
[image]
Term

Select the DO WHILE statement that would generate the same result as the program below.

data work.invest
   capital=100000
   do until(Capital gt 500000);
         Year+1;
         capital+(capital*.10);
   end;
run;

 

 

  1. do while(Capital=500000)
  2. do while(Capital le 500000);
  3. do while(Capital ge 500000);
  4. do while(Capital>500000);
Definition
[image]
Term

In the following program, complete the statement so that the program stops generating observations when Distance reaches 250 miles or when 10 gallons of fuel have been used (this is a conditional statement, which loop would be used).

data work.go250;
   set perm.cars;
   do gallons=1 to 10 ... ;
       Distance=gallons*mpg;
       output;
   end;
run;

 

 

  1. until(Distance=250)
  2. over(Distance le 250)
  3. when(Distance>250)
  4. while(Distance<250)
Definition
[image]
Term

Which statement is false regarding an ARRAY statement?

 

 

  1. It must be used to define an array before the array name can be referenced.
  2. It must contain either all numeric or all character elements.
  3. It is an executable statement.
  4. It can be used to create variables.
Definition
[image]
Term

What belongs within the braces of this ARRAY statement?
      array contrib{?} qtr1-qtr4;

 

 

  1. 4
  2. 1-4
  3. quarter*
  4. quarter
Definition
[image]
Term

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;
Definition
[image]
Term

What is the value of the index variable that references Jul in the statements below?

array quarter{4} Jan Apr Jul Oct;
     do i=1 to 4;
         yeargoal=quarter{i}*1.2;
     end;

 

 

  1. 1
  2. 2
  3. 3
  4. 4
Definition
[image]
Supporting users have an ad free experience!