Don't forget to create account on our site to get access to more material made only for free registered user.  
SAS A00-211 Certification SAS A00-212 Certification Questions and Answers SAS A00 240 Certification Material SAS A00-250 Exam Material Certification SAS Packaged Solutions

Question 2 : The contents of the raw data file CALENDAR are listed below:
--------10-------20-------30
01012000
The following SAS program is submitted:
data test;
infile 'calendar';
input @1 date mmddyy10.;
if date = '01012000'd then event = 'January 1st';
run;
Which one of the following is the value of the EVENT variable?

1.      01012000
2.      January 1st
3.      (missing numeric value)
4.      The value cannot be determined as the program fails to execute due to errors.

Correct Answer 4 :

Exp : Formatted input enables you to supply special instructions in the INPUT statement for reading data. For example, to read numeric data that contains special symbols, you need to supply SAS with special instructions so that it can read the data correctly. These instructions, called informats

data total_sales;
input Date mmddyy10. +2 Amount comma5.;
In this example, the MMDDYY10. informat for the variable Date tells SAS to interpret the raw data as a month, day, and year, ignoring the slashes. The COMMA5. informat for the variable Amount tells SAS to interpret the raw data as a number, ignoring the comma. The +2 is a pointer control that tells SAS where to look for the next item.

However, SAS is also capable of reading two-digit year values (for example, 09/05/99). In this example, use the MMDDYY8. informat for the variable Date.
Answer D is because date constant is invalid. [Evern after providing correct date constant -date='01JAN2000'd desired output not produced and it produces Note: SAS went to a new line when INPUT statement reached past the end of a line.]
The error that shown even on your correction is probably because the informat given is wrong. The informat should be 'mmddyy8.'. Once you do that, the event shows up as January 1st

If we provide correct date contant date='01jan2000'd, will get the result.
please try the below program.

data test;
infile datalines;
input @1 date mmddyy10.;
if date = '01jan2000'd then event = 'January 1st';
datalines;
01012000
;

You have no rights to post comments