Question 18: You have been given below raw data at دfolders/myfolders/hedata/wrongdata.dat

 Which of the following program can generate output as below.

  1. filename allhecrs '/folders/myfolders/hedata/wrongdata.dat';

 data course2017;

 infile allhecrs;

 input COURSE_ID COURSE_NAME$ LOCATION$ FEE ;

 run;

 proc print data=course2017;

 run;

 B.

 filename allhecrs '/folders/myfolders/hedata/wrongdata.dat';

 data course2017;

 infile wrongdata.dat;

 input COURSE_ID 1-3 COURSE_NAME$ 5-20 LOCATION$ 22-30 FEE 32-35;

 run;

 proc print data=course2017;

 run;

 C.

 filename allhecrs '/folders/myfolders/hedata/wrongdata.dat';

 data course2017;

 infile allhecrs;

 input COURSE_ID 1-3 COURSE_NAME$ 5-20 LOCATION$ 22-30 FEE 32-35;

 run;

 proc print data=course2017;

 run;

 D.

 libname allhecrs '/folders/myfolders/hedata/wrongdata.dat';

 data course2017;

 infile allhecrs;

 input COURSE_ID 1-3 COURSE_NAME$ 5-20 LOCATION$ 22-30 FEE 32-35;

 run;

 proc print data=course2017;

 run;

  1. A
  2. Get all Questions and Answer from here
  3. You need to have paid subscription to access all questions
  4. Thanks for considering SAS Certification Material

 Correct Answer : 3 Exp : As you will be reading rawfile, hence you need to use filename option at first. Hence, option 4 is out. As you can see it is a fixed width file without column name, hence you need to use and provide column width, which is not the case in 1st option , hence it is out.

You can access to full explanation to question and answer from this page.