<?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: how to read three delimiter in file using base sas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-three-delimiter-in-file-using-base-sas/m-p/410512#M100304</link>
    <description>thank you</description>
    <pubDate>Sat, 04 Nov 2017 06:57:50 GMT</pubDate>
    <dc:creator>ganeshmule</dc:creator>
    <dc:date>2017-11-04T06:57:50Z</dc:date>
    <item>
      <title>how to read three delimiter in file using base sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-three-delimiter-in-file-using-base-sas/m-p/408283#M99613</link>
      <description>&lt;P&gt;data have;&lt;BR /&gt;infile datalines dlm='{''^''}' missover;&lt;BR /&gt;input id name $ salary;&lt;BR /&gt;datalines;&lt;BR /&gt;{^}{^}55000&lt;BR /&gt;{^}rohit{^}&lt;BR /&gt;3{^}giridhar{^}&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;it has work when all columns has data but above scenario it won't work&lt;BR /&gt;&lt;BR /&gt;help me out thanks in advance&lt;/P&gt;</description>
      <pubDate>Sat, 28 Oct 2017 18:31:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-three-delimiter-in-file-using-base-sas/m-p/408283#M99613</guid>
      <dc:creator>ganeshmule</dc:creator>
      <dc:date>2017-10-28T18:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to read three delimiter in file using base sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-three-delimiter-in-file-using-base-sas/m-p/408287#M99616</link>
      <description>&lt;P&gt;Use DLMSTR not DLM and add the DSD option.&lt;/P&gt;
&lt;P&gt;In DLM each character is treated as an individual delimiter, i.e. you have 4 delimiters, " , {, }, ^&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DLMSTR used the group of characters as a single delimiter.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't think you need the quotes in there unless your delimiter includes quotes, which it doesn't in your example data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure your example data reflects your actual data as much as possible, because we can't see it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Oct 2017 18:57:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-three-delimiter-in-file-using-base-sas/m-p/408287#M99616</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-28T18:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to read three delimiter in file using base sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-three-delimiter-in-file-using-base-sas/m-p/408295#M99622</link>
      <description>Thank you for your reply&lt;BR /&gt;But it has only three delimiter as under&lt;BR /&gt;Dlm='{^}' only so in this case it will not work&lt;BR /&gt;Could you please write infile statement as per you</description>
      <pubDate>Sat, 28 Oct 2017 19:46:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-three-delimiter-in-file-using-base-sas/m-p/408295#M99622</guid>
      <dc:creator>ganeshmule</dc:creator>
      <dc:date>2017-10-28T19:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to read three delimiter in file using base sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-three-delimiter-in-file-using-base-sas/m-p/408297#M99623</link>
      <description>&lt;P&gt;As Reeza has stated, instead of DLM, you need DLMSTR and DSD, in your example as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;infile datalines&amp;nbsp;dlmstr='{^}' dsd missover ;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Oct 2017 20:02:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-three-delimiter-in-file-using-base-sas/m-p/408297#M99623</guid>
      <dc:creator>Norman21</dc:creator>
      <dc:date>2017-10-28T20:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to read three delimiter in file using base sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-three-delimiter-in-file-using-base-sas/m-p/408320#M99632</link>
      <description>&lt;P&gt;I think that your question is really how to use a multiple character string as the delimiter when reading text from a file.&lt;/P&gt;
&lt;P&gt;If you want a specific sequence of characters to be the delimiter then you need to use the DLMSTR= option on the INFILE statement.&lt;/P&gt;
&lt;P&gt;If you specify multiple characters in the DLM= option each individual character is treated as a delimiter.&amp;nbsp; So '{^}' is not one delimiter but three of them next to each other.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The reason it properly read the lines did not have any empty values is because you did not include the DSD option.&amp;nbsp; Without the DSD option adjacent delimiters do not indicate a missing value.&amp;nbsp; So having three delimiters between each value did not mean there were two missing values.&amp;nbsp; But you need the DSD option to distinguish which values are missing when not all values are present, like in your example.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  infile datalines dsd dlmstr='{^}' truncover;
  input id name $ salary;
datalines;
{^}{^}55000
{^}rohit{^}
3{^}giridhar{^}
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PS. Don't include quotes in the DLMSTR value unless they are actually part of the string.&lt;/P&gt;
&lt;P&gt;PS. Get in the habit of using the TRUNCOVER instead of MISSOVER option.&amp;nbsp; They generally work the same, but most of the time you will want the input to read the characters it can find instead of giving you a missing value.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Oct 2017 05:32:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-three-delimiter-in-file-using-base-sas/m-p/408320#M99632</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-10-29T05:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to read three delimiter in file using base sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-three-delimiter-in-file-using-base-sas/m-p/410512#M100304</link>
      <description>thank you</description>
      <pubDate>Sat, 04 Nov 2017 06:57:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-three-delimiter-in-file-using-base-sas/m-p/410512#M100304</guid>
      <dc:creator>ganeshmule</dc:creator>
      <dc:date>2017-11-04T06:57:50Z</dc:date>
    </item>
  </channel>
</rss>

