<?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 function in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/help-with-function/m-p/483395#M71715</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
length id val $200;
input id val ;
datalines;
1 3,8,9,8
2 3,8,9,8
;

run;

data want;
set one;
temp=compress(val,',');
do n=1 to length(temp);
want=char(temp,n);
output;
end;
keep id want;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 02 Aug 2018 14:07:30 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-08-02T14:07:30Z</dc:date>
    <item>
      <title>help with function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-function/m-p/483387#M71712</link>
      <description>&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; one;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#ff8040" face="Courier New"&gt;length&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; id val $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New"&gt;200&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#ff8040" face="Courier New"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; id val ;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#ff8040" face="Courier New"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;1 3,8,9,8&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;2 3,8,9,8&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#ff0000" face="Courier New"&gt;/*output&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; should be &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#008080" face="Courier New"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#008080" face="Courier New"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New"&gt;8&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#008080" face="Courier New"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New"&gt;9&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#008080" face="Courier New"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New"&gt;8&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#008080" face="Courier New"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#008080" face="Courier New"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New"&gt;8&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#008080" face="Courier New"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New"&gt;9&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#008080" face="Courier New"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New"&gt;8&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using the scan function but it doesn't work. I am trying to separate the values after the commas to a new variable as listed above&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 13:52:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-function/m-p/483387#M71712</guid>
      <dc:creator>chrissowden</dc:creator>
      <dc:date>2018-08-02T13:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: help with function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-function/m-p/483389#M71713</link>
      <description>&lt;P&gt;If you tried using the SCAN function and it doesn't work ... show us what you did.&amp;nbsp; Show us the SASLOG so we can see your code and error messages.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HINT: Don't ever tell us "it doesn't work" without additional explanation because that's not enough information for us to help you. Explain! Show us the SASLOG.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 13:58:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-function/m-p/483389#M71713</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-08-02T13:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: help with function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-function/m-p/483393#M71714</link>
      <description>&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; test;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#ff8040" face="Courier New"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; one;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;new_var = compress(val,&lt;/FONT&gt;&lt;FONT color="#ff00ff" face="Courier New"&gt;','&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;this is what I got to work, it removes the commas but I was trying to use a do loop to get it to populate into a 4 different obs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 14:03:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-function/m-p/483393#M71714</guid>
      <dc:creator>chrissowden</dc:creator>
      <dc:date>2018-08-02T14:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: help with function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-function/m-p/483395#M71715</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
length id val $200;
input id val ;
datalines;
1 3,8,9,8
2 3,8,9,8
;

run;

data want;
set one;
temp=compress(val,',');
do n=1 to length(temp);
want=char(temp,n);
output;
end;
keep id want;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Aug 2018 14:07:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-function/m-p/483395#M71715</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-08-02T14:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: help with function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-function/m-p/483396#M71716</link>
      <description>&lt;P&gt;So you are not going to show us the SASLOG for the problem you had with the SCAN function? You don't need help with that any more?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 14:08:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-function/m-p/483396#M71716</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-08-02T14:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: help with function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-function/m-p/483397#M71717</link>
      <description>&lt;P&gt;That's awesome!! works great!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 14:10:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-function/m-p/483397#M71717</guid>
      <dc:creator>chrissowden</dc:creator>
      <dc:date>2018-08-02T14:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: help with function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-function/m-p/483405#M71718</link>
      <description>&lt;P&gt;Thats overthinking it.&amp;nbsp; A simple change to the import program eliminates the need for post processing at all:&lt;/P&gt;
&lt;PRE&gt;data one;
  infile datalines dlm=" ,";
  length id val1 val2 val3 val4 8;
  input id val1--val4;
datalines;
1 3,8,9,8
2 3,8,9,8
;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Aug 2018 14:21:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-function/m-p/483405#M71718</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-08-02T14:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: help with function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-function/m-p/483406#M71719</link>
      <description>&lt;P&gt;So the solution by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;seems to work if you can guarantee that the numbers in the original data set are integers between 0 and 9. It will not work if the numbers are 10 or higher; it will not work for negative numbers and it will not work for non-integers.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 14:23:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-function/m-p/483406#M71719</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-08-02T14:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: help with function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-function/m-p/483429#M71721</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/130109"&gt;@chrissowden&lt;/a&gt;&amp;nbsp; If you are reading an external file and not SAS dataset, I think&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;solution is right. However if you are reading a SAS dataset, you can stick to mine and tweak it if need be&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 14:50:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-function/m-p/483429#M71721</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-08-02T14:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: help with function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-function/m-p/483438#M71722</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;Thank you for waking me up.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Revised to address -ve and higher digits&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data one;
length id val $200;
input id val ;
datalines;
1 -3,8888,9,-80
2 39,88,9,8
;

run;

data want;
set one;
length want $20.;
do n=1 to countw(val,',');
want=scan(val,n,',');
output;
end;
keep id want;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Aug 2018 15:08:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-function/m-p/483438#M71722</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-08-02T15:08:03Z</dc:date>
    </item>
  </channel>
</rss>

