<?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: Do we have an equivalent infile option in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Do-we-have-an-equivalent-infile-option/m-p/38054#M7618</link>
    <description>If I understand your question correctly than you can do following:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
 data cc;&lt;BR /&gt;
 infile cards dlm=',~';&lt;BR /&gt;
 input a $ b $ c ;&lt;BR /&gt;
 cards;&lt;BR /&gt;
 A,1,13&lt;BR /&gt;
 B~2,15&lt;BR /&gt;
 c,D~20&lt;BR /&gt;
;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Oleg.

Message was edited by: Oleg_L</description>
    <pubDate>Mon, 22 Nov 2010 15:07:35 GMT</pubDate>
    <dc:creator>Oleg_L</dc:creator>
    <dc:date>2010-11-22T15:07:35Z</dc:date>
    <item>
      <title>Do we have an equivalent infile option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Do-we-have-an-equivalent-infile-option/m-p/38053#M7617</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I am trying to read a text file using "infile" statement, where data can come in either of delimiters - comma or tilda.&lt;BR /&gt;
&lt;BR /&gt;
We have only SAS 8.2 Version. I saw that this option in infile statement - DLMSTR has facility to read either of ways that data will come and is applicable in SAS 9 version.&lt;BR /&gt;
&lt;BR /&gt;
Do we have an equivalent option in SAS 8.2 Version. If not, how to read data if the file comes in either of those above delimiters?&lt;BR /&gt;
&lt;BR /&gt;
thanks in advance,&lt;BR /&gt;
Sasbase9</description>
      <pubDate>Mon, 22 Nov 2010 14:05:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Do-we-have-an-equivalent-infile-option/m-p/38053#M7617</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-11-22T14:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Do we have an equivalent infile option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Do-we-have-an-equivalent-infile-option/m-p/38054#M7618</link>
      <description>If I understand your question correctly than you can do following:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
 data cc;&lt;BR /&gt;
 infile cards dlm=',~';&lt;BR /&gt;
 input a $ b $ c ;&lt;BR /&gt;
 cards;&lt;BR /&gt;
 A,1,13&lt;BR /&gt;
 B~2,15&lt;BR /&gt;
 c,D~20&lt;BR /&gt;
;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Oleg.

Message was edited by: Oleg_L</description>
      <pubDate>Mon, 22 Nov 2010 15:07:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Do-we-have-an-equivalent-infile-option/m-p/38054#M7618</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2010-11-22T15:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Do we have an equivalent infile option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Do-we-have-an-equivalent-infile-option/m-p/38055#M7619</link>
      <description>Hi.&lt;BR /&gt;
Maybe you can use scan() function to achieve it.&lt;BR /&gt;
Not test.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data cc;&lt;BR /&gt;
 infile cards;&lt;BR /&gt;
 input ;&lt;BR /&gt;
 a=scan(_infile_,1,',~');&lt;BR /&gt;
 b=scan(_infile_,2,',~');&lt;BR /&gt;
 c=scan(_infile_,3,',~');&lt;BR /&gt;
 cards;&lt;BR /&gt;
 A,1,13&lt;BR /&gt;
 B~2,15&lt;BR /&gt;
 c,D~20&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
proc print noobs; run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Wed, 24 Nov 2010 04:51:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Do-we-have-an-equivalent-infile-option/m-p/38055#M7619</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-11-24T04:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Do we have an equivalent infile option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Do-we-have-an-equivalent-infile-option/m-p/38056#M7620</link>
      <description>I ran Oleg_L's code on a mainframe with SAS8.2 and it worked.</description>
      <pubDate>Wed, 24 Nov 2010 17:39:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Do-we-have-an-equivalent-infile-option/m-p/38056#M7620</guid>
      <dc:creator>advoss</dc:creator>
      <dc:date>2010-11-24T17:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Do we have an equivalent infile option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Do-we-have-an-equivalent-infile-option/m-p/38057#M7621</link>
      <description>the DLM='constant' option of the infile statement lists alternative delimiters all/any of which are used to parse the infile buffer&lt;BR /&gt;
When you need to use different delimiters at different stages of input, use DLM=variable. The variable can change during the running of the data step in ways that the 'constant' cannot.&lt;BR /&gt;
 &lt;BR /&gt;
peterC

emphasise that characters in the DLM are alternatives&lt;BR /&gt;
    &lt;BR /&gt;
Message was edited by: Peter.C</description>
      <pubDate>Thu, 25 Nov 2010 12:38:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Do-we-have-an-equivalent-infile-option/m-p/38057#M7621</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-11-25T12:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: Do we have an equivalent infile option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Do-we-have-an-equivalent-infile-option/m-p/38058#M7622</link>
      <description>...&lt;BR /&gt;
&amp;gt; I saw that this option&lt;BR /&gt;
&amp;gt; in infile statement - DLMSTR has facility to read&lt;BR /&gt;
&amp;gt; either of ways that data will come and is applicable&lt;BR /&gt;
&amp;gt; in SAS 9 version.&lt;BR /&gt;
...&lt;BR /&gt;
No. DLMSTR= option lets you specify a multi-character delimiter. DLM= option lets you specify single-character delimiter(s). A rather big difference.&lt;BR /&gt;
[pre]&lt;BR /&gt;
   data one;&lt;BR /&gt;
     infile cards dlmstr="+|+" missover;&lt;BR /&gt;
     input (v1-v3) (:$8.);&lt;BR /&gt;
   cards;&lt;BR /&gt;
   1+++|+2||++|+3&lt;BR /&gt;
   ;&lt;BR /&gt;
   run;&lt;BR /&gt;
&lt;BR /&gt;
   proc print data=one;&lt;BR /&gt;
   run;&lt;BR /&gt;
   /* on lst&lt;BR /&gt;
   Obs    v1      v2     v3&lt;BR /&gt;
    1     1++    2||+    3&lt;BR /&gt;
   */&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
   data two;&lt;BR /&gt;
     infile cards dlm="+|+" missover;&lt;BR /&gt;
     input (v1-v3) (:$8.);&lt;BR /&gt;
   cards;&lt;BR /&gt;
   1+++|+2||++|+3&lt;BR /&gt;
   ;&lt;BR /&gt;
   run;&lt;BR /&gt;
&lt;BR /&gt;
   proc print data=two;&lt;BR /&gt;
   run;&lt;BR /&gt;
   /* on lst&lt;BR /&gt;
   Obs    v1    v2    v3&lt;BR /&gt;
    1     1     2     3&lt;BR /&gt;
   */&lt;BR /&gt;
[/pre]</description>
      <pubDate>Tue, 07 Dec 2010 21:52:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Do-we-have-an-equivalent-infile-option/m-p/38058#M7622</guid>
      <dc:creator>chang_y_chung_hotmail_com</dc:creator>
      <dc:date>2010-12-07T21:52:18Z</dc:date>
    </item>
  </channel>
</rss>

