<?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 How to insert observations based on the environment variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-insert-observations-based-on-the-environment-variable/m-p/586299#M167360</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have a SAS Data set with&amp;nbsp;BATCH_NO,&amp;nbsp;SNAPST_DT and&amp;nbsp;TABLE_NM variables and some values.&lt;/P&gt;&lt;P&gt;I have a .sas file. Upon executing this .sas file it creates some values to the environment variables. Now, I want to insert those values into the SAS dataset. Please suggest me how can I do that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a way of updating the SAS data set update by using the below code:&lt;/P&gt;&lt;DIV&gt;proc sql;&lt;BR /&gt;&amp;nbsp; update Lib1.A_batch_table_met_one&lt;BR /&gt;&amp;nbsp; &amp;nbsp; set No_Of_Records=input(sysget('NEW_TABLE_ROW_VAL'),best.)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; where Batch_No=input(sysget('BATCH_NO'),best.)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;AND Table_Name=sysget('TABLE_NM')&lt;BR /&gt;;&amp;nbsp;&lt;BR /&gt;quit;&lt;/DIV&gt;</description>
    <pubDate>Thu, 05 Sep 2019 04:52:30 GMT</pubDate>
    <dc:creator>VVDR</dc:creator>
    <dc:date>2019-09-05T04:52:30Z</dc:date>
    <item>
      <title>How to insert observations based on the environment variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-insert-observations-based-on-the-environment-variable/m-p/586299#M167360</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have a SAS Data set with&amp;nbsp;BATCH_NO,&amp;nbsp;SNAPST_DT and&amp;nbsp;TABLE_NM variables and some values.&lt;/P&gt;&lt;P&gt;I have a .sas file. Upon executing this .sas file it creates some values to the environment variables. Now, I want to insert those values into the SAS dataset. Please suggest me how can I do that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a way of updating the SAS data set update by using the below code:&lt;/P&gt;&lt;DIV&gt;proc sql;&lt;BR /&gt;&amp;nbsp; update Lib1.A_batch_table_met_one&lt;BR /&gt;&amp;nbsp; &amp;nbsp; set No_Of_Records=input(sysget('NEW_TABLE_ROW_VAL'),best.)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; where Batch_No=input(sysget('BATCH_NO'),best.)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;AND Table_Name=sysget('TABLE_NM')&lt;BR /&gt;;&amp;nbsp;&lt;BR /&gt;quit;&lt;/DIV&gt;</description>
      <pubDate>Thu, 05 Sep 2019 04:52:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-insert-observations-based-on-the-environment-variable/m-p/586299#M167360</guid>
      <dc:creator>VVDR</dc:creator>
      <dc:date>2019-09-05T04:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert observations based on the environment variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-insert-observations-based-on-the-environment-variable/m-p/586304#M167363</link>
      <description>&lt;P&gt;This is an untested code, you should try to join the two tables &lt;CODE class=" language-sas"&gt;lib1.a_batch_table_met_one&lt;/CODE&gt; and the one table have with new variables and join them on BATCH_NO and TABLE_NM variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as select a.*,b.var1,b.var2 from lib1.a_batch_table_met_one as a left join have as b on a.batch_no=b.batch_no and a.table_nm=b.table_nm;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Sep 2019 05:55:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-insert-observations-based-on-the-environment-variable/m-p/586304#M167363</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-09-05T05:55:46Z</dc:date>
    </item>
  </channel>
</rss>

