Infile options are used to read the raw data which are located in external file. A raw data file is an external text file whose records contain data values that are organized in fields. Mostly SAS by default recognize the blank space as a delimiter apart from this SAS unable to recognize and give the error. For that purpose, DLM and DSD options are used for recognizing the delimiters other than blank space. DLM and DSD write along with infile statements.
To read the raw data file, the DATA step must provide the following instructions to SAS:
the location or name of the external text file
a name for the new SAS data set
a reference that identifies the external file
a description of the data values to be read.
where delimiter(s) specifies a delimiter for list input in either of the following forms:
‘list-of-delimiting-characters’ specifies one or more characters (up to 200) to read as
delimiters. The list of characters must be enclosed in quotation marks either in single or double quote.
character-variable specifies a character variable whose value becomes the delimiter, also we are writing so many delimiters in the DLM option provided that the data observation containing that delimiter. Suppose in the sas data sets are separated by comma and colon so in the DLM both delimiters re required for reading the raw data.
Example- Infile cards dlm= “ , : “ ;
We will using the DSD option in the INFILE statement to correctly read the raw data. The DSD
option changes how SAS treats delimiters when list input is used. Specifically, the DSD option
sets the default delimiter to a comma ,treats two consecutive delimiters as a missing value also
Remove quotation marks from the value.
When the following program reads the raw data file, the DSD option sets the default delimiter to a
comma and treats the two consecutive delimiters as a missing value. Therefore, the data is read
SAS Training and SAS Certification Course
The SAS course is a best way to enter the SAS industry and you can make bright career.
You can also join online classes-