<?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 Replicate Data Within Table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Replicate-Data-Within-Table/m-p/585899#M167182</link>
    <description>&lt;P&gt;How do I duplicate data but still process it? I know that you can use the output statement to create a duplicate record, but if you do any processing after this point it shows up as missing. You can see this in the Test dataset - the Runs field, created after the output statement, is blank for Smith's duplicated observation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   infile datalines dsd;
   input Name : $9. Score1-Score3 Team ~ $25. Div $;
   datalines;
Smith,12,22,46,"Green Hornets, Atlanta",AAA 
Mitchel,23,19,25,"High Volts, Portland",AAA 
Jones,09,17,54,"Vulcans, Las Vegas",AA 
; 

data test;
set scores;
	if name = "Smith" then output;
	Runs=sum(Score1,Score2,Score3);
	output;
run;

data want;
   infile datalines dsd;
   input Name : $9. Score1-Score3 Team ~ $25. Div $ Runs $2.;
   datalines;
Smith,12,22,46,"Green Hornets, Atlanta",AAA,80
Smith,12,22,46,"Green Hornets, Atlanta",AAA,80 
Mitchel,23,19,25,"High Volts, Portland",AAA,67 
Jones,09,17,54,"Vulcans, Las Vegas",AA,80 
; &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 03 Sep 2019 17:42:12 GMT</pubDate>
    <dc:creator>theponcer</dc:creator>
    <dc:date>2019-09-03T17:42:12Z</dc:date>
    <item>
      <title>Replicate Data Within Table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replicate-Data-Within-Table/m-p/585899#M167182</link>
      <description>&lt;P&gt;How do I duplicate data but still process it? I know that you can use the output statement to create a duplicate record, but if you do any processing after this point it shows up as missing. You can see this in the Test dataset - the Runs field, created after the output statement, is blank for Smith's duplicated observation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   infile datalines dsd;
   input Name : $9. Score1-Score3 Team ~ $25. Div $;
   datalines;
Smith,12,22,46,"Green Hornets, Atlanta",AAA 
Mitchel,23,19,25,"High Volts, Portland",AAA 
Jones,09,17,54,"Vulcans, Las Vegas",AA 
; 

data test;
set scores;
	if name = "Smith" then output;
	Runs=sum(Score1,Score2,Score3);
	output;
run;

data want;
   infile datalines dsd;
   input Name : $9. Score1-Score3 Team ~ $25. Div $ Runs $2.;
   datalines;
Smith,12,22,46,"Green Hornets, Atlanta",AAA,80
Smith,12,22,46,"Green Hornets, Atlanta",AAA,80 
Mitchel,23,19,25,"High Volts, Portland",AAA,67 
Jones,09,17,54,"Vulcans, Las Vegas",AA,80 
; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Sep 2019 17:42:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replicate-Data-Within-Table/m-p/585899#M167182</guid>
      <dc:creator>theponcer</dc:creator>
      <dc:date>2019-09-03T17:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate Data Within Table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replicate-Data-Within-Table/m-p/585904#M167183</link>
      <description>&lt;P&gt;Just do the calculation before the output statement?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
set have;
	Runs=sum(Score1,Score2,Score3);
	if name = "Smith" then output;
	output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Sep 2019 17:48:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replicate-Data-Within-Table/m-p/585904#M167183</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-09-03T17:48:29Z</dc:date>
    </item>
  </channel>
</rss>

