<?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: Help with crazy delimiters in TXT file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-with-crazy-delimiters-in-TXT-file/m-p/241113#M44640</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/66714"&gt;@Jsanders﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Is this a study question?&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/66730"&gt;@adamsonb﻿&lt;/a&gt;&amp;nbsp;asked exactly the same here:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/Escaping-delimiters-without-dsd/m-p/241076#U241076" target="_blank"&gt;https://communities.sas.com/t5/Base-SAS-Programming/Escaping-delimiters-without-dsd/m-p/241076#U241076&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe "DLMSTR=" could be used to solve the problem.&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 06:16:12 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2015-12-29T06:16:12Z</dc:date>
    <item>
      <title>Help with crazy delimiters in TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-crazy-delimiters-in-TXT-file/m-p/241034#M44591</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I have the following text file I need to input using an infile statement.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;!ProviderID!,!ProviderSpecialty!,!ProviderSpecialtyOther!,!ProviderType!,!ProviderTypeOther!,!PracticeType!,!PracticeTypeOther!,!ProviderYears!,!itemNumber!,!extractDate!,!providingSite!,!ddVersion!&lt;BR /&gt;!4!,!28!,!-99999!,!6!,!-99999!,!5!,!-99999!,!19!,!1/1803!,!20140930!,!72!,!3.2!&lt;BR /&gt;!5!,!28!,!-99999!,!6!,!-99999!,!6|7!,!-99999!,!18!,!2/1803!,!20140930!,!72!,!3.2!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data I need is within the exclamation points and the delimiter is a comma. Is there a way to strip the exclamation points and have dlm=comma? I tried using the 'dlmstr' option and was not successful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Joanne&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2015 17:43:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-crazy-delimiters-in-TXT-file/m-p/241034#M44591</guid>
      <dc:creator>Jsanders</dc:creator>
      <dc:date>2015-12-28T17:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help with crazy delimiters in TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-crazy-delimiters-in-TXT-file/m-p/241036#M44593</link>
      <description>&lt;P&gt;Easiest might be to treat both commas and exclamation points as delimiters:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;infile whatever dlm=',!';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that doesn't do the job, we can explore other possibilities.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do NOT add the DSD option in that case ... and it will complicate things if you have more than 2 consecutive delimiters.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2015 18:00:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-crazy-delimiters-in-TXT-file/m-p/241036#M44593</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-12-28T18:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help with crazy delimiters in TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-crazy-delimiters-in-TXT-file/m-p/241041#M44595</link>
      <description>&lt;P&gt;I think that did the trick, thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2015 18:09:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-crazy-delimiters-in-TXT-file/m-p/241041#M44595</guid>
      <dc:creator>Jsanders</dc:creator>
      <dc:date>2015-12-28T18:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help with crazy delimiters in TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-crazy-delimiters-in-TXT-file/m-p/241077#M44613</link>
      <description>&lt;P&gt;An alternative that would provide proper handling of empty fields would be&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 "yourfile.txt" dsd firstobs=2;
input @;
_infile_ = translate (_infile_,"""", "!");
input ProviderID ProviderSpecialty ProviderSpecialtyOther ProviderType $
	ProviderTypeOther PracticeType $ PracticeTypeOther ProviderYears itemNumber $
	extractDate :yymmdd8. providingSite ddVersion;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Dec 2015 20:36:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-crazy-delimiters-in-TXT-file/m-p/241077#M44613</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-12-28T20:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help with crazy delimiters in TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-crazy-delimiters-in-TXT-file/m-p/241113#M44640</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/66714"&gt;@Jsanders﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Is this a study question?&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/66730"&gt;@adamsonb﻿&lt;/a&gt;&amp;nbsp;asked exactly the same here:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/Escaping-delimiters-without-dsd/m-p/241076#U241076" target="_blank"&gt;https://communities.sas.com/t5/Base-SAS-Programming/Escaping-delimiters-without-dsd/m-p/241076#U241076&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe "DLMSTR=" could be used to solve the problem.&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 06:16:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-crazy-delimiters-in-TXT-file/m-p/241113#M44640</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-12-29T06:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Help with crazy delimiters in TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-crazy-delimiters-in-TXT-file/m-p/241132#M44644</link>
      <description>Yes! Thank you Patrick. I started working on this issue then had to pass it off to a colleague. I asked him to post to the SAS community since you all are so helpful.&lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;Joanne&lt;BR /&gt;</description>
      <pubDate>Tue, 29 Dec 2015 13:52:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-crazy-delimiters-in-TXT-file/m-p/241132#M44644</guid>
      <dc:creator>Jsanders</dc:creator>
      <dc:date>2015-12-29T13:52:36Z</dc:date>
    </item>
  </channel>
</rss>

