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.total;
set work.salary(keep = department wagerate);
by department;
if first.department then payroll = 0;
payroll + wagerate;
if last.department;
run;
The SAS data set WORK.SALARY, currently ordered by DEPARTMENT, contains 100 observations for each of 5 departments.
Which one of the following represents how many observations the WORK.TOTAL data set contains?

  :
1. 5
2. 20
3. Access Mostly Uused Products by 50000+ Subscribers
4. 500


Correct Answer : Get Lastest Questions and Answer :

Explanation: The most important statement in the program for this question is if last.department;
We will get output only if last.department becomes true and we know there are five departments and data is sorted by department so last.department will become true 5 times and thus 5
observation in output.







Question :
The following SAS program is submitted:
data work.total;
set work.salary(keep = department wagerate);
by department;
if first.department then payroll = 0;
payroll + wagerate;
if last.department;
run;
The SAS data set named WORK.SALARY contains 10 observations for each department, currently ordered by DEPARTMENT.
Which one of the following is true regarding the program above?

  :
1. The BY statement in the DATA step causes a syntax error.
2. FIRST.DEPARTMENT and LAST.DEPARTMENT are variables in the WORK.TOTAL data set.
3. Access Mostly Uused Products by 50000+ Subscribers
4. The values of the variable PAYROLL represent a total for all values of WAGERATE in the WORK.SALARY data set.


Correct Answer : Get Lastest Questions and Answer :

Explanation: When first.department is true payroll is set to 0. So the accumulator for each department is reset to 0 before accumulating. when you use PAYROLL + WAGERATE, variable payroll
will automatically be retained through-out the dataset. Its values is resetted at first observation of each department. The observations to output dataset total are output on last
observation of each department. So number of observation in total dataset are number of departments in salary dataset. Moreover wagerate is getting added to payroll and that value is
retained in payroll variable untill the next observation of same department is read. After that second observations wagerate gets added to payroll, so on and so forth untill all the
10 observations are read for a department. At last observation, payroll has the sum of all wagerate for that particular department and is outputed to total dataset. Hence answer is 3





Question :
The following SAS program is submitted:
libname sasdata 'SAS-data-library';
data test;
set sasdata.chemists (keep = job_code);
if job_code = 'chem3'
then description = 'Senior Chemist';
run;
The variable JOB_CODE is a character variable with a length of 6 bytes.
Which one of the following is the length of the variable DESCRIPTION in the output data set?


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


Correct Answer : Get Lastest Questions and Answer :

Explanation: Length of a variable is assigned during first assignement, in this case
description = "Senior Chemist" which is 14 character long, so the new variable description will have lenght of 14. So answer is 3




Related Questions


Question : When you have following HTML ods
ods html
path='/folders/myfolders/hadoopexam/' (url='http://hadoopexam.com/sas/')
body='hesample103.html'
contents='toc103.html'
frame='frame103.html';
What is the reason for using URL option here?

 : When you have following HTML ods
1. It will directly upload the files on HadoopExam.com if connection is open with the server.

2. It will have relative URL created in the output, so these generated reports can be uploaded on the server.

3. Access Mostly Uused Products by 50000+ Subscribers

4. It can only be uploaded only one serer where website is hosted.



Question : Which of the following option will help you to create PDF output as below.

 : Which of the following option will help you to create PDF output as below.
1. style=Sapphire

2. bookmarklist=Sapphire

3. Access Mostly Uused Products by 50000+ Subscribers

4. color=Sapphire



Question : You are using the below code to generate report in HTML format
ods html
path='/folders/myfolders/hadoopexam/' (url='http://hadoopexam.com/sas/')
body='hesample103.html'
contents='toc103.html'
frame='frame103.html';
What is the use of providing PATH option?

 : You are using the below code to generate report in HTML format
1. It will have URL appended with the PATH values and relative link will be created in all html files.

2. This is the path of the Server location where the website is hosted and file needs to be manually uploaded on that server.

3. Access Mostly Uused Products by 50000+ Subscribers

4. It is the location where all the logs of the SAS program will be stored.



Question : You have been given below datasets (Fixed width)


Following output has been generated


Which of the following program can generate this output.

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

B.
data course2017;
input COURSE_ID 1-3 COURSE_NAME$ 5-20 LOCATION$ 22-30 FEE 32-35 DATE$ 36-47
DURATION 48-50;
TotalFee=FEE;
ENTIREFEE+TotalFee;

C.
data course2017;
input COURSE_ID 1-3 COURSE_NAME$ 5-20 LOCATION$ 22-30 FEE 32-35 DATE$ 36-47
DURATION 48-50;
TotalFee=FEE+1000;
ENTIREFEE+TotalFee;

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

 : You have been given below datasets (Fixed width)
1. A


2. B

3. Access Mostly Uused Products by 50000+ Subscribers

4. D



Question : You have been given below datasets (Fixed width)


Following output has been generated

A.

data course2017;
input COURSE_ID 1-3 COURSE_NAME$ 5-20 LOCATION$ 22-30 FEE 32-35 DATE$ 36-47
DURATION 48-50;
TotalFee=(FEE*18/100)+FEE;
RETAIN ENTIREFEE 100000;
ENTIREFEE+TotalFee;
if TotalFee gt 1000 AND TOTALFee le 6000 then FEETYPE='VERYLOW';

B.

data course2017;
input COURSE_ID 1-3 COURSE_NAME$ 5-20 LOCATION$ 22-30 FEE 32-35 DATE$ 36-47
DURATION 48-50;
TotalFee=(FEE*18/100)+FEE;
RETAIN ENTIREFEE 100000;
ENTIREFEE+TotalFee;
if TotalFee > 6000 AND TotalFee<=8000 then FEETYPE='LOW';
if TotalFee gt 1000 AND TOTALFee le 6000 then FEETYPE='VERYLOW';
if TotalFee>8000 then FEETYPE='MODERATE';

C.
data course2017;
input COURSE_ID 1-3 COURSE_NAME$ 5-20 LOCATION$ 22-30 FEE 32-35 DATE$ 36-47
DURATION 48-50;
TotalFee=(FEE*18/100)+FEE;
RETAIN ENTIREFEE 100000;
ENTIREFEE+TotalFee;
if TotalFee gt 1000 AND TOTALFee le 6000 then (FEETYPE='VERYLOW' OR FEETYPE='LOW');

D.
data course2017;
input COURSE_ID 1-3 COURSE_NAME$ 5-20 LOCATION$ 22-30 FEE 32-35 DATE$ 36-47
DURATION 48-50;
TotalFee=(FEE*18/100)+FEE;
RETAIN ENTIREFEE 100000;
ENTIREFEE+TotalFee;
if TotalFee gt 1000 AND TOTALFee le 6000 then FEETYPE='VERYLOW';
if TotalFee > 6000 AND TotalFee<=8000 then FEETYPE='LOW';
if TotalFee>8000 then FEETYPE='MODERATE';

 : You have been given below datasets (Fixed width)
1. A



2. B


3. Access Mostly Uused Products by 50000+ Subscribers



4. D





Question : You have been given below code
data course2017;
infile data;
input COURSE_ID 1-3 COURSE_NAME$ 5-20 LOCATION$ 22-30 FEE 32-35 DATE$ 36-47
DURATION 48-50;
Label FEE="Total Fee"
format amount dollar12.2;
run;

proc print data=course2017 label;
var COURSE_ID COURSE_NAME LOCATION FEE DATE DURATION TotalFee ENTIREFEE FEETYPE;
Label FEE="Total Course Fee"
format amount dollar10.;
run;

When above program is executed than which of the following statement is correct?

 : You have been given below code
1. It will use format and label as
Label FEE="Total Fee"
format amount dollar12.2;

2. It will use format and label as
Label FEE="Total Course Fee"
format amount dollar10.;

3. Access Mostly Uused Products by 50000+ Subscribers

4. It will not be printed in output and generate error.