Premium

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



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


Correct Answer : Get Lastest Questions and Answer :
Explanation: Data is givene in fixed width and needs to be read based on position. As we can see all the option are reading same way based
on position. In the output we can see 2 new variables have been created these are TotalFee and EntireFee, every given program is doing that. Now we need
to look the values for these new variables. TotalFee has various derivation and by doing calculation you can find it is adding 18% taxes to the actual
fee . Hence, supporting option for that will be 1 and 4 only. So 2 and 3 is out. Now next look EntireFee is cumulatively adding all the previous fee
values, which is in option 1 only. Hence, correct answer is option 1 only.




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




Correct Answer : Get Lastest Questions and Answer :
Explanation: This type of questions are time consuming, so we need to do more quick on that to rule out which cannot
be possible answer. Here, question clearly seems to be if condition based. Possible value for FEETYPE column can be LOW,
VERYLOW and MODERATE looking at the output. Hence, option 1 is out, it has no output that can be generated with the LOW
and MODERATE value.
Now option 3 is clearly wrong syntax of if statement as then part is wrong. Hence this is out.
Now option 2 and 4 seems equal and order of the stamen execution with if condition are different. Now the catch here
is when variable FEETYPE initialized first time than it will be initialized with the given value. Hence in option 2 it
will be initialized with value 'LOW' three character only. Hence, MODERATE and VERYLOW does not fit. So the correct
answer would be option 4 only.






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.


Correct Answer : Get Lastest Questions and Answer :
Explanation: There are two ways by which you can assign format and label to a variable. However, when you apply the format in a Data step,
it will be assigned permanently. And when assigned in proc step it will be assigned temporarily. However, whatever you define in temporary step, it will
overwrite the permanent label and format for temporary. Hence option 2 is correct.


Related Questions


Question : If you have been given below condition

if header='C' then input course_name $;
else if header='LF' then location $ FEE ;

which of the following statements are correct?

  : If you have been given below condition
1. If header is not C then location and Fee value will be read from data

2. If header is not C then course name value will be read from data

3. Access Mostly Uused Products by 50000+ Subscribers

4. If header is C then another condition will be checked



Question : You have been given below code, what that means

if header='C' then
do;

if _N_ >1 then
output;
TOTAL_LOCATIONS=0;
input course_name $;
end;

A. _N_ value tells how many detail record have been read or time data steps is executed.
B. If header=C and _N_ >1 then generate the output
C. If header=C or _N_ >1 then generate the output
D. Observation is generated only for the header record and no detail record will be read

 : You have been given below code, what that means
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 dataset and SAS program, how many observation will be generated at the end of the program



filename course73 '/folders/myfolders/hedata/course73.txt';

data data73;
infile course73 missover;
input course_name $ @;
do sequnce=1 to 4;
input location $ Fee @;
output;
end;
run;

proc print data=data73;
run;

 : You have been given below dataset and SAS program, how many observation will be generated at the end of the program
1. 17

2. 20

3. Access Mostly Uused Products by 50000+ Subscribers

4. None



Question : You have been given below dataset

Now C represent header record and LF represent detail record, now you want to create one observation per detail record, what do you do?

 : You have been given below dataset
1. We first need to fine which represent header and which record is part of detail in this case C is header and LF is detail record.

2. We need to hold the header record C of each observation until the next header record is read.

3. Access Mostly Uused Products by 50000+ Subscribers

4. All of the above are correct



Question : You have been given below dataset

Which of the blow statement will hold the header value until all the detail records are read

 : You have been given below dataset
1. input header @;

2. input header @@;

3. Access Mostly Uused Products by 50000+ Subscribers

4. input header \;



Question : Which of the following statement read the header and check whether it is equal to C or not if its C then assign course_name value.

 : Which of the following statement read the header and check whether it is equal to C or not if its C then assign course_name value.
1. if header='C' then input course_name $;

2. if header='C' then input course_name $ @;

3. Access Mostly Uused Products by 50000+ Subscribers

4. if header='C' then input course_name $ \;