<?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: Read pipe delimited text file with quotes (dsd) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Read-pipe-delimited-text-file-with-quotes-dsd/m-p/812386#M320536</link>
    <description>&lt;P&gt;DSD is what will remove the quotes.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename mydata temp;
data _null_;
  file mydata;
  put '1|"ABC"||3';
  put '2||"XYZ"|4';
run;

data demo;
  infile mydata missover dsd dlm='|';
  input vara varb :$3. varc :$3. vard;
run;

proc print data=demo;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1652186707644.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71262i32012EBBC6B2D7AD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1652186707644.png" alt="Patrick_0-1652186707644.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I don't have DI "at hand" to test it but I believe the file reader should allow you a definition that will generate code as in above infile statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also always add additional option in the text field of the file reader. Whatever you write there will just get added to the infile statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've used in the past this field also for some "code ingestion" like...&lt;/P&gt;
&lt;PRE&gt;;
input @:
_infile_=compress(_infile_,'"');&lt;/PRE&gt;
&lt;P&gt;Such code would get added right after the INFILE statement but prior to the INPUT statement and though would remove double quotes before you start mapping the input buffer to variables.&lt;/P&gt;</description>
    <pubDate>Tue, 10 May 2022 12:53:48 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2022-05-10T12:53:48Z</dc:date>
    <item>
      <title>Read pipe delimited text file with quotes (dsd)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-pipe-delimited-text-file-with-quotes-dsd/m-p/812345#M320514</link>
      <description>&lt;P&gt;I am using the File Reader transformation in DI Studio to import a pipe delimited text file. Some of the fields contain quotes, and I ant to remove the dsd option from the generated code so that the quotes are not seen as delimiters. The problem is I can't find the option in the transformation to do this! Any suggestions?&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 10:25:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-pipe-delimited-text-file-with-quotes-dsd/m-p/812345#M320514</guid>
      <dc:creator>HeidiDT</dc:creator>
      <dc:date>2022-05-10T10:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: Read pipe delimited text file with quotes (dsd)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-pipe-delimited-text-file-with-quotes-dsd/m-p/812386#M320536</link>
      <description>&lt;P&gt;DSD is what will remove the quotes.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename mydata temp;
data _null_;
  file mydata;
  put '1|"ABC"||3';
  put '2||"XYZ"|4';
run;

data demo;
  infile mydata missover dsd dlm='|';
  input vara varb :$3. varc :$3. vard;
run;

proc print data=demo;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1652186707644.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71262i32012EBBC6B2D7AD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1652186707644.png" alt="Patrick_0-1652186707644.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I don't have DI "at hand" to test it but I believe the file reader should allow you a definition that will generate code as in above infile statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also always add additional option in the text field of the file reader. Whatever you write there will just get added to the infile statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've used in the past this field also for some "code ingestion" like...&lt;/P&gt;
&lt;PRE&gt;;
input @:
_infile_=compress(_infile_,'"');&lt;/PRE&gt;
&lt;P&gt;Such code would get added right after the INFILE statement but prior to the INPUT statement and though would remove double quotes before you start mapping the input buffer to variables.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 12:53:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-pipe-delimited-text-file-with-quotes-dsd/m-p/812386#M320536</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-05-10T12:53:48Z</dc:date>
    </item>
  </channel>
</rss>

