<?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 SAS add a value into an existing row in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-add-a-value-into-an-existing-row/m-p/739294#M230716</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to add value to an existing row.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, I have a table,&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
    input num1 num2 mydate date9.;
    format mydate date9.;
    datalines;
1200 50000 05MAY1985
0 0 17AUG1982
1500 43500 23OCT1991
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the output:&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;Obs num1 num2 mydate123 &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1200&lt;/TD&gt;&lt;TD&gt;50000&lt;/TD&gt;&lt;TD&gt;05MAY1985&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;17AUG1982&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1500&lt;/TD&gt;&lt;TD&gt;43500&lt;/TD&gt;&lt;TD&gt;23OCT1991&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;The second row has 0 and 0. I want to change 0,0 to 1700, 60000. Can I do that use SAS?&lt;/P&gt;&lt;P&gt;Thank you all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JH&lt;/P&gt;</description>
    <pubDate>Wed, 05 May 2021 17:55:15 GMT</pubDate>
    <dc:creator>jhusoc</dc:creator>
    <dc:date>2021-05-05T17:55:15Z</dc:date>
    <item>
      <title>SAS add a value into an existing row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-add-a-value-into-an-existing-row/m-p/739294#M230716</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to add value to an existing row.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, I have a table,&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
    input num1 num2 mydate date9.;
    format mydate date9.;
    datalines;
1200 50000 05MAY1985
0 0 17AUG1982
1500 43500 23OCT1991
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the output:&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;Obs num1 num2 mydate123 &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1200&lt;/TD&gt;&lt;TD&gt;50000&lt;/TD&gt;&lt;TD&gt;05MAY1985&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;17AUG1982&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1500&lt;/TD&gt;&lt;TD&gt;43500&lt;/TD&gt;&lt;TD&gt;23OCT1991&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;The second row has 0 and 0. I want to change 0,0 to 1700, 60000. Can I do that use SAS?&lt;/P&gt;&lt;P&gt;Thank you all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JH&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 17:55:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-add-a-value-into-an-existing-row/m-p/739294#M230716</guid>
      <dc:creator>jhusoc</dc:creator>
      <dc:date>2021-05-05T17:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS add a value into an existing row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-add-a-value-into-an-existing-row/m-p/739296#M230717</link>
      <description>The real dataset is huge. I cannot make a new table to replace the current one. I just want to add the values to the table. Thanks.</description>
      <pubDate>Wed, 05 May 2021 17:57:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-add-a-value-into-an-existing-row/m-p/739296#M230717</guid>
      <dc:creator>jhusoc</dc:creator>
      <dc:date>2021-05-05T17:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: SAS add a value into an existing row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-add-a-value-into-an-existing-row/m-p/739299#M230720</link>
      <description>&lt;P&gt;Sounds like you want to use the &lt;A href="https://documentation.sas.com/doc/en/vdmmlcdc/8.1/lestmtsref/n0g9jfr4x5hgsfn17gtma5547lt1.htm" target="_self"&gt;Modify Statement&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 18:08:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-add-a-value-into-an-existing-row/m-p/739299#M230720</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-05-05T18:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: SAS add a value into an existing row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-add-a-value-into-an-existing-row/m-p/739308#M230726</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/342187"&gt;@jhusoc&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to add value to an existing row.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, I have a table,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
    input num1 num2 mydate date9.;
    format mydate date9.;
    datalines;
1200 50000 05MAY1985
0 0 17AUG1982
1500 43500 23OCT1991
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;the output:&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;Obs num1 num2 mydate123
&lt;TABLE cellspacing="0" cellpadding="5"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;1200&lt;/TD&gt;
&lt;TD&gt;50000&lt;/TD&gt;
&lt;TD&gt;05MAY1985&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;17AUG1982&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1500&lt;/TD&gt;
&lt;TD&gt;43500&lt;/TD&gt;
&lt;TD&gt;23OCT1991&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;The second row has 0 and 0. I want to change 0,0 to 1700, 60000. Can I do that use SAS?&lt;/P&gt;
&lt;P&gt;Thank you all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;JH&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In your "real" data is it only one record or multiple that need this change?&lt;/P&gt;
&lt;P&gt;If more than one record, do they all have the same change or different?&lt;/P&gt;
&lt;P&gt;Do you have a variable, or combination of variables, that uniquely identify this record (or other records that need change)?&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 18:45:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-add-a-value-into-an-existing-row/m-p/739308#M230726</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-05-05T18:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: SAS add a value into an existing row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-add-a-value-into-an-existing-row/m-p/739311#M230727</link>
      <description>Currently. I just have one row that needs to change. But if I know how to change multiple rows, it'll be excellent!&lt;BR /&gt;If more than one change, they'll be different.&lt;BR /&gt;Yes. I have a unique variable for changing the records.&lt;BR /&gt;&lt;BR /&gt;Thank you!</description>
      <pubDate>Wed, 05 May 2021 18:51:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-add-a-value-into-an-existing-row/m-p/739311#M230727</guid>
      <dc:creator>jhusoc</dc:creator>
      <dc:date>2021-05-05T18:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: SAS add a value into an existing row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-add-a-value-into-an-existing-row/m-p/739362#M230748</link>
      <description>&lt;P&gt;Hi &lt;A class="trigger-hovercard" style="color: #007dc3;" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/342187" target="_blank"&gt;jhusoc&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This may not be the most efficient way to do it, but it is perhaps the simplest:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
    input num1 num2 mydate date9.;
    format mydate date9.;
    datalines;
1200 50000 05MAY1985
0 0 17AUG1982
1500 43500 23OCT1991
;
data mydata;
   set mydata;
   if _n_=2 then
   do;
      num1 = 1700;&lt;BR /&gt;      num2 = 60000;
   end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 22:07:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-add-a-value-into-an-existing-row/m-p/739362#M230748</guid>
      <dc:creator>LeonidBatkhan</dc:creator>
      <dc:date>2021-05-05T22:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS add a value into an existing row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-add-a-value-into-an-existing-row/m-p/739422#M230788</link>
      <description>&lt;P&gt;Probably not what you need, but since you haven't explained your need on the full data set, this does what you asked for:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
  input NUM1 NUM2 MYDATE date9.;
  format MYDATE date9.;
  if NUM1=0 then NUM1=1700;
  if NUM2=0 then NUM1=60000;
  datalines;
1200 50000 05MAY1985
0 0 17AUG1982
1500 43500 23OCT1991
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 08:01:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-add-a-value-into-an-existing-row/m-p/739422#M230788</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-05-06T08:01:48Z</dc:date>
    </item>
  </channel>
</rss>

