<?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: Insert rows into table on condition in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Insert-rows-into-table-on-condition/m-p/839620#M41540</link>
    <description>&lt;P&gt;You can solve this in many ways, programmatically.&lt;/P&gt;
&lt;P&gt;One way is to have data step that evaluates the macro variable, and does explcit OUTPUT. And the PROC APPEND to you target table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I imagine that you build macro logic to dynamically generate PROC SQL INSERT statments directly into the target table.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Oct 2022 12:13:27 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2022-10-20T12:13:27Z</dc:date>
    <item>
      <title>Insert rows into table on condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Insert-rows-into-table-on-condition/m-p/839602#M41539</link>
      <description>&lt;P&gt;Hi dear friends,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have been user of SAS EG for a long time but I use very rarely programming language in my work.&lt;/P&gt;
&lt;P&gt;Now I need to find solution for task, that I can't solve using just SAS EG features.&lt;/P&gt;
&lt;P&gt;I have a table and I would like to add n rows with fields f1 and f2 to it depends on makro-variables:v1,v2,v3&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If variable v1 is 0&amp;nbsp; I have to add 3 row and set the field f2&amp;nbsp; in each row as&amp;nbsp; 'v1', 'v2', 'v3' ;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If variable v2 is 0&amp;nbsp; I have to add 2 row and set the field f2 in each row as&amp;nbsp; &amp;nbsp;'v2', 'v3';&lt;/P&gt;
&lt;P&gt;If variable v3 is 0&amp;nbsp; I have to add 1 row and set the field f2 in it as&amp;nbsp; &amp;nbsp; 'v3';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Natalja&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 09:22:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Insert-rows-into-table-on-condition/m-p/839602#M41539</guid>
      <dc:creator>NataljaK</dc:creator>
      <dc:date>2022-10-20T09:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Insert rows into table on condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Insert-rows-into-table-on-condition/m-p/839620#M41540</link>
      <description>&lt;P&gt;You can solve this in many ways, programmatically.&lt;/P&gt;
&lt;P&gt;One way is to have data step that evaluates the macro variable, and does explcit OUTPUT. And the PROC APPEND to you target table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I imagine that you build macro logic to dynamically generate PROC SQL INSERT statments directly into the target table.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 12:13:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Insert-rows-into-table-on-condition/m-p/839620#M41540</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2022-10-20T12:13:27Z</dc:date>
    </item>
  </channel>
</rss>

