<?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 retain the character values in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-retain-the-character-values-in-SAS/m-p/554206#M154169</link>
    <description>&lt;P&gt;I have the data like below;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input Id 1-2 name $ 4.;&lt;BR /&gt;cards;&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;4&lt;BR /&gt;5&amp;nbsp; &amp;nbsp;x&lt;BR /&gt;6&lt;BR /&gt;7&lt;BR /&gt;8&lt;BR /&gt;9&lt;BR /&gt;10&lt;BR /&gt;11&amp;nbsp; y&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and the expected out put is&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want output:&lt;/P&gt;&lt;P&gt;ID Name&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;1&amp;nbsp; &amp;nbsp; x&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;2&amp;nbsp; &amp;nbsp; x&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;3&amp;nbsp; &amp;nbsp; x&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;4&amp;nbsp; &amp;nbsp; x&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;5&amp;nbsp; &amp;nbsp; x&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;6&amp;nbsp; &amp;nbsp; y&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;7&amp;nbsp; &amp;nbsp; y&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;8&amp;nbsp; &amp;nbsp; y&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;9&amp;nbsp; &amp;nbsp; y&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;10&amp;nbsp; y&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;11&amp;nbsp; y&lt;/FONT&gt;&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Apr 2019 10:37:17 GMT</pubDate>
    <dc:creator>vThanu</dc:creator>
    <dc:date>2019-04-26T10:37:17Z</dc:date>
    <item>
      <title>How to retain the character values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retain-the-character-values-in-SAS/m-p/554206#M154169</link>
      <description>&lt;P&gt;I have the data like below;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input Id 1-2 name $ 4.;&lt;BR /&gt;cards;&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;4&lt;BR /&gt;5&amp;nbsp; &amp;nbsp;x&lt;BR /&gt;6&lt;BR /&gt;7&lt;BR /&gt;8&lt;BR /&gt;9&lt;BR /&gt;10&lt;BR /&gt;11&amp;nbsp; y&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and the expected out put is&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want output:&lt;/P&gt;&lt;P&gt;ID Name&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;1&amp;nbsp; &amp;nbsp; x&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;2&amp;nbsp; &amp;nbsp; x&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;3&amp;nbsp; &amp;nbsp; x&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;4&amp;nbsp; &amp;nbsp; x&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;5&amp;nbsp; &amp;nbsp; x&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;6&amp;nbsp; &amp;nbsp; y&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;7&amp;nbsp; &amp;nbsp; y&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;8&amp;nbsp; &amp;nbsp; y&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;9&amp;nbsp; &amp;nbsp; y&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;10&amp;nbsp; y&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;11&amp;nbsp; y&lt;/FONT&gt;&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 10:37:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retain-the-character-values-in-SAS/m-p/554206#M154169</guid>
      <dc:creator>vThanu</dc:creator>
      <dc:date>2019-04-26T10:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to retain the character values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retain-the-character-values-in-SAS/m-p/554216#M154170</link>
      <description>&lt;P&gt;Your data suggests the non-missing value at the end of the series. First, read the data from backwards, collect the non-missing NAME.&lt;/P&gt;
&lt;P&gt;Then fill the missing Names. Then Sort the temporary data set by ID.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
input Id 1-2 name $ 4.;
cards;
1
2
3
4
5   x
6
7
8
9
10
11  y
;
run;

data check;
      do i = num to 1 by -1;
         set have nobs = num point = i;
         if name NE ' ' then temp = name;
         else name = temp;
         output;
      end;
stop;
drop temp;
run;

proc sort data = check out = want;
   by id;
run;

proc print data = want;
run;
&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Apr 2019 11:37:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retain-the-character-values-in-SAS/m-p/554216#M154170</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2019-04-26T11:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to retain the character values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retain-the-character-values-in-SAS/m-p/554237#M154175</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards truncover;
input Id name $;
cards;
1
2
3
4
5   x
6
7
8
9
10
11  y
;
run;

proc sort data=have out=temp;
by descending id;
run;
data want;
 set temp;
 length new_name $ 40;
 retain new_name;
 if not missing(name) then new_name=name;
run;
proc sort data=want;
by id;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Apr 2019 12:57:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retain-the-character-values-in-SAS/m-p/554237#M154175</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-04-26T12:57:37Z</dc:date>
    </item>
  </channel>
</rss>

