In mainframes, it is fairly common to read the datasets having header and data with delimiter like comma or a semicolon(;). SAS provides the option to read such data using the INFILE statement followed by the keywords as show in the below example.

DLM option specifies the delimiter used in the input file.
DSD means delimiter-sensitive data.
FIRSTOBS= 2data set option specifies a starting point for processing. This is needed when the data contains text or header information at beginning and it has to be skipped to read the actual data.
OBS=XX tells SAS to stop reading when it gets to that line in the input file.
Let’s have a look into the input and output file to understand the code better.
INPUT:

Output:

Leave a comment