Author: Robert Sample
Subject: Reply to: Strings with double quotes having problem when used with DLM
Posted: Fri Mar 31, 2017 1:21 am (GMT 5.5)
I'm not sure your output makes sense based upon your code, but here's what SAS documentation says about DSD:
In other words, the output you posted is PRECISELY what you should have gotten based upon your code and your input. If this is not what you want, you'll need to either change your code or create the output record yourself and then write it without the DSD option or DLM option.
If you're new to SAS, you need to research the difference between the single quote mark (') and double quote mark (") -- they are treated very differently in SAS.
_________________
TANSTAAFL
The first rule of code reuse is that the code needs to be worth re-using.
"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." -- Donald Knuth
Subject: Reply to: Strings with double quotes having problem when used with DLM
Posted: Fri Mar 31, 2017 1:21 am (GMT 5.5)
I'm not sure your output makes sense based upon your code, but here's what SAS documentation says about DSD:
Quote: |
DSD (delimiter sensitive data) specifies that data values that contain embedded delimiters, such as tabs or commas, be enclosed in quotation marks. The DSD option enables you to write data values that contain embedded delimiters to LIST output. This option is ignored for other types of output (for example, formatted, column, and named). Any double quotation marks that are included in the data value are repeated. When a variable value contains the delimiter and DSD is used in the FILE statement, the variable value will be enclosed in double quotation marks when the output is generated. For example, the following code DATA _NULL_; FILE log dsd; x='"lions, tigers, and bears"'; put x ' "Oh, my!"'; run; will result in the following output: """lions, tigers, and bears""", "Oh, my!" |
If you're new to SAS, you need to research the difference between the single quote mark (') and double quote mark (") -- they are treated very differently in SAS.
_________________
TANSTAAFL
The first rule of code reuse is that the code needs to be worth re-using.
"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." -- Donald Knuth