Question : When you run the below program what would happened. Assume hesample.dat has valid observations. data prices; infile '/folders/myfolders/hadoopexam/hesample1.dat'; input CODE $ NAME$ FEE1 FEE2; format FEE1 fee. Name name.; run;
data work.subset; set prices (firstobs=3 obs=2); run;
Correct Answer : Get Lastest Questions and Answer : Explanation: Option given are wrong and you will get below error. ERROR: FIRSTOBS option > OBS option - no data to read from file WORK.PRICES. FIRSTOBS= specifies the number of the first observation to process. When the FIRSTOBS= data set option specifies a starting point for processing, the OBS= data set option specifies an ending point. The two options are often used together to define a range of observations to be processed.
Question : You are running below program data course2017_1; obsnum=5; set course2017 (keep=COURSE_NAME LOCATION) point=obsnum; output; stop; run;
where course2017 has 100 observations. What happen when you run the program?
4. It will generate output with 1 observations having two columns only.
Correct Answer : Get Lastest Questions and Answer : Explanation: In the given program three things matter POINT= output and stop. If they all three are used together than only 1 observation will be generated.
Question : You are running below program data course2017_1; set course2017 end=last; if last; run;
where course2017 has 100 observations. What happen when you run the program?
1. It will give error and no output will be generated
2. It will give warning and 100 observations will be in the output.
Correct Answer : Get Lastest Questions and Answer : Explanation: This type of questions really want to know, do you have hands on or not. Like in the given program nothing is wrong. END= option to tell SAS to create a temporary numeric value whose value is used to detect the last observation. SET statement's END= option and a subsetting IF statement to tell SAS to write only the last observation in the input data set (course2017) to the output data set (course2017_1)