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';
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?
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.;
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.