An INFORMAT statement in a DATA step permanently associates an informat with a variable. You can specify standard SAS informats or user-written informats, previously defined in PROC FORMAT. A single INFORMAT statement can associate the same informat with several variables, or it can associate different informats with different variables. If a variable appears in multiple INFORMAT statements, SAS uses the informat that is assigned last. CAUTION: Because an INFORMAT statement defines the length of previously undefined character variables, you can truncate the values of character variables in a DATA step if an INFORMAT statement precedes a SET statement.
An informat is used to translate the calendar date to a SAS date value. The date values are in the form of two-digit values for month-day-year, so the MMDDYY8. informat must be used. When using an informat with list input, the colon-format modifier is required to correctly associate the informat with the variable name.
[Colon use] The colon is called colon modifier, is generally used to prevent incomplete data read Here's the situation you are using: meaning that has been read so far encountered in space (if it is a string variable then enrolled into space or colon defined length, which meets on the first of which). After reading region behind the data pointer in the region that the spaces, plus mtg of eight characters, a total of nine characters need to read But if you use mmddyy8. 11-24-9, then it can only be read, if the rate of colon then read guaranteed space location, they are able to read as 11-24-99, if you put mmddyy8. Changed mmddyy9. then all the same Search colon modifier can see its usage
Question : 1---+----10---+----20---+ Jose,47,210 Sue,,108 The following program is submitted using the raw data file above as input:
data employeestats; (insert INFILE statement here) input name $ age weight; run; The following output is desired:
name age weightJose 47 210Sue . 108
Which of the following INFILE statement completes the program and accesses the data correctly?
Explanation: The PAD option specifies that SAS pad variable length records with blanks. The MISSOVER option prevents SAS from reading past the end of the line when reading free formatted data. The DLM= option specifies the comma as the delimiter; however, consecutive delimiters are treated as one by default. The DSD option correctly reads the data with commas as delimiters and two consecutive commas indicating a missing value like those in this raw data file.