<?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: Alternative for dlmstr in SAS 9.1.3. in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Alternative-for-dlmstr-in-SAS-9-1-3/m-p/85150#M24337</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fried,&lt;/P&gt;&lt;P&gt;Thanks for your answer, but looks like your code also works correct only if file line less than 32767 chars, I actually tried your code and it works ok on small files, but my file is more then 32767 and it already contains '2c'x delimiters inside, so I just use another delimiter that doesn't exists in file, but anyway - on files bigger then 32767 looks like it doesn't work.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Aug 2012 08:59:17 GMT</pubDate>
    <dc:creator>Yura2301</dc:creator>
    <dc:date>2012-08-07T08:59:17Z</dc:date>
    <item>
      <title>Alternative for dlmstr in SAS 9.1.3.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Alternative-for-dlmstr-in-SAS-9-1-3/m-p/85146#M24333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need export data from text file that can be more-less big(for example 200 kb), delimiter should be some set of characters(for example '&amp;lt;test&amp;gt;').&lt;/P&gt;&lt;P&gt;So if I'll have file with text: "111&amp;lt;test&amp;gt;22222 3333&amp;lt;test&amp;gt;444&amp;lt;test&amp;gt;" result should be one column table with data:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;111&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;22222 3333&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;4444&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I use sas 9.1.3 and in this version dlmstr option isn't presented , so can I somehow optimal read such files and create one column table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2012 14:31:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Alternative-for-dlmstr-in-SAS-9-1-3/m-p/85146#M24333</guid>
      <dc:creator>Yura2301</dc:creator>
      <dc:date>2012-08-06T14:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for dlmstr in SAS 9.1.3.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Alternative-for-dlmstr-in-SAS-9-1-3/m-p/85147#M24334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yura:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you were on a UNIX system, I would declare a FILENAME statement with a "pipe" parameter that would read this data in through AWK or SED or similar to change all "&amp;lt;text&amp;gt;" to, say "!" (or any other character not in the data).&amp;nbsp;&amp;nbsp; Then you could use "dlm='!'" on an infile statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Absent that, try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want (keep=field);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; input ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ** Fill the _INFILE_ automatic var **;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; length text $32767&amp;nbsp; field $40;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; text=tranwrd(_infile_,"&amp;lt;text&amp;gt;",'!');&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ** Make a single-character delimiter **;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do w=1 by 1 while (scan(text,w,'!') ^= ' '); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field=scan(text,w,'!');&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ** Use the delimiter with a SCAN function **;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2012 14:45:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Alternative-for-dlmstr-in-SAS-9-1-3/m-p/85147#M24334</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2012-08-06T14:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for dlmstr in SAS 9.1.3.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Alternative-for-dlmstr-in-SAS-9-1-3/m-p/85148#M24335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt; length x $ 10;&lt;/P&gt;&lt;P&gt; infile cards dlm='2c'x;&lt;/P&gt;&lt;P&gt; input @;&lt;/P&gt;&lt;P&gt; _infile_=prxchange('s/\&amp;lt;test\&amp;gt;/,/',-1,_infile_); *alter the input buffer to change dlmstr to dlm;&lt;/P&gt;&lt;P&gt; input x @@;&lt;/P&gt;&lt;P&gt; if ^missing(x) then output;&lt;/P&gt;&lt;P&gt; cards;&lt;/P&gt;&lt;P&gt;111&amp;lt;test&amp;gt;22222 3333&amp;lt;test&amp;gt;444&amp;lt;test&amp;gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;111&lt;/P&gt;&lt;P&gt;22222 3333&lt;/P&gt;&lt;P&gt;444&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2012 16:35:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Alternative-for-dlmstr-in-SAS-9-1-3/m-p/85148#M24335</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-08-06T16:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for dlmstr in SAS 9.1.3.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Alternative-for-dlmstr-in-SAS-9-1-3/m-p/85149#M24336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;&lt;STRONG&gt;Hi Mkeints,&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;&lt;STRONG&gt;Thanks, your code works ok, but my file is more less big ~200 kb and all data in file is in one line(one row), so code that you proposed(a little bit changed):&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;filename&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; _infile_ &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;Path\data.txt"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; readFromFile;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;infile&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; _infile_ &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;lrecl&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;32767&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; text $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;32767&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; field $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;32767&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; text=tranwrd(_infile_,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'&amp;lt;test&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'~'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; w=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;by&lt;/SPAN&gt; &lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;while&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(scan(text,w,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'~'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;)^=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;''&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field=scan(text,w,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'~'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lenf=length(field);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;&lt;STRONG&gt;So this code higher can read just first 32767 symbols, if you will put 100000,for example, code throw error.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;&lt;STRONG&gt;I can read all file by this code:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data test2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile _infile_ dsd lrecl=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1000000&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; pad;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input txt1 : &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;$32767.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; @@;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row=_n_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;And result table "test2" will have many rows, depends on file size and special symbols in data etc.,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;and then I can just work(scan,substr,merge strings etc.) with these "test2" table to achive needed result, but I'm not sure if it optimal solution in my case.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;May be there is some option that allow to use sas functions that works with strings that are longer then 32767?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Thanks!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2012 07:40:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Alternative-for-dlmstr-in-SAS-9-1-3/m-p/85149#M24336</guid>
      <dc:creator>Yura2301</dc:creator>
      <dc:date>2012-08-07T07:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for dlmstr in SAS 9.1.3.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Alternative-for-dlmstr-in-SAS-9-1-3/m-p/85150#M24337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fried,&lt;/P&gt;&lt;P&gt;Thanks for your answer, but looks like your code also works correct only if file line less than 32767 chars, I actually tried your code and it works ok on small files, but my file is more then 32767 and it already contains '2c'x delimiters inside, so I just use another delimiter that doesn't exists in file, but anyway - on files bigger then 32767 looks like it doesn't work.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2012 08:59:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Alternative-for-dlmstr-in-SAS-9-1-3/m-p/85150#M24337</guid>
      <dc:creator>Yura2301</dc:creator>
      <dc:date>2012-08-07T08:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for dlmstr in SAS 9.1.3.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Alternative-for-dlmstr-in-SAS-9-1-3/m-p/85151#M24338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data x;&lt;/P&gt;&lt;P&gt;infile 'c:\x.txt' recfm=n;&lt;/P&gt;&lt;P&gt;input x $char1. @@;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data temp;&lt;/P&gt;&lt;P&gt;set x ;&lt;/P&gt;&lt;P&gt;if cat(lag6(x),lag5(x),lag4(x),lag3(x),lag2(x),lag1(x))='&amp;lt;test&amp;gt;' then group+1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc transpose data=temp out=want(keep=col:) ;&lt;/P&gt;&lt;P&gt;by group;&lt;/P&gt;&lt;P&gt;var x;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data want(keep=want);&lt;/P&gt;&lt;P&gt;set want;&lt;/P&gt;&lt;P&gt;want=tranwrd(cat(of col:),'&amp;lt;test&amp;gt;',' ');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;消息编辑者为：xia keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2012 10:55:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Alternative-for-dlmstr-in-SAS-9-1-3/m-p/85151#M24338</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-08-07T10:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for dlmstr in SAS 9.1.3.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Alternative-for-dlmstr-in-SAS-9-1-3/m-p/85152#M24339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a technique (untested) that might simplify the programming.&amp;nbsp; It's meant to work as long as none of your fields contains a '&amp;lt;' character.&amp;nbsp; The trick here is using the "@ 'est&amp;gt;" pointer control in the INPUT statement.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I've modified this note to account for the fact that the first field in each line is not preceded by '&amp;lt;test&amp;gt;'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data ;&lt;BR /&gt;&amp;nbsp; infile ..... dlm='&amp;lt;'&amp;nbsp; lrecl=1000000&amp;nbsp; length=len column=col;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* COL above is the column pointer after the most recent INPUT statement */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length field $200;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input field @;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do while (col&amp;lt;len);&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input @ 'est&amp;gt;' field @;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;If the infile is a single long line, then you can simplify to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data ;&lt;BR /&gt;&amp;nbsp; infile ..... dlm='&amp;lt;'&amp;nbsp; lrecl=1000000&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length field $200;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _n_=1 then input field @@;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else input @ 'est&amp;gt;' field @@;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first example uses a trailing single "@", telling SAS to release the current input line when the end of the DATA step is encountered (thereby removing the "lost card" message of an earlier version using double "@@").&amp;nbsp; The second example uses a trailing double "@@" telling sas NOT to drop the input line.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2012 13:44:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Alternative-for-dlmstr-in-SAS-9-1-3/m-p/85152#M24339</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2012-08-07T13:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for dlmstr in SAS 9.1.3.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Alternative-for-dlmstr-in-SAS-9-1-3/m-p/85153#M24340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gave this a bit more thought.&amp;nbsp; I'm not incredibly pleased with the following, but it appears to get the job done.&amp;nbsp; I testing with a file of several MB of data all on a single line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Process flow:&lt;/P&gt;&lt;P&gt;1) Read in a binary stream from the file 'in' 256 bytes at a time.&lt;/P&gt;&lt;P&gt;2) search in a loop for delimited strings and substring them out until reaching the end of stream.&lt;/P&gt;&lt;P&gt;3) concatenate remainder from previous try that did not end in a dlmstr and repeat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt; length infile buffer $ 512;&lt;/P&gt;&lt;P&gt; if _n_=1 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; dlmstr='&amp;lt;test&amp;gt;';&lt;/P&gt;&lt;P&gt;&amp;nbsp; _prx=prxparse( '/(' || dlmstr || ')|(.)/' );&lt;/P&gt;&lt;P&gt;&amp;nbsp; retain _prx dlmstr;&lt;/P&gt;&lt;P&gt;&amp;nbsp; call missing(buffer);&lt;/P&gt;&lt;P&gt; end;&lt;/P&gt;&lt;P&gt; else if n&amp;gt;0 then buffer=substr(infile,length(infile)+1-n);&lt;/P&gt;&lt;P&gt; infile in recfm=n lrecl=256;&lt;/P&gt;&lt;P&gt; input infile $256.;&lt;/P&gt;&lt;P&gt; infile=strip(buffer) || infile;&lt;/P&gt;&lt;P&gt; start=1;&lt;/P&gt;&lt;P&gt; stop=length(infile);&lt;/P&gt;&lt;P&gt; n=0;&lt;/P&gt;&lt;P&gt; retain n infile;&lt;/P&gt;&lt;P&gt; call prxnext(_prx,start,stop,infile,pos,len);&lt;/P&gt;&lt;P&gt; do while(pos &amp;gt; 0);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if len=length(dlmstr) then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; x=substr(infile,pos-n,n);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; n=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else n++1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; call prxnext(_prx,start,stop,infile,pos,len);&lt;/P&gt;&lt;P&gt; end;&lt;/P&gt;&lt;P&gt; keep x;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2012 23:06:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Alternative-for-dlmstr-in-SAS-9-1-3/m-p/85153#M24340</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-08-13T23:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for dlmstr in SAS 9.1.3.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Alternative-for-dlmstr-in-SAS-9-1-3/m-p/85154#M24341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ksharp,&lt;/P&gt;&lt;P&gt;I caught the idea, I didn't try all your just part of it( till transpose) plus some simple char concatenations&amp;nbsp; so in the end I achive needed goal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2012 08:38:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Alternative-for-dlmstr-in-SAS-9-1-3/m-p/85154#M24341</guid>
      <dc:creator>Yura2301</dc:creator>
      <dc:date>2012-08-15T08:38:22Z</dc:date>
    </item>
  </channel>
</rss>

