Question : Is there anything wrong with the below program data HADOOPEXAM ; infile "/folders/myfolders/hedata/filtered1.dat" input COURSE_ID 1-3 COURSE_NAME$ 5-20 LOCATION$ 22-30 FEE 32-35 DATE$ 36-47 DURATION 48-50; Total_FEE=FEE+FEE*18/100; run;
1. You must put semicolon on each line. Semicolon missing on line 2 and 3
Correct Answer : Get Lastest Questions and Answer : Explanation: There is no issue, if you use the variable in a calculation and update the same variable as in the given program. It is mandatory to have semicolon at the end of each SAS statement and not the end of the line, because a single SAS statement can span more than 1 line.
Question : You can see following log is printed after execution of SAS program. NOTE: Invalid data for COURSEID in line 7 15-19. RULE: ----+----1----+----2----+----3----+----47 MUMBAI SPARK 3 5000 LOCATION=MUMBAI COURSEID=. COURSE_NAME=SPARK FEE=5000 Total=100 _ERROR_=1 _N_=1
What can you interpret from this?
1. There is a Syntax error and you have not used SAS keywords correctly.
2. All the columns are not kept in the correct order
4. A dollar sign was missing in the INPUT statement.
Correct Answer : Get Lastest Questions and Answer : Explanation: This kind of question generally take longer time to find the reason, However, focus first that is there any value which is shown as missing. If value is missing it means something wrong with the input data or variable definition. However, we dont know how the input data in the raw file. However, you know it is a numeric value defined. So the only option which is correspond to given output is missing dollar sing while declaring the variable.
Question : You have defined a SAS format as below. proc format ; value location 1='Mumbai' 2='Pune' 3='Chennai'; Run; How long this format will be available?
Correct Answer : Get Lastest Questions and Answer : Explanation: Since, this format are not defined as part of permanent library. Hence, they will remain only temporary as part of Work library only.