<?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: How do I read every value within delimiter to a new row in SAS? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525013#M142824</link>
    <description>&lt;P&gt;Do like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input string $50.;
datalines;
abc|def|ghi
klm|nop|qrs
;

data want(keep=word);
   set have;
   do i=1 to countw(string, '|');
      word=scan(string, i, '|');
      output;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 07 Jan 2019 12:23:28 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2019-01-07T12:23:28Z</dc:date>
    <item>
      <title>How do I read every value within delimiter to a new row in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525009#M142822</link>
      <description>&lt;P&gt;I have a delimited file like&amp;nbsp;this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;abc|def|ghi&lt;/P&gt;
&lt;P&gt;klm|nop|qrs&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and I want the output to appear like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;abc&lt;/P&gt;
&lt;P&gt;def&lt;/P&gt;
&lt;P&gt;ghi&lt;/P&gt;
&lt;P&gt;klm&lt;/P&gt;
&lt;P&gt;nop&lt;/P&gt;
&lt;P&gt;qrs&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 12:11:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525009#M142822</guid>
      <dc:creator>AshleyBright</dc:creator>
      <dc:date>2019-01-07T12:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read every value within delimiter to a new row in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525013#M142824</link>
      <description>&lt;P&gt;Do like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input string $50.;
datalines;
abc|def|ghi
klm|nop|qrs
;

data want(keep=word);
   set have;
   do i=1 to countw(string, '|');
      word=scan(string, i, '|');
      output;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Jan 2019 12:23:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525013#M142824</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-01-07T12:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read every value within delimiter to a new row in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525014#M142825</link>
      <description>&lt;P&gt;Thanks for your quick response Draycut! And the problem for me here is I have the data in a CSV file which is inconsistent. The file doesn't have a header. And the no. of delimited values are&amp;nbsp;not fixed within each row. Moreover, length of each row exceeds the allowed limit. So I can't have this in a separate datastep. I should somehow finish this while reading it in the first step.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 12:30:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525014#M142825</guid>
      <dc:creator>AshleyBright</dc:creator>
      <dc:date>2019-01-07T12:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read every value within delimiter to a new row in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525016#M142826</link>
      <description>&lt;P&gt;very similar to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;solution&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want(drop = i);&lt;BR /&gt;length col1 $ 3;&lt;BR /&gt;input @ ;&lt;BR /&gt;do i = 1 to countw(_infile_,'|');&lt;BR /&gt;col1 = scan(_infile_,i,'|');&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;datalines;&lt;BR /&gt;abc|def|ghi&lt;BR /&gt;klm|nop|qrs&lt;BR /&gt;;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Jan 2019 12:40:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525016#M142826</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2019-01-07T12:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read every value within delimiter to a new row in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525020#M142828</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37783"&gt;@kiranv_&lt;/a&gt;&amp;nbsp;thanks a lot for your quick responses. I really appreciate that. The no. of characters in each of those delimited rows is&amp;nbsp;as high as 100,000. So I am not able to hold that whole row as one record and my data is truncating.&amp;nbsp;Could you please guide me on that please.. For example, I have abc|def|ghi|....| upto 40,000 characters.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 13:30:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525020#M142828</guid>
      <dc:creator>AshleyBright</dc:creator>
      <dc:date>2019-01-07T13:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read every value within delimiter to a new row in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525022#M142829</link>
      <description>&lt;P&gt;just wondering to know whether you really need to read that long text. dos it make sense for your business.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 13:41:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525022#M142829</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2019-01-07T13:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read every value within delimiter to a new row in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525023#M142830</link>
      <description>Hi:&lt;BR /&gt;  Have you looked at LRECL= option of the INFILE statement to set your INPUT buffer to a longer length? Or the LRECL system option?&lt;BR /&gt;Cynthia</description>
      <pubDate>Mon, 07 Jan 2019 13:46:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525023#M142830</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-01-07T13:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read every value within delimiter to a new row in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525025#M142831</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp;I have set the LRECL to 32760 with the&amp;nbsp;infile option.&amp;nbsp;I have rows longer than that &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 13:58:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525025#M142831</guid>
      <dc:creator>AshleyBright</dc:creator>
      <dc:date>2019-01-07T13:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read every value within delimiter to a new row in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525026#M142832</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37783"&gt;@kiranv_&lt;/a&gt;&amp;nbsp;It's all delimited values and is very wide.&amp;nbsp;And&amp;nbsp;the width of the rows are not consistent throughout. Yes, it&amp;nbsp;is important for me to read the data and load it..&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 14:04:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525026#M142832</guid>
      <dc:creator>AshleyBright</dc:creator>
      <dc:date>2019-01-07T14:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read every value within delimiter to a new row in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525040#M142837</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/42569"&gt;@AshleyBright&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp;I have set the LRECL to 32760 with the&amp;nbsp;infile option.&amp;nbsp;I have rows longer than that &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This older post seems to have an solution: &lt;A href="https://communities.sas.com/t5/SAS-Procedures/Losing-characters-during-reading-data-from-file/m-p/99725#M27996" target="_blank"&gt;https://communities.sas.com/t5/SAS-Procedures/Losing-characters-during-reading-data-from-file/m-p/99725#M27996&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 14:41:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525040#M142837</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-01-07T14:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read every value within delimiter to a new row in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525087#M142855</link>
      <description>&lt;P&gt;Couldn't you use something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile "/folders/myfolders/long.txt" lrecl=200000 delimiter='|';
  length var $10;
  input var @@;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 16:03:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-every-value-within-delimiter-to-a-new-row-in-SAS/m-p/525087#M142855</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2019-01-07T16:03:43Z</dc:date>
    </item>
  </channel>
</rss>

