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.
When you specify DSD , SAS treats two consecutive delimiters as a missing value and removes quotation marks from character values. Whereas the default functionality of DLM=',' is to treat consecutive commas as a single comma, DSD will assign missing values between consecutive commas.
The DSD option controls how SAS treats (or when used on FILE statement creates) multiple adjacent delimiters. The MISSOVER option controls what happens when you try to read past the end of the current line of text.
DLM= The dlm= option can be used to specify the delimiter that separates the variables in your raw data file. For example, dlm=','indicates a comma is the delimiter (e.g., a comma separated file, . csv file). Or, dlm='09'x indicates that tabs are used to separate your variables (e.g., a tab separated file).
EOV=variable. specifies a variable, whose name you supply, that SAS sets to 1 when the first record in a data set in a series of concatenated data sets is read. The variable is set only after SAS encounters the next data set.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With