<?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: Want to correct the the data and aligned in one row in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Want-to-correct-the-the-data-and-aligned-in-one-row/m-p/162684#M300043</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok..Then do it for both Row..both first and last and place the correct values in that..I want only correct data..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Dec 2014 18:52:37 GMT</pubDate>
    <dc:creator>pankak</dc:creator>
    <dc:date>2014-12-25T18:52:37Z</dc:date>
    <item>
      <title>Want to correct the the data and aligned in one row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Want-to-correct-the-the-data-and-aligned-in-one-row/m-p/162682#M300041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a data set given below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input x y z a b c;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1 2 3 4 . .&lt;/P&gt;&lt;P&gt;5 8 9 1 2 3&lt;/P&gt;&lt;P&gt;1 4 7 8 5 6&lt;/P&gt;&lt;P&gt;4 5 6 7 8 9&lt;/P&gt;&lt;P&gt;.&amp;nbsp; .&amp;nbsp; .&amp;nbsp; . 5 6&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The two values of first row is showing in the last row and four values of first row are missing in the last row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want correct missing values&amp;nbsp; in one row either first or last and remove the duplicate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;output like below.&lt;/P&gt;&lt;P&gt;x y z a b c&lt;/P&gt;&lt;P&gt;1 2 3 4 5 6. .&lt;/P&gt;&lt;P&gt;5 8 9 1 2 3&lt;/P&gt;&lt;P&gt;1 4 7 8 5 6&lt;/P&gt;&lt;P&gt;4 5 6 7 8 9&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thaks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Dec 2014 18:13:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Want-to-correct-the-the-data-and-aligned-in-one-row/m-p/162682#M300041</guid>
      <dc:creator>pankak</dc:creator>
      <dc:date>2014-12-25T18:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: Want to correct the the data and aligned in one row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Want-to-correct-the-the-data-and-aligned-in-one-row/m-p/162683#M300042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How do you know that you need to use first/last row to fix missing? Is it a single manual process?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Dec 2014 18:28:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Want-to-correct-the-the-data-and-aligned-in-one-row/m-p/162683#M300042</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-12-25T18:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Want to correct the the data and aligned in one row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Want-to-correct-the-the-data-and-aligned-in-one-row/m-p/162684#M300043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok..Then do it for both Row..both first and last and place the correct values in that..I want only correct data..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Dec 2014 18:52:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Want-to-correct-the-the-data-and-aligned-in-one-row/m-p/162684#M300043</guid>
      <dc:creator>pankak</dc:creator>
      <dc:date>2014-12-25T18:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Want to correct the the data and aligned in one row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Want-to-correct-the-the-data-and-aligned-in-one-row/m-p/162685#M300044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;input x y z a b c;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 2 3 4 . .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5 8 9 1 2 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 4 7 8 5 6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4 5 6 7 8 9&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;. . . . 5 6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have end=last;&lt;/P&gt;&lt;P&gt;array arrayname _numeric_;&lt;/P&gt;&lt;P&gt;array arrayname2(*) x1 y2 z2 a2 b2 c2;&lt;/P&gt;&lt;P&gt;retain arrayname2;&lt;/P&gt;&lt;P&gt;if _n_=1 then do;&lt;/P&gt;&lt;P&gt;do i=1 to dim(arrayname);&lt;/P&gt;&lt;P&gt;arrayname2(i)=arrayname(i);&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;if last then do;&lt;/P&gt;&lt;P&gt;if b2=. then b2=b;&lt;/P&gt;&lt;P&gt;if c2=. then c2=c;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; keep&amp;nbsp; x1 y2 z2 a2 b2 c2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want2;&lt;/P&gt;&lt;P&gt;set have; &lt;/P&gt;&lt;P&gt;if _n_=1 then set want;&lt;/P&gt;&lt;P&gt;array arrayname(*) x y z a b c;&lt;/P&gt;&lt;P&gt;array arrayname2(*) x1 y2 z2 a2 b2 c2;&lt;/P&gt;&lt;P&gt;do i=1 to dim(arrayname);&lt;/P&gt;&lt;P&gt;if arrayname(i)=. then arrayname(i)=arrayname2(i);&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;keep&amp;nbsp; x y z a b c;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this what you want?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Dec 2014 19:00:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Want-to-correct-the-the-data-and-aligned-in-one-row/m-p/162685#M300044</guid>
      <dc:creator>naveen_srini</dc:creator>
      <dc:date>2014-12-25T19:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Want to correct the the data and aligned in one row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Want-to-correct-the-the-data-and-aligned-in-one-row/m-p/162686#M300045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How do you know what's correct? Why isn't the missing filled in by the second row, why the last? &lt;/P&gt;&lt;P&gt;And why is the last filled in by the first? &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Or is it because they're missing opposite variables? Is there an ID variable to identify these rows?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the business logic is simply for these two rows then do it manually&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; have;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;input&lt;/SPAN&gt; x y z a b c;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #0433ff;"&gt;datalines&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;1 2 3 4 . .&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;5 8 9 1 2 3&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;1 4 7 8 5 6&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;4 5 6 7 8 9&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;.&amp;nbsp; .&amp;nbsp; .&amp;nbsp; . 5 6&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; want;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;set&lt;/SPAN&gt; have end=last;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;if&lt;/SPAN&gt; _n_=&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #0433ff;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="color: #0433ff;"&gt;do&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; b=&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;5&lt;/STRONG&gt;&lt;/SPAN&gt;; c=&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;6&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #0433ff;"&gt;end&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;if&lt;/SPAN&gt; not last &lt;SPAN style="color: #0433ff;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="color: #0433ff;"&gt;output&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Dec 2014 19:06:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Want-to-correct-the-the-data-and-aligned-in-one-row/m-p/162686#M300045</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-12-25T19:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: Want to correct the the data and aligned in one row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Want-to-correct-the-the-data-and-aligned-in-one-row/m-p/162687#M300046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;count=0;&lt;/P&gt;&lt;P&gt;array v _numeric_;&lt;/P&gt;&lt;P&gt;do over v;&lt;/P&gt;&lt;P&gt;if v=. then count+1;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;if count&amp;gt;0 then n=1;&lt;/P&gt;&lt;P&gt;else n=_n_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;create table final as&lt;/P&gt;&lt;P&gt;select sum(x) as x,sum(y) as y, sum(z) as z, sum(a) as a,sum(b) as b, sum(c) as c&lt;/P&gt;&lt;P&gt;from want&lt;/P&gt;&lt;P&gt;group by n;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Dec 2014 21:35:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Want-to-correct-the-the-data-and-aligned-in-one-row/m-p/162687#M300046</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-12-25T21:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Want to correct the the data and aligned in one row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Want-to-correct-the-the-data-and-aligned-in-one-row/m-p/162688#M300047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;data have;
input x y z a b c;
datalines;
1 2 3 4 . .
5 8 9 1 2 3
1 4 7 8 5 6
4 5 6 7 8 9
.&amp;nbsp; .&amp;nbsp; .&amp;nbsp; . 5 6
;
run;
data want;
 set have end=last;
 if _n_ eq 1 then do;
&amp;nbsp; set have(rename=(x=_x y=_y z=_z a=_a b=_b c=_c)) nobs=nobs point=nobs;
&amp;nbsp; x=coalesce(x,_x);
&amp;nbsp; y=coalesce(y,_y);
&amp;nbsp; z=coalesce(z,_z);
&amp;nbsp; a=coalesce(a,_a);
&amp;nbsp; b=coalesce(b,_b);
&amp;nbsp; c=coalesce(c,_c);
 end;
 if not last;
 drop _:;
run;



&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Dec 2014 07:16:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Want-to-correct-the-the-data-and-aligned-in-one-row/m-p/162688#M300047</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-12-26T07:16:09Z</dc:date>
    </item>
  </channel>
</rss>

