<?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: RE: Fillining in Missing Entries in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/RE-Fillining-in-Missing-Entries/m-p/520990#M141327</link>
    <description>&lt;P&gt;Can you provide some example data so we can test your code?&lt;/P&gt;</description>
    <pubDate>Wed, 12 Dec 2018 20:33:05 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2018-12-12T20:33:05Z</dc:date>
    <item>
      <title>RE: Fillining in Missing Entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RE-Fillining-in-Missing-Entries/m-p/520988#M141326</link>
      <description>&lt;P&gt;Hi...I am trying to fill in the Major&amp;nbsp;variable with the first non-missing entry until the next non-missing entry (its possible for the same StudentUID to have more than one major) and I am getting an error message that the variable Major is both character and numeric. Major is character with length 50 and StudentUID is numeric. If I exclude the "not missing(Major or" from the until statement, it executes but I don't get the proper output. Can anyone see why I am getting the error message....Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data StudentDegree1;
 	length a1 $50;
 	do until(not missing(Major) or last.StudentUID);
  	set StudentDegree2;
  	by StudentUID Major notsorted;
		a1=Major;
 	end;
 	do until(not missing(Major) or last.StudentUID);
  	set StudentDegree2;
 	by StudentUID Major notsorted;
		Major=a1;
  	output;
 	end;
 drop a1;
run;

Log Output:

NOTE: There were 153022 observations read from the data set WORK.STUDENTDEGREE2.
NOTE: The data set WORK.STUDENTDEGREE2 has 153022 observations and 7 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.32 seconds
      cpu time            0.51 seconds
      

319        
320        data StudentDegree1;
321         	length a1 $50;
322         	do until(not missing(Major) or last.StudentUID);
323          	set StudentDegree2;
ERROR: Variable Major has been defined as both character and numeric.
324          	by StudentUID Major notsorted;
325        		a1=Major;
326         	end;
327         	do until(not missing(Major) or last.StudentUID);
328          	set StudentDegree2;
ERROR: Variable Major has been defined as both character and numeric.
329         	by StudentUID Major notsorted;
330        		Major=a1;
331          	output;
332         	end;
333         drop a1;
334        run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Dec 2018 20:31:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RE-Fillining-in-Missing-Entries/m-p/520988#M141326</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2018-12-12T20:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: RE: Fillining in Missing Entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RE-Fillining-in-Missing-Entries/m-p/520990#M141327</link>
      <description>&lt;P&gt;Can you provide some example data so we can test your code?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 20:33:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RE-Fillining-in-Missing-Entries/m-p/520990#M141327</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-12-12T20:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: RE: Fillining in Missing Entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RE-Fillining-in-Missing-Entries/m-p/520996#M141329</link>
      <description>&lt;P&gt;While I can't check it right now, I'm guessing that the DO UNTIL loop defines MAJOR as numeric.&amp;nbsp; To get around that, add this right after the LENGTH statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if 5=4 then set StudentDegree2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even though it never executes (obviously, 5 does not equal 4), its presence is enough to define all the variables in StudentDegree2.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 20:43:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RE-Fillining-in-Missing-Entries/m-p/520996#M141329</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-12-12T20:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: RE: Fillining in Missing Entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RE-Fillining-in-Missing-Entries/m-p/521013#M141332</link>
      <description>&lt;P&gt;Hi...I have included a dataset below....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Have;
    length StudentUID 8 Major $ 50 TextTerm $ 12;
    format StudentUID BEST12.  Major $CHAR50. TextTerm $CHAR12.;
    informat StudentUID BEST12. Major $CHAR50. TextTerm $CHAR12.;
    infile datalines4 dlm='7F'x missover dsd;
    input StudentUID : BEST32. Major : $CHAR50. TextTerm : $CHAR12.;
datalines4;
104&amp;#127; &amp;#127;00-01 Trm 1C
104&amp;#127;Industrial Maintenance Technician&amp;#127;00-01 Trm 2C
104&amp;#127;Industrial Maintenance Technician&amp;#127;00-01 Trm 3C
105&amp;#127;Production Art&amp;#127;00-01 Trm 1C
106&amp;#127;Cisco Training&amp;#127;00-01 Trm 3C
106&amp;#127; &amp;#127;00-01 Trm 1C
106&amp;#127; &amp;#127;00-01 Trm 2C
106&amp;#127;Microcomputer Systems Technician&amp;#127;00-01 Trm 2C
107&amp;#127;Auto Mechanics&amp;#127;00-01 Trm 2C
107&amp;#127; &amp;#127;00-01 Trm 3C
108&amp;#127; &amp;#127;00-01 Trm 2C
108&amp;#127;Microcomputer Systems Technician&amp;#127;00-01 Trm 3C
108&amp;#127;Cisco Training&amp;#127;01-02 Trm 2C
108&amp;#127; &amp;#127;01-02 Trm 3C
109&amp;#127;Microcomputer Systems Technician&amp;#127;00-01 Trm 2C
109&amp;#127; &amp;#127;01-02 Trm 1C
109&amp;#127; &amp;#127;01-02 Trm 2C
109&amp;#127;Cisco Training&amp;#127;01-02 Trm 2C
;;;;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Dec 2018 21:25:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RE-Fillining-in-Missing-Entries/m-p/521013#M141332</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2018-12-12T21:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: RE: Fillining in Missing Entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RE-Fillining-in-Missing-Entries/m-p/521292#M141416</link>
      <description>&lt;P&gt;Hi Astounding....I did try your suggestions and it worked....thanks a ton!!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 21:25:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RE-Fillining-in-Missing-Entries/m-p/521292#M141416</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2018-12-13T21:25:51Z</dc:date>
    </item>
  </channel>
</rss>

