Premium

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



Question : You have been given below data

With the following SAS statements
If course_name=SAS AND DURATION=30
Then FEE=10000;
If LOCATION=PUNE or COURSE_ID=100
Then MESSAGE=LOW;

What would the correct values of the variable?

 : You have been given below data
1. FEE=5000 MESSAGE=LOW

2. FEE=10000 MESSAGE=LOW

3. Access Mostly Uused Products by 50000+ Subscribers

4. FEE=10000 MESSAGE=


Correct Answer : Get Lastest Questions and Answer :
Explanation: As you can see in the given condition
AND : If both the conditions are true than final value will be true. In the given dataset COURSE_NAME='SAS' and DURATION=30
both are true. Hence then part will be executed so fee will become 10000.
Next IF condition uses OR operator. Hence, any one condition is true than final value will also be true.
So message will be 'LOW'So 2nd is a correct answer.






Question : Which is the correct statement regarding length of a variable in a SAS program?
A. As soon as variable appear in data step and its value derive the length.
B. Whatever length explicitly defined will be the length of that variable
C. As soon as you do the assignment

 : Which is the correct statement regarding length of a variable in a SAS program?
1. A,B
2. B,C
3. Access Mostly Uused Products by 50000+ Subscribers
4. A,C

Correct Answer : Get Lastest Questions and Answer :
Explanation: It depends on various scenario, how to derive the actual length of a variable.
If variable first found in data step with its value like v1=Low. Then its length will be decided as 3 byte. You can also explicitly define the
variable length if not known initially using length statement like this length FEETYPE $ 8; It says FEETYPE is 8 character long variable.





Question : You have been given below program
If course_name=SAS then fee=7000;
If course_name=HADOOP then FEE=8000;
If course_name^=HADOOP and COURSE_NAME^=SAS then FEE=5000;

Which of the following SAS program will be the same as given above?

 : You have been given below program
1. IF COURSE_NAME=SAS then FEE=7000;
Else if COURSE_NAME=HADOOP then FEE=8000;
Else FEE=5000;


2. IF COURSE_NAME=SAS then FEE=7000;
if COURSE_NAME=HADOOP then FEE=8000;
Else FEE=NULL;


3. Access Mostly Uused Products by 50000+ Subscribers
Else COURSE_NAME=HADOOP then FEE=8000;
Else FEE=5000;


4. IF COURSE_NAME=SAS then FEE=7000;
SELECT if COURSE_NAME=HADOOP then FEE=8000;
Else FEE=5000;


Correct Answer : Get Lastest Questions and Answer :
Explanation: Its all about which expression result in same result. Difference between forst option and given program is that. Given in
question will evaluate each condition and will make program slower to execute. In option 1 only conditions will be executed until match happen. So in
this case if nothing or last stamen match then considered worst case which is equal to the same in case of given question.


Related Questions


Question : A SAS program is submitted and the following SAS log is produced:
2 data gt100;
3 set ia.airplanes
4 if mpg gt 100 then output;
22 202
ERROR: File WORK.IF.DATA does not exist.
ERROR: File WORK.MPG.DATA does not exist.
ERROR: File WORK.GT.DATA does not exist.
ERROR: File WORK.THEN.DATA does not exist.
ERROR: File WORK.OUTPUT.DATA does not exist.
ERROR 22-322: Syntax error, expecting one of the following: a name,
a quoted string, (, ;, END, KEY, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
5 run;
The IA libref was previously assigned in this SAS session.
Which one of the following corrects the errors in the LOG?

  : 	A SAS program is submitted and the following SAS log is produced:
1. Delete the word THEN on the IF statement.
2. Add a semicolon at the end of the SET statement.
3. Place quotes around the value on the IF statement.
4. Add an END statement to conclude the IF statement




Question : The contents of the raw data file CALENDAR are listed below:
--------10-------20-------30
The following SAS program is submitted:
data test;
infile 'calendar';
input @1 date mmddyy10.;
if date = '01012000'd then event = 'January 1st';
run;
Which one of the following is the value of the EVENT variable?


  : The contents of the raw data file CALENDAR are listed below:
1. 01012000
2. January 1st
3. (missing numeric value)
4. The value cannot be determined as the program fails to execute due to errors.



Question : The following SAS program is submitted:

data work.january;
set work.allmonths (keep = product month num_sold cost);
if month = 'Jan' then output work.january;
sales = cost * num_sold;
keep = product sales;
run;
Which variables does the WORK.JANUARY data set contain?

  : The following SAS program is submitted:
1. PRODUCT and SALES only
2. PRODUCT, MONTH, NUM_SOLD and COST only
3. PRODUCT, SALES, MONTH, NUM_SOLD and COST only
4. An incomplete output data set is created due to syntax errors



Question : The following SAS program is submitted:
data work.totalsales;
set work.monthlysales(keep = year product sales);
retain monthsales {12} ;
array monthsales {12} ;
do i = 1 to 12;
monthsales{i} = sales;
end;
cnt + 1;
monthsales{cnt} = sales;
run;
The data set named WORK.MONTHLYSALES has one observation per month for each of five years for a total of 60 observations. Which one of the following is the result of the above
program?
  : The following SAS program is submitted:
1. The program fails execution due to data errors.
2. The program fails execution due to syntax errors.
3. The program runs with warnings and creates the WORK.TOTALSALES data set with 60 observations.
4. The program runs without errors or warnings and creates the WORK.TOTALSALES data set with 60 observations.



Question : The following SAS program is submitted:
data work.totalsales (keep = monthsales{12} );
set work.monthlysales (keep = year product sales);
array monthsales {12} ;
do i=1 to 12;
monthsales{i} = sales;
end; run;
The data set named WORK.MONTHLYSALES has one observation per month for each of five years for a total of 60 observations.
Which one of the following is the result of the above program?
 :  The following SAS program is submitted:
1. The program fails execution due to data errors.
2. The program fails execution due to syntax errors.
3. The program executes with warnings and creates the WORK.TOTALSALES data set.
4. The program executes without errors or warnings and creates the WORK.TOTALSALES data set.


Question : The following SAS program is submitted:
data test;
set sasuser.employees;
if 2 le years_service le 10 then
amount = 1000;
else if years_service gt 10 then
amount = 2000;
else
amount = 0;
amount_per_year = years_service / amount;
run;
Which one of the following values does the variable AMOUNT_PER_YEAR contain if an employee has been with the company for
one year?

  : The following SAS program is submitted:
1. 0
2. 1000
3. 2000
4. . (missing numeric value)