<?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: Pulling Down Previous Year in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Pulling-Down-Previous-Year/m-p/508444#M72902</link>
    <description>&lt;P&gt;This seems to work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/169667"&gt;@first&lt;/a&gt; I read the year only. If it's not missing, replace the old value otherwise carry on previous value. Use trailing&amp;nbsp;@ to hold the record in place.&lt;/P&gt;
&lt;P&gt;Note that I also had to modify your FILENAME statement to get this to work properly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA football;
FILENAME webpage url 'http://people.stat.sc.edu/hitchcock/champ36pres.txt';
INFILE webpage FIRSTOBS=7 TRUNCOVER;
RETAIN year;
input _year 4-7 @;

if not missing(_year) then year=_year;

INPUT team $ 8-27 wins 30-31 losses 33-33 ties 35-35 coach $ 36-54;

drop _year;
RUN;

PROC PRINT DATA=football;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/243060"&gt;@Steelersgirl&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am trying to read in a data set from&amp;nbsp;&lt;A href="http://people.stat.sc.edu/hitchcock/champ36pres.txt" target="_blank"&gt;http://people.stat.sc.edu/hitchcock/champ36pres.txt&lt;/A&gt;. Some of the years have two champions but SAS reads in the year as missing. I am trying to bring down the year before in to the missing value.&amp;nbsp; Am I missing something in the retain line of the code to bring the year down?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA football;
FILENAME webpage 'http://people.stat.sc.edu/hitchcock/champ36pres.txt';
INFILE webpage FIRSTOBS=7 TRUNCOVER;
INPUT year YYYY. team $ 8-27 wins 30-31 losses 33-33 ties 35-35 coach $ 36-54;
RETAIN year;
RUN;

PROC PRINT DATA=football;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Oct 2018 18:15:12 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-10-29T18:15:12Z</dc:date>
    <item>
      <title>Pulling Down Previous Year</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Pulling-Down-Previous-Year/m-p/508438#M72898</link>
      <description>&lt;P&gt;I am trying to read in a data set from&amp;nbsp;&lt;A href="http://people.stat.sc.edu/hitchcock/champ36pres.txt" target="_blank"&gt;http://people.stat.sc.edu/hitchcock/champ36pres.txt&lt;/A&gt;. Some of the years have two champions but SAS reads in the year as missing. I am trying to bring down the year before in to the missing value.&amp;nbsp; Am I missing something in the retain line of the code to bring the year down?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA football;
FILENAME webpage 'http://people.stat.sc.edu/hitchcock/champ36pres.txt';
INFILE webpage FIRSTOBS=7 TRUNCOVER;
INPUT year YYYY. team $ 8-27 wins 30-31 losses 33-33 ties 35-35 coach $ 36-54;
RETAIN year;
RUN;

PROC PRINT DATA=football;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Oct 2018 18:01:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Pulling-Down-Previous-Year/m-p/508438#M72898</guid>
      <dc:creator>Steelersgirl</dc:creator>
      <dc:date>2018-10-29T18:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling Down Previous Year</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Pulling-Down-Previous-Year/m-p/508442#M72900</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA football;
FILENAME webpage 'http://people.stat.sc.edu/hitchcock/champ36pres.txt';
INFILE webpage FIRSTOBS=7 TRUNCOVER;
retain year;
INPUT year1 YYYY. team $ 8-27 wins 30-31 losses 33-33 ties 35-35 coach $ 36-54;
if not missing(year1) then year=year1;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Oct 2018 18:11:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Pulling-Down-Previous-Year/m-p/508442#M72900</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-10-29T18:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling Down Previous Year</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Pulling-Down-Previous-Year/m-p/508444#M72902</link>
      <description>&lt;P&gt;This seems to work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/169667"&gt;@first&lt;/a&gt; I read the year only. If it's not missing, replace the old value otherwise carry on previous value. Use trailing&amp;nbsp;@ to hold the record in place.&lt;/P&gt;
&lt;P&gt;Note that I also had to modify your FILENAME statement to get this to work properly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA football;
FILENAME webpage url 'http://people.stat.sc.edu/hitchcock/champ36pres.txt';
INFILE webpage FIRSTOBS=7 TRUNCOVER;
RETAIN year;
input _year 4-7 @;

if not missing(_year) then year=_year;

INPUT team $ 8-27 wins 30-31 losses 33-33 ties 35-35 coach $ 36-54;

drop _year;
RUN;

PROC PRINT DATA=football;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/243060"&gt;@Steelersgirl&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am trying to read in a data set from&amp;nbsp;&lt;A href="http://people.stat.sc.edu/hitchcock/champ36pres.txt" target="_blank"&gt;http://people.stat.sc.edu/hitchcock/champ36pres.txt&lt;/A&gt;. Some of the years have two champions but SAS reads in the year as missing. I am trying to bring down the year before in to the missing value.&amp;nbsp; Am I missing something in the retain line of the code to bring the year down?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA football;
FILENAME webpage 'http://people.stat.sc.edu/hitchcock/champ36pres.txt';
INFILE webpage FIRSTOBS=7 TRUNCOVER;
INPUT year YYYY. team $ 8-27 wins 30-31 losses 33-33 ties 35-35 coach $ 36-54;
RETAIN year;
RUN;

PROC PRINT DATA=football;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 18:15:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Pulling-Down-Previous-Year/m-p/508444#M72902</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-29T18:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling Down Previous Year</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Pulling-Down-Previous-Year/m-p/508445#M72903</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA football;
FILENAME webpage url 'http://people.stat.sc.edu/hitchcock/champ36pres.txt';
INFILE webpage FIRSTOBS=7 TRUNCOVER;
retain year;
INPUT _year  7. team $ 8-27 wins 30-31 losses 33-33 ties 35-35 coach $ 36-54;
if not missing(_year) then year=_year;
drop _year;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Oct 2018 18:16:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Pulling-Down-Previous-Year/m-p/508445#M72903</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-29T18:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling Down Previous Year</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Pulling-Down-Previous-Year/m-p/508448#M72904</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/243060"&gt;@Steelersgirl&lt;/a&gt;&amp;nbsp; It's safe to have/read 7 columns/bytes of characters with a numeric informat 7. for the reason you made it easy for us knowing that Team values starts at column 8. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 18:19:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Pulling-Down-Previous-Year/m-p/508448#M72904</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-29T18:19:07Z</dc:date>
    </item>
  </channel>
</rss>

