<?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: Delimited File Import in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Delimited-File-Import/m-p/62314#M17723</link>
    <description>I tried the 3rd option as it seemed most like what I was after:&lt;BR /&gt;
Creating the files with the fields within double quotes ("&lt;NAME&gt;"^"&lt;AGE&gt;"^ etc) worked beautifully - my files imported with no errors or missing values! (1st time in almost a year!)&lt;BR /&gt;
Thanks to all who replied.&lt;/AGE&gt;&lt;/NAME&gt;</description>
    <pubDate>Fri, 21 Nov 2008 12:15:25 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-11-21T12:15:25Z</dc:date>
    <item>
      <title>Delimited File Import</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimited-File-Import/m-p/62310#M17719</link>
      <description>Does anyone know of a way of getting SAS to read in files delimited by more than one character? Some files I have to import have over a million records in them, containing customer details entered by call-centre staff over a period of several years. I can't find one single character that will successfully delimit all the records! I figure it will be harder to find a string entered in a record that contains '^$*' than just '^' or '$' or '*'.&lt;BR /&gt;
I create the files overnight, typically taking the form of:&lt;BR /&gt;
NAME^AGE^ etc... ('^' being the current delimiter)&lt;BR /&gt;
Any ideas? I'm using 9.1</description>
      <pubDate>Wed, 19 Nov 2008 11:04:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimited-File-Import/m-p/62310#M17719</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-11-19T11:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Delimited File Import</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimited-File-Import/m-p/62311#M17720</link>
      <description>Hi:&lt;BR /&gt;
  You can list multiple delimiters in the DLM= option of the INFILE statement. Delimiters placed next to each other would be treated as one delimiter. Records with only one of the delimiters would be read successfully.&lt;BR /&gt;
    &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
data readmult; &lt;BR /&gt;
  infile datalines dlm='^$';&lt;BR /&gt;
  input name $ age city $ state $;&lt;BR /&gt;
return;&lt;BR /&gt;
datalines;&lt;BR /&gt;
alan^15$^$Atlanta^GA&lt;BR /&gt;
bob^$12$^Cary^NC&lt;BR /&gt;
cathy$14^$Dallas$^$TX &lt;BR /&gt;
dana^17^Hartford^CT&lt;BR /&gt;
ed$17$Portland$OR&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
                     &lt;BR /&gt;
proc print data=readmult;&lt;BR /&gt;
  title 'Use Multiple Delimiters';&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Wed, 19 Nov 2008 12:14:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimited-File-Import/m-p/62311#M17720</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2008-11-19T12:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Delimited File Import</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimited-File-Import/m-p/62312#M17721</link>
      <description>I don't think this is really what is asked for. I interpret the post as the delimiter always must all of the specified characters in that sequence, just to avoid that some character fields may contain any single of the specified characters.&lt;BR /&gt;
&lt;BR /&gt;
I don't think that you can do this within the INFILE statement (it would be a great feature though). So I think that you'll have to scan through the whole record searching for the delimiter, maybe using do-loops, FIND function and SUBSTR...&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Wed, 19 Nov 2008 14:16:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimited-File-Import/m-p/62312#M17721</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2008-11-19T14:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Delimited File Import</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimited-File-Import/m-p/62313#M17722</link>
      <description>Just about all import routines (may be not oracle, but I'll be happy to be corrected) have a solution to the problem of finding a delimiter character within data values. To protect these (I call delimiters embedded in data) they all support the principle of "Quoting." &lt;BR /&gt;
The easiest example would be an amount value formatted with the comma. format.&lt;BR /&gt;
SAS supports the common solution used by (presumeably) all - Quote any value that contains an embedded delimiter. &lt;BR /&gt;
Ok you may challenge, "what about the quote character turning up in a data value?"&lt;BR /&gt;
The solution to this seems as standard as the principle of "quoting" - Protect quotes by quoting the string and repeating internal or unbalanced quotes.  [pre]   Mary said, "let's finish now."[/pre]would be converted to a protected form as [pre]   "Mary said, ""let's finish now""."[/pre]&lt;BR /&gt;
With these methods, text data transfers are achieved in a CSV style that is protected and reliable.&lt;BR /&gt;
SAS supports this with the DSD option on file statements for creating CSV style, and on the INFILE statement for reading such demimited data.&lt;BR /&gt;
On no occasion is a more complex delimiter (like a multi-character delimiter word) required.&lt;BR /&gt;
&lt;BR /&gt;
(just my opinion)&lt;BR /&gt;
&lt;BR /&gt;
PeterC</description>
      <pubDate>Wed, 19 Nov 2008 21:58:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimited-File-Import/m-p/62313#M17722</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2008-11-19T21:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Delimited File Import</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimited-File-Import/m-p/62314#M17723</link>
      <description>I tried the 3rd option as it seemed most like what I was after:&lt;BR /&gt;
Creating the files with the fields within double quotes ("&lt;NAME&gt;"^"&lt;AGE&gt;"^ etc) worked beautifully - my files imported with no errors or missing values! (1st time in almost a year!)&lt;BR /&gt;
Thanks to all who replied.&lt;/AGE&gt;&lt;/NAME&gt;</description>
      <pubDate>Fri, 21 Nov 2008 12:15:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimited-File-Import/m-p/62314#M17723</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-11-21T12:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Delimited File Import</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimited-File-Import/m-p/62315#M17724</link>
      <description>Hi Linus, &lt;BR /&gt;
yeah we can use DLm option in infile statement and can compress those characters. By the way by using substring function u will just able to extract the portion of that value.</description>
      <pubDate>Mon, 01 Dec 2008 09:49:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimited-File-Import/m-p/62315#M17724</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-12-01T09:49:27Z</dc:date>
    </item>
  </channel>
</rss>

