<?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: add multiple record in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/add-multiple-record/m-p/544867#M150690</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/200312"&gt;@Srigyan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am creating a table and updating the record with some queries.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;%let final_File=F_OUTPUT.DS_daily_demand_F;&lt;BR /&gt;%let level= (catx('',OPTION_NUMBER,date,fascia));&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data &amp;amp;final_File._checkpoints;&lt;BR /&gt;format Checkpoints $30. Total_Count 10. comment $100. Check_Date date9.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc sql;&lt;/P&gt;
&lt;P&gt;update &amp;amp;final_File._checkpoints as a&lt;BR /&gt;set&lt;BR /&gt;Checkpoints="Total Records",&lt;BR /&gt;Total_Count=(select Count(*) from &amp;amp;final_File.),&lt;BR /&gt;comment="This is total number cases here",&lt;BR /&gt;Check_Date=today();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc append &amp;amp;final_File._checkpoints=&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Checkpoints="Unique record",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Total_Count=(select Count(distinct product_ID) from &amp;amp;final_File.),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;comment="This is unique number of cases",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Check_Date=today();&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;highlighted portion is not working, how should I write this code.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I suggest copying the Log output for the code that is not working. Copy from the log, the code and &lt;STRONG&gt;all&lt;/STRONG&gt; messages related to the code an paste into a code box opened using the forum's {I} icon to preserve formatting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am fairly sure you are getting a number of error messages that are actually fairly clear.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also describe what you actually attempting to do with the append code.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Mar 2019 14:19:41 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-03-21T14:19:41Z</dc:date>
    <item>
      <title>add multiple record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-multiple-record/m-p/544837#M150683</link>
      <description>&lt;P&gt;I am creating a table and updating the record with some queries.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;%let final_File=F_OUTPUT.DS_daily_demand_F;&lt;BR /&gt;%let level= (catx('',OPTION_NUMBER,date,fascia));&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data &amp;amp;final_File._checkpoints;&lt;BR /&gt;format Checkpoints $30. Total_Count 10. comment $100. Check_Date date9.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sql;&lt;/P&gt;&lt;P&gt;update &amp;amp;final_File._checkpoints as a&lt;BR /&gt;set&lt;BR /&gt;Checkpoints="Total Records",&lt;BR /&gt;Total_Count=(select Count(*) from &amp;amp;final_File.),&lt;BR /&gt;comment="This is total number cases here",&lt;BR /&gt;Check_Date=today();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc append &amp;amp;final_File._checkpoints=&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Checkpoints="Unique record",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Total_Count=(select Count(distinct product_ID) from &amp;amp;final_File.),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;comment="This is unique number of cases",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Check_Date=today();&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;highlighted portion is not working, how should I write this code.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 12:57:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-multiple-record/m-p/544837#M150683</guid>
      <dc:creator>Srigyan</dc:creator>
      <dc:date>2019-03-21T12:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: add multiple record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-multiple-record/m-p/544842#M150685</link>
      <description>&lt;P&gt;It looks like you're trying to alter your&amp;nbsp;&lt;SPAN&gt;&amp;amp;final_File._checkpoints twice - once in your PROC SQL update, and maybe again in your proc append? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you're updating records use PROC SQL. If you want to stack/add additional records use PROC APPEND with base=&amp;lt;original data set&amp;gt; data=&amp;lt;dataset with new records&amp;gt;. PROC APPEND can't use data step logic like you're trying to do. You can first create a temporary dataset with your new data before appending. &lt;A href="https://communities.sas.com/t5/SAS-Programming/How-to-retain-summary-information-across-runs/m-p/540186" target="_self"&gt;See my example here&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You should also look at the &lt;A href="https://go.documentation.sas.com/?docsetId=proc&amp;amp;docsetTarget=p1pyryfvsrne2kn1cv2diraku41o.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;PROC APPEND syntax&lt;/A&gt;, since it looks like you're completely guessing at it, which usually isn't a great approach for SAS.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 13:17:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-multiple-record/m-p/544842#M150685</guid>
      <dc:creator>noling</dc:creator>
      <dc:date>2019-03-21T13:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: add multiple record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-multiple-record/m-p/544867#M150690</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/200312"&gt;@Srigyan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am creating a table and updating the record with some queries.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;%let final_File=F_OUTPUT.DS_daily_demand_F;&lt;BR /&gt;%let level= (catx('',OPTION_NUMBER,date,fascia));&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data &amp;amp;final_File._checkpoints;&lt;BR /&gt;format Checkpoints $30. Total_Count 10. comment $100. Check_Date date9.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc sql;&lt;/P&gt;
&lt;P&gt;update &amp;amp;final_File._checkpoints as a&lt;BR /&gt;set&lt;BR /&gt;Checkpoints="Total Records",&lt;BR /&gt;Total_Count=(select Count(*) from &amp;amp;final_File.),&lt;BR /&gt;comment="This is total number cases here",&lt;BR /&gt;Check_Date=today();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc append &amp;amp;final_File._checkpoints=&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Checkpoints="Unique record",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Total_Count=(select Count(distinct product_ID) from &amp;amp;final_File.),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;comment="This is unique number of cases",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Check_Date=today();&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;highlighted portion is not working, how should I write this code.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I suggest copying the Log output for the code that is not working. Copy from the log, the code and &lt;STRONG&gt;all&lt;/STRONG&gt; messages related to the code an paste into a code box opened using the forum's {I} icon to preserve formatting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am fairly sure you are getting a number of error messages that are actually fairly clear.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also describe what you actually attempting to do with the append code.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 14:19:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-multiple-record/m-p/544867#M150690</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-03-21T14:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: add multiple record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-multiple-record/m-p/544880#M150696</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have done this in following way...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;update &amp;amp;final_File._checkpoints as a&lt;BR /&gt;set&lt;BR /&gt;Checkpoints="Total Records",&lt;BR /&gt;Total_Count=(select Count(*) from &amp;amp;final_File.),&lt;BR /&gt;comment="This is total number cases here",&lt;BR /&gt;Update_Date=today();&lt;/P&gt;&lt;P&gt;insert into &amp;amp;final_File._checkpoints&lt;BR /&gt;set Checkpoints="Unique record",&lt;BR /&gt;Total_Count=(select Count(distinct &amp;amp;level.) from &amp;amp;final_File.),&lt;BR /&gt;comment="This is unique number of cases",&lt;BR /&gt;Update_Date=today();&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 14:44:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-multiple-record/m-p/544880#M150696</guid>
      <dc:creator>Srigyan</dc:creator>
      <dc:date>2019-03-21T14:44:16Z</dc:date>
    </item>
  </channel>
</rss>

