<?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: Escaping delimiters without dsd in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Escaping-delimiters-without-dsd/m-p/241080#M44615</link>
    <description>&lt;P&gt;Won't that result in sas reading for a specified number of columns? Because that is a no go as the length varries from one line to the next.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Dec 2015 21:40:44 GMT</pubDate>
    <dc:creator>adamsonb</dc:creator>
    <dc:date>2015-12-28T21:40:44Z</dc:date>
    <item>
      <title>Escaping delimiters without dsd</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Escaping-delimiters-without-dsd/m-p/241076#M44612</link>
      <description>&lt;P&gt;I'm trying to inport some data of the following structure:&lt;/P&gt;&lt;P&gt;!434!,!23!,!-99999!,!6!,!-99999!,!6|7!,!-99999!,!10!,!311/1803!,!20140930!,!72!,!3.2!&lt;BR /&gt;!438!,!97!,!DENTISTRY, GENERAL!,!97!,!TSBDE PROVIDER!,!6|7!,!-99999!,!-99999!,!312/1803!,!20140930!,!72!,!3.2!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However the comma in the string is being read as a delemiter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; test;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;infile&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"P:\crv_1208_prov_20151228.txt"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;dlm&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;",!"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;truncover&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;ProviderID :&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;4.0&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;ProviderSpecialty :&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2.0&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;ProviderSpecialtyOther :&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$200.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;ProviderType :&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2.0&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;ProviderTypeOther :&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$200.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;PracticeType :&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$5.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;PracticeTypeOther :&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$200.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;ProviderYears&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;itemNumber :&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$9.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;extractDate :&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;yymmdd8.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;providingSite&lt;/P&gt;&lt;P&gt;ddVersion ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2015 20:29:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Escaping-delimiters-without-dsd/m-p/241076#M44612</guid>
      <dc:creator>adamsonb</dc:creator>
      <dc:date>2015-12-28T20:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Escaping delimiters without dsd</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Escaping-delimiters-without-dsd/m-p/241079#M44614</link>
      <description>&lt;P&gt;Try using INFORMAT or ATTRIB statements to define the informat for the variables.&amp;nbsp;before the Input statement. When the format is specified in the input then there is sort of "forced read" for the number of columns.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2015 21:36:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Escaping-delimiters-without-dsd/m-p/241079#M44614</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-12-28T21:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: Escaping delimiters without dsd</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Escaping-delimiters-without-dsd/m-p/241080#M44615</link>
      <description>&lt;P&gt;Won't that result in sas reading for a specified number of columns? Because that is a no go as the length varries from one line to the next.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2015 21:40:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Escaping-delimiters-without-dsd/m-p/241080#M44615</guid>
      <dc:creator>adamsonb</dc:creator>
      <dc:date>2015-12-28T21:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: Escaping delimiters without dsd</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Escaping-delimiters-without-dsd/m-p/241081#M44616</link>
      <description>I added informat ProviderSpecialtyOther $200.; above the input statement but am still only getting "dentistry" rather than "dentistry, general"</description>
      <pubDate>Mon, 28 Dec 2015 21:58:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Escaping-delimiters-without-dsd/m-p/241081#M44616</guid>
      <dc:creator>adamsonb</dc:creator>
      <dc:date>2015-12-28T21:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Escaping delimiters without dsd</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Escaping-delimiters-without-dsd/m-p/241084#M44618</link>
      <description>&lt;P&gt;The reason for this is that a delimiter is just one char, specifying more than one tells SAS that there are alternate delimiters.&lt;/P&gt;
&lt;P&gt;If you files are not large, I&amp;nbsp;suggest that you pre-process them, changing all ! to ". Then you should be able to import the data easily with DLM=',' DSD;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2015 22:42:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Escaping-delimiters-without-dsd/m-p/241084#M44618</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-12-28T22:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: Escaping delimiters without dsd</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Escaping-delimiters-without-dsd/m-p/241087#M44621</link>
      <description>&lt;P&gt;Change ! into "&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile '/folders/myfolders/temp.txt' dsd truncover lrecl=2000;
input @;
_infile_=translate(_infile_,'"','!'); 
input
ProviderID :4.0
ProviderSpecialty :2.0
ProviderSpecialtyOther :$200.
ProviderType :2.0
ProviderTypeOther :$200.
PracticeType :$5.
PracticeTypeOther :$200.
ProviderYears
itemNumber :$9.
extractDate :yymmdd8.
providingSite
ddVersion ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Dec 2015 01:14:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Escaping-delimiters-without-dsd/m-p/241087#M44621</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-12-29T01:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: Escaping delimiters without dsd</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Escaping-delimiters-without-dsd/m-p/241098#M44628</link>
      <description>&lt;P&gt;Here's a method that just reads the extra commas as a variable to be dropped later.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;infile&lt;/FONT&gt; &lt;FONT face="Courier New" size="3" color="#800080"&gt;"P:\crv_1208_prov_20151228.txt"&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;dlm&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;"!"&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;truncover&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;length ProviderSpecialtyOther ProviderTypeOther PracticeTypeOther $ 200&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PracticeType $ 5 itemNumber $ 9 dummy $ 1;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;informat extractDate yymmdd8.;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;input&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;ProviderID dummy&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ProviderSpecialty dummy&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ProviderSpecialtyOther dummy&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ProviderType dummy&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ProviderTypeOther dummy&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; PracticeType dummy&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; PracticeTypeOther dummy&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ProviderYears dummy&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; itemNumber dummy&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; extractDate dummy&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; providingSite dummy&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ddVersion&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;drop dummy;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;run;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2015 03:03:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Escaping-delimiters-without-dsd/m-p/241098#M44628</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-12-29T03:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Escaping delimiters without dsd</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Escaping-delimiters-without-dsd/m-p/241109#M44636</link>
      <description>&lt;P&gt;Try DLMSTR= as shown below.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
/*  infile "P:\crv_1208_prov_20151228.txt"*/
  infile datalines
    dlmstr="!,!" dsd
    truncover;
  input @2
    ProviderID :4.0
    ProviderSpecialty :2.0
    ProviderSpecialtyOther :$200.
    ProviderType :2.0
    ProviderTypeOther :$200.
    PracticeType :$5.
    PracticeTypeOther :$200.
    ProviderYears
    itemNumber :$9.
    extractDate :yymmdd8.
    providingSite
    ddVersion;
  datalines;
!434!,!23!,!-99999!,!6!,!-99999!,!6|7!,!-99999!,!10!,!311/1803!,!20140930!,!72!,!3.2!
!438!,!97!,!DENTISTRY, GENERAL!,!97!,!TSBDE PROVIDER!,!6|7!,!-99999!,!-99999!,!312/1803!,!20140930!,!72!,!3.2!
!438!,!97!,!!,!97!,!!,!!,!!,!-99999!,!312/1803!,!20140930!,!72!,!3.2!
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Dec 2015 05:25:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Escaping-delimiters-without-dsd/m-p/241109#M44636</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-12-29T05:25:45Z</dc:date>
    </item>
  </channel>
</rss>

