14

I have a quick question.

I am learning SAS and have come across the dsd= option.

Does anyone know what this stands for? It might assist in remembering / contextualizing.

Thanks.

tumultous_rooster
  • 12,150
  • 32
  • 92
  • 149

4 Answers4

13

Rather than just copy and pasting text from the internet. I'll try to explain it a bit clearer. Like the delimiter DLM=, DSD is an option that you can use in the infile statement.

Suppose a delimiter has been specified with DLM= and we used DSD. If SAS sees two delimiters that are side by side or with only blank space(s) between them, then it would recognize this as a missing value.

For example, if text file dog.txt contains the row:

171,255,,dog 

Then,

data test;
    infile 'C:\sasdata\dog.txt' DLM=',' DSD;
    input A B C D $;
run;

will output:

                               A      B     C     D

                              171    255    .    dog

Therefore, variable C will be missing denoted by the .. If we had not used DSD, it would return as invalid data.

Yick Leung
  • 1,048
  • 1
  • 9
  • 16
9

DSD stands for Delimiter-Sensitive Data.

The DSD (Delimiter-Sensitive Data) in infile statement does three things for you. 1: it ignores delimiters in data values enclosed in quotation marks; 2: it ignores quotation marks as part of your data; 3: it treats two consecutive delimiters in a row as missing value.

Source: easy sas

Sheldon
  • 1,215
  • 1
  • 15
  • 29
8

DSD (delimiter-sensitive data)

specifies that when data values are enclosed in quotation marks, delimiters within the value are treated as character data. The DSD option changes how SAS treats delimiters when you use LIST input and sets the default delimiter to a comma. When you specify DSD, SAS treats two consecutive delimiters as a missing value and removes quotation marks from character values.

http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000146932.htm

Patrick Moore
  • 13,251
  • 5
  • 38
  • 63
0

DSD refers to delimited data files that have delimiters back to back when there is missing data. In the past, programs that created delimited files always put a blank for missing data. Today, however, pc software does not put in blanks, which means that the delimiters are not separated. The DSD option of the INFILE statement tells SAS to watch out for this. Below are examples (using comma delimited values) to illustrated:

Old Way:    5,4, ,2, ,1    ===> INFILE 'file' DLM=',' ... etc
New Way:    5,4,,2,,1     ===>  INFILE 'file' DLM=',' DSD ... etc.

Refer

reference

Nagaraj S
  • 13,316
  • 6
  • 32
  • 53
  • Dude, you basically just copied and pasted everything from here: http://studysas.blogspot.com/2008/08/options-in-sas-infile-statement.html without mentioning the citations. Hence, your link is incorrect as it doesn't reflect to the correct source where you gained the information. – Yick Leung Dec 30 '13 at 05:16