<?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 to add new rows in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-new-rows/m-p/602337#M174377</link>
    <description>&lt;P&gt;What logic determines when to add 3 or 4 rows?&lt;/P&gt;</description>
    <pubDate>Thu, 07 Nov 2019 07:14:09 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2019-11-07T07:14:09Z</dc:date>
    <item>
      <title>How to add new rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-new-rows/m-p/602331#M174371</link>
      <description>Data new;&lt;BR /&gt;Input id Stat $ ;&lt;BR /&gt;datalines;&lt;BR /&gt;01 yes&lt;BR /&gt;02 yes&lt;BR /&gt;03 yes&lt;BR /&gt;04 yes&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;Now If id=yes ,I want to add three values(high, medium,low) per subject .&lt;BR /&gt;Output should like...&lt;BR /&gt;&lt;BR /&gt;Id result&lt;BR /&gt;01 High&lt;BR /&gt;01 medium&lt;BR /&gt;01 low&lt;BR /&gt;02 high&lt;BR /&gt;02 medium&lt;BR /&gt;02 low&lt;BR /&gt;&lt;BR /&gt;Could you please help me how to do this one&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you!</description>
      <pubDate>Thu, 07 Nov 2019 06:41:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-new-rows/m-p/602331#M174371</guid>
      <dc:creator>sasuser123123</dc:creator>
      <dc:date>2019-11-07T06:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to add new rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-new-rows/m-p/602332#M174372</link>
      <description>If stat=yes ..not I'd&lt;BR /&gt;Sorry for the mistake</description>
      <pubDate>Thu, 07 Nov 2019 06:42:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-new-rows/m-p/602332#M174372</guid>
      <dc:creator>sasuser123123</dc:creator>
      <dc:date>2019-11-07T06:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to add new rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-new-rows/m-p/602333#M174373</link>
      <description>&lt;P&gt;Here is a way&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data new;
Input id Stat $ ;
datalines;
01 yes
02 yes
03 yes
04 yes
;

data want;
    set new;
    length result $ 10;
    if stat='yes' then do result='High', 'Medium', 'Low';
        output;
    end;
    drop Stat;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Id  Result
1   High
1   Medium
1   Low
2   High
2   Medium
2   Low
3   High
3   Medium
3   Low
4   High
4   Medium
4   Low&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Nov 2019 06:52:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-new-rows/m-p/602333#M174373</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-11-07T06:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to add new rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-new-rows/m-p/602335#M174375</link>
      <description>&lt;P&gt;This is a more novice approach but does it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data result_table;
input stat $ result $;
datalines;
yes High
yes Medium
yes Low
;

proc sql;
create table want as
select t1.id, t2.result 
from new t1 left join result_table t2 on t1.Stat=t2.Stat
order by t1.id, t2.result
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Nov 2019 06:56:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-new-rows/m-p/602335#M174375</guid>
      <dc:creator>sustagens</dc:creator>
      <dc:date>2019-11-07T06:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to add new rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-new-rows/m-p/602336#M174376</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt; thank you so much for your help.&lt;BR /&gt;It's perfectly fine.&lt;BR /&gt;But how to do if we want to add 3 values to one subject and 4 values to another subject.</description>
      <pubDate>Thu, 07 Nov 2019 07:12:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-new-rows/m-p/602336#M174376</guid>
      <dc:creator>sasuser123123</dc:creator>
      <dc:date>2019-11-07T07:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to add new rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-new-rows/m-p/602337#M174377</link>
      <description>&lt;P&gt;What logic determines when to add 3 or 4 rows?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 07:14:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-new-rows/m-p/602337#M174377</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-11-07T07:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to add new rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-new-rows/m-p/602338#M174378</link>
      <description>Oh okay .. exactly. I got your point , it depends on logic or the condition.&lt;BR /&gt;&lt;BR /&gt;Thank you so much !!!</description>
      <pubDate>Thu, 07 Nov 2019 07:19:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-new-rows/m-p/602338#M174378</guid>
      <dc:creator>sasuser123123</dc:creator>
      <dc:date>2019-11-07T07:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to add new rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-new-rows/m-p/602339#M174379</link>
      <description>&lt;P&gt;Anytime &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 07:21:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-new-rows/m-p/602339#M174379</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-11-07T07:21:58Z</dc:date>
    </item>
  </channel>
</rss>

