if _N_ >1 then output; TOTAL_LOCATIONS=0; input course_name $; end; else if header='LF' then TOTAL_LOCATIONS+1; if last then output; run;
what does here last variable used for?
A. It will always have value as 1, as soon as file read reach end of the record its value will be set to 0. B. It will always have value as 0, as soon as file read reach end of the record its value will be set to 1 C. For each iteration its value will be written in output as well. D. Value of last variable will never be written to output
Correct Answer : Get Lastest Questions and Answer : Explanation: end=last will create a variable named last which will hold as a last line marker, if line is last than it will be set to 1 else it always remain 0, and value of this variable will never be written to output.
Question : You have been given program and dataset
Correct Answer : Get Lastest Questions and Answer : Explanation: It will generate 5 observation in output, because if then do loop will read header record and hold it until all the detail record have been read, once the detail record will real it will generate output for each data step. And last variable also help in finding that this is the last record and generate the output hence there are 5 headers so 5 observation will be generated. Else it would have generated only 4 observation.
1. Delete the word THEN on the IF statement. 2. Add a semicolon at the end of the SET statement. 3. Place quotes around the value on the IF statement. 4. Add an END statement to conclude the IF statement
1. PRODUCT and SALES only 2. PRODUCT, MONTH, NUM_SOLD and COST only 3. PRODUCT, SALES, MONTH, NUM_SOLD and COST only 4. An incomplete output data set is created due to syntax errors