<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Issue in creating Pipe delimited file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Issue-in-creating-Pipe-delimited-file/m-p/553388#M153885</link>
    <description>If this question is answered, please mark the correct solution. In this case you can mark your own answer about dropping the DSD option, which causes the double quotes. Note that double quotes is usually a standard for character variables to mask any quotes or other possible delimiters within the text field.</description>
    <pubDate>Tue, 23 Apr 2019 19:28:41 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-04-23T19:28:41Z</dc:date>
    <item>
      <title>Issue in creating Pipe delimited file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issue-in-creating-Pipe-delimited-file/m-p/553353#M153874</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to create a pipe delimited file. I used the below code on mainframe. Input and the output that I got from my program given below. The code put 2 more double quotes around the text. How can I create the pipe delimited file without extra double quotes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;OPTION MISSING=' ' ERROR=0;
DATA ONE;
  INFILE INFILE ;  INPUT
  PUT     @1    FLD1  $CHAR9.
          @10   FLD2  $CHAR1277.;
  FILE OUTFILE DELIMITER='|' DSD;
  PUT      FLD1-FLD2$;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;INPUT:&lt;BR /&gt;&lt;BR /&gt;Account_Number "SYNOPSIS"
123456789      "Private Limited Company"
345678901      "Public Limited Company"
675839674      "Unknown Company"&lt;BR /&gt;&lt;BR /&gt;Output Received: &lt;BR /&gt;&lt;BR /&gt;Account_Number|"""SYNOPSIS"""&lt;BR /&gt;123456789|"""Private Limited Company"""&lt;BR /&gt;345678901|"""Public Limited Company"""&lt;BR /&gt;675839674|"""Unknown Company"""&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Apr 2019 17:03:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issue-in-creating-Pipe-delimited-file/m-p/553353#M153874</guid>
      <dc:creator>gandikk</dc:creator>
      <dc:date>2019-04-23T17:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in creating Pipe delimited file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issue-in-creating-Pipe-delimited-file/m-p/553358#M153877</link>
      <description>&lt;P&gt;Remove the quotes from the input data string values.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2019 17:06:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issue-in-creating-Pipe-delimited-file/m-p/553358#M153877</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-04-23T17:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in creating Pipe delimited file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issue-in-creating-Pipe-delimited-file/m-p/553360#M153878</link>
      <description>&lt;P&gt;Hi, customer wants double quotes for the Synopsis string. I just tried without DSD. The output looks good now. Thanks!!&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2019 17:12:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issue-in-creating-Pipe-delimited-file/m-p/553360#M153878</guid>
      <dc:creator>gandikk</dc:creator>
      <dc:date>2019-04-23T17:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in creating Pipe delimited file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issue-in-creating-Pipe-delimited-file/m-p/553388#M153885</link>
      <description>If this question is answered, please mark the correct solution. In this case you can mark your own answer about dropping the DSD option, which causes the double quotes. Note that double quotes is usually a standard for character variables to mask any quotes or other possible delimiters within the text field.</description>
      <pubDate>Tue, 23 Apr 2019 19:28:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issue-in-creating-Pipe-delimited-file/m-p/553388#M153885</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-04-23T19:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in creating Pipe delimited file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issue-in-creating-Pipe-delimited-file/m-p/553390#M153886</link>
      <description>&lt;P&gt;Ask why they want such a non-standard format for the file?&amp;nbsp; Quotes in delimited files are normally considered optional since they are used to mask delimiters in values.&amp;nbsp; Since they are optional that is why the existing quotes in the actual value were doubled.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the issue is just that you want to force quotes around values that do not require them the try using the ~ modifier on the PUT statement.&amp;nbsp; Note do not include the quotes in the actual data values in your SAS dataset.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  set have ;
  file outfile dsd dlm='|' ;
  put fld1 fld2 ~ ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that delimited files will also remove leading/trailing spaces from values.&amp;nbsp; That is part of the whole point of generating a delimited file instead a fixed length field file.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2019 19:41:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issue-in-creating-Pipe-delimited-file/m-p/553390#M153886</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-04-23T19:41:52Z</dc:date>
    </item>
  </channel>
</rss>

