SAS Online Certification Training | Infile options in SAS
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.
DLM
DLM=delimiter(s)
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= “ , : “ ;
DSD
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
correctly.
SAS Training and SAS Certification Course
The SAS course is a best way to enter the SAS industry and you can make bright career.
Do not delay? Today contact with Durga Online Trainer and become a experts in SAS Programming.
You can also join online classes-
best clinical sas training institute in india | sas certification course online in india | Power bi online training course in india.
- Art
- Causes
- Crafts
- Dance
- Drinks
- Film
- Fitness
- Food
- Games
- Gardening
- Health
- Home
- Literature
- Music
- Networking
- Other
- Party
- Religion
- Shopping
- Sports
- Theater
- Wellness