Premium

Base SAS Certified Associate: Programming Fundamentals Using SAS Questions and Answers (Dumps and Practice Questions)



Question :

The following SAS program is submitted:
data work.new;
length word $7;
amount = 7;
if amount = 5 then word = 'CAT';
else if amount = 7 then word = 'DOG';
else word = 'NONE!!!';
amount = 5;
run;
Which one of the following represents the values of the AMOUNT and WORD variables?

  :
1. amount word
5 DOG
2. amount word
5 CAT
3. Access Mostly Uused Products by 50000+ Subscribers
7 DOG
4. amount word
7 ' ' (missing character value)

Correct Answer : Get Lastest Questions and Answer :

Explanation: always "Dog" will be assigned to word as amount is hardcoded 7 in the begining of each iteration
and a value of 5 is saved in amount as it is hardcoded before the end of each output.

This question checks your knowledge about how sas reads. When SAS reads in the iterations in sequence, it first writes 5 to the variable 'amount'in PDV. Then it reads through the
condition and writes 'DOG' for variable 'word' in PDV. Then it again encounters the value 7 and writes to 'Amount' in PDV. As this is not a loop and run statement follows, SAS gives
the output from PDV which would be 5 and 'Dog'








Question :

When the following SAS program is submitted, the data set SASDATA.PRDSALES contains 5000 observations:
libname sasdata 'SAS-data-library';
options obs = 500;
proc print data = sasdata.prdsales (firstobs = 100);
run;
options obs = max;
proc means data = sasdata.prdsales (firstobs = 500);
run;
How many observations are processed by each procedure?

  :
1. 400 for PROC PRINT
4500 for PROC MEANS
2. 401 for PROC PRINT
4501 for PROC MEANS
3. Access Mostly Uused Products by 50000+ Subscribers
4500 for PROC MEANS
4. 500 for PROC PRINT
5000 for PROC MEANS

Correct Answer : Get Lastest Questions and Answer :

Explanation: OBS option will let SAS know last observation to process. FIRSTOBS option will let SAS know first observation to process. So for first proc print FIRSTOBS =100 and OBS (i like
to call it LASTOBS) = 500, so there are 401 observation (including 100th observation) processed by it.
Now for proc means FIRSTOBS=500 and OBS (or LASTOBS) = Max (or 5000 in this case), so there are 4501 observation (including 500th observation) is processed by it.

An easy way to figure out how many observations are between a first observation at 100 (firstobs=100) and a last observation (obs=500) at 500 is to simplify it first.

Let's say I want to know how many observations are between my first observation (firstobs=1) at 1, and my last observation (obs=5) at 5. There are: 1.. 2.. 3.. 4.. 5. If I'm
subtracting (5-1=4), I'm not counting that last observation. And you know, even just by counting your fingers, there are 5 observations between 1 and 5. So it's really (5-1+1=5).
This is the same thing with firstobs=100 and obs=500. (500-100+1=401).





Question :

In the following SAS program, the input data files are sorted by the NAMES variable:
libname temp 'SAS-data-library';
data temp.sales;
merge temp.sales
work.receipt;
by names;
run;
Which one of the following results occurs when this program is submitted?


  :
1. The program executes successfully and a temporary SAS data set is created.
2. The program executes successfully and a permanent SAS data set is created.
3. Access Mostly Uused Products by 50000+ Subscribers
4. The program fails execution because the SAS data sets on the MERGE statement are in two different libraries.

Correct Answer : Get Lastest Questions and Answer :

Explanation: Both datasets sales and receipt are sorted by names variable which in turn is used to merge the two datasets. The resulting dataset is over-written on temp.sales dataset. As
temp is a permanent library unlike work (which is temparory) option B is the right choice

1)temp is declared as a permanent lib so permanent dataset will be craeted
2)same dataset can be read and write in a step
3)work and perm datasets can be merged




Related Questions


Question : You have been given below array declaration

array fee{4} fee1 fee2 fee3 fee4;

which of the following option correctly process all the variable declared in array ?

A. do i=1 to dim(fee);
B. do i=1 to dim(*);
C. do i=1,2,3,4;
D. do i=1 to 4;

 : You have been given below array declaration
1. A,B,C
2. B,C,D
3. Access Mostly Uused Products by 50000+ Subscribers
4. A,B,D


Question : You have similar variables in your dataset like sales of last months jan, feb, mar, apr, may, jun. And you wanted to do some
calculations on those variable referencing them through array, which of the following statement is correct with regards to array?

A. All newly created variable through array will be added in compilation stage of data step
B. Only numeric variables can be created through array declaration
C. Only character variables can be created through array declaration.
D. It is not mandatory to define all the variables explicitly while array declaration.

 : You have similar variables in your dataset like sales of last  months jan, feb, mar, apr, may, jun. And you wanted to do some
1. A,B
2. B,C
3. Access Mostly Uused Products by 50000+ Subscribers
4. A,D
5. B,D


Question : You have been given below data set and program



data course100 (drop=index);
set course101;
array existing{99:100} fee DURATION;
array new_values{99:100} nfee nduration;

do index=99 to 100;
put _all_;
new_values{index}=existing{index}+existing{index}*.10;
end;
run;

What is the value of nduration variable for course_id=104

 : You have been given below data set and program
1. 55

2. 88

3. Access Mostly Uused Products by 50000+ Subscribers

4. 77



Question : You have been given below program

data PREDICTED (drop=WEIGHT index );
set User ;
array month_{6} xxxx (1,2,3,4,5,6) ;
array weigh_{6} ;
EXISTING_WEIGHT=WEIGHT;
do index=1 to dim(month_);

put _all_;
weigh_{index}=month_{index}+WEIGHT+WEIGHT*.02;
WEIGHT=weigh_{index}

end;
run;

proc print data=PREDICTED;run;

What value you will put in place of xxxx , so that all month_ variable become temporary and will not be part of output?

 : You have been given below program
1. _temporary_

2. temporary

3. Access Mostly Uused Products by 50000+ Subscribers

4. missing

5. blank space



Question : You have been given below dataset



Which of the following will correctly read the files.

 : You have been given below dataset
1. input ID $1-3 IDnum $4-11 @13 Fee comma8. LOCATION $ 22-35;

2. input ID 1-3 $ IDnum 4-11 $ @13 Fee comma8. LOCATION 22-35 $;

3. Access Mostly Uused Products by 50000+ Subscribers

4. input ID 1-3 IDnum 4-11 @13 Fee comma8. LOCATION 22-35;




Question : You have been given some data in a text file at below location and you tried to read it is using SAS column input.
filename course22 '/folders/myfolders/hedata/course22.txt;

Which of the following statements are correct with regards to column input?

A. If your datasets column has blank spaces than it can be read using column input.
B. If data is missing than it is not mandatory to have placeholder.
C. You can read either standard or non-standard values
D. It is not necessary that data stored in course22.txt file should be separated by either comma or space.

 : You have been given some data in a text file at below location and you tried to read it is using SAS column input.
1. A,B,C
2. B,C,D
3. Access Mostly Uused Products by 50000+ Subscribers
4. A,B,D