Premium

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



Question : You have been given below program

data course2017 ;
input COURSE_ID 1-3 COURSE_NAME$ 5-20 LOCATION$ 22-30 FEE 32-35 DATE$ 36-47
DURATION 48-50;
DROP FEE;
TotalFee=(FEE*18/100)+FEE;
RETAIN ENTIREFEE 100000;
ENTIREFEE+TotalFee;
if LOCATION in ('PUNE','JODHPUR') then FEETYPE=MEDIUM;
length FEETYPE $ 8;

In this case what would be the length of a variable FEETYPE?

 : You have been given below program
1. 8

2. 6

3. Access Mostly Uused Products by 50000+ Subscribers

4. Not known


Correct Answer : Get Lastest Questions and Answer :
Explanation: Variable length can be determined by its first reference. Here, in the given program FEETYPE first refer by FEETYPE=MEDIUM.
Hence its length will be 6. If you want it to be set 8 than put the length statement before its first reference.




Question : In which of the following program either DROP or KEEP is wrongly used

 : In which of the following program either DROP or KEEP is wrongly used
1. data course2017 ;
input COURSE_ID 1-3 COURSE_NAME$ 5-20 LOCATION$ 22-30 FEE 32-35 DATE$ 36-47
DURATION 48-50;
DROP FEE;
TotalFee=(FEE*18/100)+FEE;
RETAIN ENTIREFEE 100000;
ENTIREFEE+TotalFee;

2. proc print data=course2017 lable;
DROP TotalFee;
var COURSE_ID COURSE_NAME LOCATION DATE DURATION ENTIREFEE MESSAGE ;
run;



3. Access Mostly Uused Products by 50000+ Subscribers
input COURSE_ID 1-3 COURSE_NAME$ 5-20 LOCATION$ 22-30 FEE 32-35 DATE$ 36-47
DURATION 48-50;
DROP FEE;
TotalFee=(FEE*18/100)+FEE;
RETAIN ENTIREFEE 100000;
ENTIREFEE+TotalFee;


4. data course2017 ;
input COURSE_ID 1-3 COURSE_NAME$ 5-20 LOCATION$ 22-30 FEE 32-35 DATE$ 36-47
DURATION 48-50;
DROP FEE;
KEEP COURSE_NAME;
TotalFee=(FEE*18/100)+FEE;
RETAIN ENTIREFEE 100000;
ENTIREFEE+TotalFee;



Correct Answer : Get Lastest Questions and Answer :
Explanation: You can use DROP and KEEP statement as below

- In any DATA step
- You can use it as an option DATA statement

But you cannot use them in the PROC step.





Question : You have been given below step

data course2017_1 (drop=DATE DURATION);
set course2017 (keep=COURSE_NAME FEE DATE DURATION);
run;

After running this which of the columns will be in the output?

 : You have been given below step
1. COURSE_NAME FEE DATE DURATION

2. DATE DURATION

3. Access Mostly Uused Products by 50000+ Subscribers

4. ERROR


Correct Answer : Get Lastest Questions and Answer :
Explanation: All the columns marked in DROP= option will be discarded in the output statement. And there will not be any error for keeping
both the KEEP= and DROP= overlapping. However, you should be more clear while writing the program that what option you want to keep and what option you
want to discard.




Related Questions


Question : The contents of the raw data file AMOUNT are listed below:

--------10-------20-------30
$1,234
The following SAS program is submitted:
data test;
infile 'amount';
input @1 salary 6.;
if _error_ then description = 'Problems';
else description = 'No Problems';
run;
Which one of the following is the value of the DESCRIPTION variable?



  : The contents of the raw data file AMOUNT are listed below:
1. Problems
2. No Problems
3. ' ' (missing character value)
4. The value can not be determined as the program fails to execute due to errors



Question : The contents of the raw data file NAMENUM are listed below:

--------10-------20-------30
Joe xx
The following SAS program is submitted:
data test;
infile 'namenum';
input name $ number;
run;
Which one of the following is the value of the NUMBER variable?
  : The contents of the raw data file NAMENUM are listed below:
1. xx
2. Joe
3. . (missing numeric value)
4. The value can not be determined as the program fails to execute due to errors.



Question : Which one of the following statements is true regarding the SAS automatic _ERROR_ variable?

  : Which one of the following statements is true regarding the SAS automatic _ERROR_ variable?
1. The _ERROR_ variable contains the values 'ON' or 'OFF'.
2. The _ERROR_ variable contains the values 'TRUE' or 'FALSE'.
3. The _ERROR_ variable is automatically stored in the resulting SAS data set.
4. The _ERROR_ variable can be used in expressions or calculations in the DATA step.


Question : Which one of the following is true when SAS encounters a data error in a DATA step?

  : Which one of the following is true when SAS encounters a data error in a DATA step?
1. The DATA step stops executing at the point of the error, and no SAS data set is created.
2. A note is written to the SAS log explaining the error, and the DATA step continues to execute.
3. A note appears in the SAS log that the incorrect data record was saved to a separate SAS file for further examination.
4. The DATA step stops executing at the point of the error, and the resulting DATA set contains observations up to that point.


Question : You have been given below dataset, how many observation and variables it has ?

 : You have been given below dataset, how many observation and variables it has ?
1. 10 Observation and 10 Variables

2. 9 Observation and 9 variables

3. 10 Observation and 9 variables

4. 9 observation and 10 variables

5. There is one value missing, so we cannot tell.




Question : You have been given below SAS program
data hadoopexam.courses;
infile hadoopexam1;
input name $ price ;
run;
proc sort data=hadoopexam.courses;
by price;
run;
proc print data=hadoopexam.courses;
run;

You run this program, than how many steps will be processed in total?


 : You have been given below SAS program
1. 1

2. 2

3. 3

4. 10

5. How SAS executes the steps internally, cannot be identified.