<?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: Urgent: About SAS scripts in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Urgent-About-SAS-scripts/m-p/69973#M6989</link>
    <description>HTH&lt;BR /&gt;
Patrick&lt;BR /&gt;
&lt;BR /&gt;
data have;&lt;BR /&gt;
  do timekey=1 to 12;&lt;BR /&gt;
    do borrid=1 to 10;&lt;BR /&gt;
      if ceil(ranuni(0)*5)=5 then output;&lt;BR /&gt;
    end;&lt;BR /&gt;
  end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=have;  &lt;BR /&gt;
  by borrid timekey;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data want;  &lt;BR /&gt;
  set have;&lt;BR /&gt;
  by borrid timekey;&lt;BR /&gt;
  N_change+1;&lt;BR /&gt;
  if last.borrid then do;&lt;BR /&gt;
    if N_change&amp;gt;=3 then output;&lt;BR /&gt;
    N_change=0;&lt;BR /&gt;
  end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc print data=want;&lt;BR /&gt;
run;</description>
    <pubDate>Mon, 19 Jan 2009 12:19:32 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2009-01-19T12:19:32Z</dc:date>
    <item>
      <title>Urgent: About SAS scripts</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Urgent-About-SAS-scripts/m-p/69972#M6988</link>
      <description>I have month-end data files which contain the rating system of borrowers in that particular month. Rating system of borrowers may change by month. &lt;BR /&gt;
&lt;BR /&gt;
Now, I want to check which borrower with 3 or more rating system changes in the past 12 months.&lt;BR /&gt;
&lt;BR /&gt;
I will combine all the month-end files and then sort by timekey, borrid. Then, what should i do? Can any one show me the SAS scripts? Many thanks!!!!!!!!</description>
      <pubDate>Mon, 19 Jan 2009 08:34:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Urgent-About-SAS-scripts/m-p/69972#M6988</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-19T08:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent: About SAS scripts</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Urgent-About-SAS-scripts/m-p/69973#M6989</link>
      <description>HTH&lt;BR /&gt;
Patrick&lt;BR /&gt;
&lt;BR /&gt;
data have;&lt;BR /&gt;
  do timekey=1 to 12;&lt;BR /&gt;
    do borrid=1 to 10;&lt;BR /&gt;
      if ceil(ranuni(0)*5)=5 then output;&lt;BR /&gt;
    end;&lt;BR /&gt;
  end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=have;  &lt;BR /&gt;
  by borrid timekey;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data want;  &lt;BR /&gt;
  set have;&lt;BR /&gt;
  by borrid timekey;&lt;BR /&gt;
  N_change+1;&lt;BR /&gt;
  if last.borrid then do;&lt;BR /&gt;
    if N_change&amp;gt;=3 then output;&lt;BR /&gt;
    N_change=0;&lt;BR /&gt;
  end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc print data=want;&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 19 Jan 2009 12:19:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Urgent-About-SAS-scripts/m-p/69973#M6989</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2009-01-19T12:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent: About SAS scripts</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Urgent-About-SAS-scripts/m-p/69974#M6990</link>
      <description>if your data files are in "borrower" order, you need no sort. Just use by processing and an interleaving SET of the 12 files.&lt;BR /&gt;
data threes ;&lt;BR /&gt;
   changes = -1 ; &lt;BR /&gt;
   do until( last.borrower ) ; * work through the data for a borrower;&lt;BR /&gt;
     set file1 file2 ..... file12 ; * you need all 12 names not dots ;&lt;BR /&gt;
      by borrower ;&lt;BR /&gt;
      last_rating_system= lag( rating_system ) ;&lt;BR /&gt;
      if first.borrower then last_rating_system= ' ' ;&lt;BR /&gt;
      if rating_system ne last_rating_system then  changes + 1 ;&lt;BR /&gt;
   end;&lt;BR /&gt;
   if changes ge 3 ;&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 19 Jan 2009 15:19:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Urgent-About-SAS-scripts/m-p/69974#M6990</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-19T15:19:14Z</dc:date>
    </item>
  </channel>
</rss>

