Premium

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



Question : Which one of the following SAS statements correctly computes the average of four numerical values?

 : Which one of the following SAS statements correctly computes the average of four numerical values?
1. average = mean(num1 - num4);
2. average = mean(of num1 - num4);
3. Access Mostly Uused Products by 50000+ Subscribers
4. average = mean(num1 num2 num3 num4);

Correct Answer : Get Lastest Questions and Answer :

Explanation: Function mean Syntax is

avg=Mean(x, y, z);
avg=Mean(of x1-x10);
avg=Mean(of x y z);

Answer B. average = mean(of num1 - num4);

The problem with the D is the coma between the variable.
It can be either mean (of var1, var2, var 3, var4)
or mean (var1, var2, var 3, var4) or mean (of var1-var4) but can not be mean (of var1 to var4) or mean (var1-var4)







Question :

The following SAS program is submitted:
data work.test;
Author = 'Agatha Christie';
First = substr(scan(author,1,' ,'),1,1);
run;
Which one of the following is the length of the variable FIRST in the output data set?

 :
1. 1
2. 6
3. Access Mostly Uused Products by 50000+ Subscribers
4. 200

Correct Answer : Get Lastest Questions and Answer :

Explanation: Yes the default length for the variable on r.h.s of scan function is 200
Submit the following code and check the length of FIRST in the SAS output. Then, you can be sure that the correct answer is 4 because FIRST has a length of 200.

data work.test;
Author = 'Agatha Christie';
First = substr(scan(author,1,' ,'),1,1);
run;
proc contents;
run;
Alphabetic List of Variables and Attributes

# Variable Type Len

1 Author Texte 15
2 First Texte 15


In fact, with susbstr, SAS keep the length of the variable "author". Here, it's 15.

Then, the default length of a scan function is 200.

So, because we use a scan function inside the substr function, the length of "first" will be the same as the length for scan - -> 200







Question :

The following SAS program is submitted:
data work.test;
Author = 'Christie, Agatha';
First = substr(scan(author,2,' ,'),1,1);
run;
Which one of the following is the value of the variable FIRST in the output data set?


 :
1. A
2. C
3. Access Mostly Uused Products by 50000+ Subscribers
4. ' ' (missing character value)

Correct Answer : Get Lastest Questions and Answer :

Explanation: Even if there is a space between the comma and the Agatha, it does not matter because 'blank' or ;space' is also one of the several(blank . ( + | & ! $ * ) ; ^ - / , %
default delimiters.

The default delimiters don't matter. The delimiters are defined. So the question is whether blank is a delimiter. Here it is whether the questioner meant it to be or not. Hence A is
the answer. Remove the blank from the list and D is the answer.

data work.test;
Author = 'Christie, Agatha';
First = substr(scan(author,2,' ,'),1,1);
run;

This has blank and comma as delimiters.

data work.test;
Author = 'Christie, Agatha';
First = substr(scan(author,2,','),1,1);
run;

This just commma.

Very hard thing to notice as you can see looking at the two. Hope nothing like that is on the base sas, too easy to make a mistake.





Related Questions


Question : How would you print entire detail of a user defined format?

 : How would you print entire detail of a user defined format?
1. CATALOG

2. ALLFORMAT

3. Access Mostly Uused Products by 50000+ Subscribers

4. FMTLIB



Question : By default MEANS procedure generates which of the following statistics?
A. Number of missing variables
B. Mean
C. Standard Deviation
D. RANGE
E. MINIMUM

 : By default MEANS procedure generates which of the following statistics?
1. A,B,C,E
2. B,C,D,E
3. Access Mostly Uused Products by 50000+ Subscribers
4. A,B,D,E


Question : You have a dataset named hadoopexam.dat, with various columns like course_name, fee, location, date, students etc. Now while using the
MEANS procedure you want that descriptive analysis can be done only for two variables course_name and fee, which of the following statement can be
helpful in that case?

 : You have a dataset named hadoopexam.dat, with various columns like course_name, fee, location, date, students etc. Now while using the
1. By course_name fee;

2. Class course_name fee;

3. Access Mostly Uused Products by 50000+ Subscribers

4. Var course_name fee;



Question : You have been given a data set named HESAMPLE with the column variables named COURSE_ID, COURSE_NAME, COURSE_FEE, STUDENTS. TRAINING_DATE
etc. which of the following is not a good fit for descriptive analytics using MEANS PROCEDURE?

 : You have been given a data set named HESAMPLE with the column variables named COURSE_ID, COURSE_NAME, COURSE_FEE, STUDENTS. TRAINING_DATE
1. COURSE_ID

2. COURSE_NAME

3. Access Mostly Uused Products by 50000+ Subscribers

4. STUDENTS

5. TRAINING_DATE



Question : You have been using PROC MEANS procedure for descriptive analytics, which of the following statement is true when you want to categorize
the data using BY statement?
A. Data must be already sorted or indexed in the order of the by statement.
B. Output will be generated in multiple tables instead of single
C. Data must not be already sorted or indexed in the order of the by statement.
D. Output will be generated in single tables instead of single

 : You have been using PROC MEANS procedure for descriptive analytics, which of the following statement is true when you want to categorize
1. A,B
2. B,C
3. Access Mostly Uused Products by 50000+ Subscribers
4. A,D
5. B,D


Question : Which of the given SAS code will generate the below output

 : Which of the given SAS code will generate the below output
1. proc means data=course2017 ;
by course_name fee;
run;

2. proc means data=course2017 ;
class course_name fee;
run;

3. Access Mostly Uused Products by 50000+ Subscribers
class fee course_name;
run;

4. proc means data=course2017 ;
class course_name ;
run;