<?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: data steps with nested do loops in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/418155#M26922</link>
    <description>&lt;P&gt;You can only do that if you have some version of a date in the data set.&amp;nbsp; Then you could pick out the month (how you do that depends on what the date variable contains).&amp;nbsp; Give the month a value from 1 through 12, and use that as one dimension of the table in a PROC FREQ.&lt;/P&gt;</description>
    <pubDate>Mon, 04 Dec 2017 14:17:21 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2017-12-04T14:17:21Z</dc:date>
    <item>
      <title>data steps with nested do loops</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/417927#M26910</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to run these do loops on this data , there are 21 variables and under each variable some credit&amp;nbsp;codes apply,&amp;nbsp; my query is find the volume of these rules on these variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Three rules are : Affordability,&amp;nbsp; Character and Policy. How many application have affordability or character or policy hits.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Under each rule there are certain codes which determine that these rules are applied on the application.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have written this code for each rule and then run proc freq to get the volumes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question 1:&amp;nbsp; Is there a better way to write do loops for these rules as I might have to add more rules later on. As there are 21 variables&lt;/P&gt;&lt;P&gt;to test these rules , is there any other way to combine them or not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question 2:&amp;nbsp; if I have to exclude those applications which are withdrawn,&lt;/P&gt;&lt;P&gt;I put where statement in the end, but when I tried to combine 02 statements then it gives me error:&lt;/P&gt;&lt;P&gt;like if I say where assessordecision &amp;lt;&amp;gt; "withdrawn"&amp;nbsp; and &amp;lt;&amp;gt; ' ' ;&amp;nbsp; it works if I exclude the missing value and keep it to withdrawn&lt;/P&gt;&lt;P&gt;only, how do I combine the statements with where.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;code is attached as an attachment&amp;nbsp;its a long one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Dec 2017 07:11:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/417927#M26910</guid>
      <dc:creator>bondtk</dc:creator>
      <dc:date>2017-12-02T07:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: data steps with nested do loops</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/417934#M26911</link>
      <description>&lt;P&gt;It is always a good idea to suspect optimizations exist if you notice repetition in your code. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without trying to do the coding itself I can give some pointers:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Variable lists with a numeric postfix (but also others) are good candidates stick in an array. You can then loop over that array. See this older but stil relevant &lt;A href="http://support.sas.com/resources/papers/proceedings10/158-2010.pdf" target="_self"&gt;SGF paper&lt;/A&gt;. It is easy to add or change your arrays at a later stage.&lt;/P&gt;
&lt;P&gt;2) These groups of codes that map to a single flag can be handled by a format. Your "if value in ('a', 'b', ...) then" can be transfored into "flag = put(value, $mappingfmt.)". The&amp;nbsp; proc format at the top of your code would be the single place to add or change mappings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps you on your way,&lt;/P&gt;
&lt;P&gt;-- Jan&lt;/P&gt;</description>
      <pubDate>Sat, 02 Dec 2017 12:07:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/417934#M26911</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2017-12-02T12:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: data steps with nested do loops</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/417935#M26912</link>
      <description>An entirely different approach could be to transpose your data. If you have so many similar columns consider transforming that to a dataset with just one variable plus an extra indicator for the suffix that you would remove. The aforementioned technique with arrays and do loops could be used for the purpose of transposing if proc transpose doesn't cut it. You would then not have to repeat the mapping for each variable in each row but just the single variable in each row. This wide to long transposition usually gives you a dataset that is easier to analyze so you may benefit from this approach in other scenario's as well.&lt;BR /&gt;&lt;BR /&gt;- Jan.</description>
      <pubDate>Sat, 02 Dec 2017 12:40:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/417935#M26912</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2017-12-02T12:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: data steps with nested do loops</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/417936#M26913</link>
      <description>&lt;P&gt;And on question 2: since your variable is character, the use of "&amp;lt;&amp;gt;" is not appropriate. Also, the variable your testing must be repeated after the AND:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;AssessorDecision ne "Withdrawn" and AssessorDecision ne ' '&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;- Jan.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Dec 2017 12:50:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/417936#M26913</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2017-12-02T12:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: data steps with nested do loops</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/417947#M26914</link>
      <description>&lt;P&gt;This may or may not run faster.&amp;nbsp; But it's a whole lot easier to write, read, and QC:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc format;&lt;/P&gt;
&lt;P&gt;invalue afford&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;'RA83', 'RA51',&amp;nbsp;'RA92',&amp;nbsp;'RA93',&amp;nbsp;'RA12',&amp;nbsp;'RA13',&amp;nbsp;'RA57',&amp;nbsp;'RA29' = 1&amp;nbsp; other=0;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;array aff {*} RB_PostBurReasonCdeTable_01 - RB_PostBurReasonCdeTable_21;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;if AppSystem in ('SBLoans') then do _n_=1 to dim(aff) until (affordability_refer=1);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp;affordability_refer = input(aff{_n_}, afford.);&lt;/DIV&gt;
&lt;DIV&gt;end;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Similar code needed for the other two measures.&amp;nbsp; This is untested, so may need to be tweaked.&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sat, 02 Dec 2017 14:50:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/417947#M26914</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-12-02T14:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: data steps with nested do loops</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/417948#M26915</link>
      <description>&lt;P&gt;Yes very much as I suggested. Kudo's for using an informat instead of a format. Wouldn't use the name _n_ for the loop index however as this is a special variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;regards,&lt;/P&gt;
&lt;P&gt;-- Jan&lt;/P&gt;</description>
      <pubDate>Sat, 02 Dec 2017 14:58:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/417948#M26915</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2017-12-02T14:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: data steps with nested do loops</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/417952#M26916</link>
      <description>&lt;P&gt;Just a side note really ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I often use _n_ as the index for an array.&amp;nbsp; The minor benefit is that I don't have to remember to drop it later.&amp;nbsp; But the major benefit occurs in this sort of code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;array nums {*} _numeric_;&lt;/P&gt;
&lt;P&gt;do i=1 to dim(nums);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;* something, anything that changes nums{i};&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If by some oversight the list _NUMERIC_ includes the variable i, big trouble results.&amp;nbsp; Either the results are wrong (likely with no note or warning), or else an infinite loop results (if, for example, the loop changes nums{i}=0).&amp;nbsp; So it's a choice I make which to me is the lesser of evils.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Dec 2017 15:28:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/417952#M26916</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-12-02T15:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: data steps with nested do loops</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/417985#M26917</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply,&amp;nbsp; I tried the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but comes up with errors, I am expert on arrays so not sure how to fix it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;17 invalue afford&lt;/P&gt;&lt;P&gt;18&lt;/P&gt;&lt;P&gt;19 'RA83', 'RA51', 'RA92', 'RA93', 'RA12', 'RA13', 'RA57', 'RA29' = 1 other = 0;&lt;/P&gt;&lt;P&gt;NOTE: Informat AFFORD is already on the library.&lt;/P&gt;&lt;P&gt;NOTE: Informat AFFORD has been output.&lt;/P&gt;&lt;P&gt;19 ! .&lt;/P&gt;&lt;P&gt;20&lt;/P&gt;&lt;P&gt;19 'RA83', 'RA51', 'RA92', 'RA93', 'RA12', 'RA13', 'RA57', 'RA29' = 1 other = 0;.&lt;/P&gt;&lt;P&gt;_&lt;/P&gt;&lt;P&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;21 run;&lt;/P&gt;&lt;P&gt;NOTE: The previous statement has been deleted.&lt;/P&gt;&lt;P&gt;21 ! .&lt;/P&gt;&lt;P&gt;22&lt;/P&gt;&lt;P&gt;21 run;.&lt;/P&gt;&lt;P&gt;_&lt;/P&gt;&lt;P&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;23 .&lt;/P&gt;&lt;P&gt;24&lt;/P&gt;&lt;P&gt;25 array aff {*} RB_PostBurReasonCdeTable_01 - RB_PostBurReasonCdeTable_21;&lt;/P&gt;&lt;P&gt;NOTE: The previous statement has been deleted.&lt;/P&gt;&lt;P&gt;25 ! .&lt;/P&gt;&lt;P&gt;26&lt;/P&gt;&lt;P&gt;25 array aff {*} RB_PostBurReasonCdeTable_01 - RB_PostBurReasonCdeTable_21;.&lt;/P&gt;&lt;P&gt;_&lt;/P&gt;&lt;P&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;27 .&lt;/P&gt;&lt;P&gt;28&lt;/P&gt;&lt;P&gt;29&lt;/P&gt;&lt;P&gt;30 if AppSystem in ('SBLoans') then do _n_=1 to dim(aff) until (affordability_refer=1);&lt;/P&gt;&lt;P&gt;NOTE: The previous statement has been deleted.&lt;/P&gt;&lt;P&gt;2 The SAS System 11:21 Sunday, December 3, 2017&lt;/P&gt;&lt;P&gt;31&lt;/P&gt;&lt;P&gt;32 affordability_refer = input(aff{_n_}, afford.);&lt;/P&gt;&lt;P&gt;___________________&lt;/P&gt;&lt;P&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;NOTE: The previous statement has been deleted.&lt;/P&gt;&lt;P&gt;33&lt;/P&gt;&lt;P&gt;34 end;&lt;/P&gt;&lt;P&gt;___&lt;/P&gt;&lt;P&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;NOTE: The previous statement has been deleted.&lt;/P&gt;&lt;P&gt;35 run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;******************************************&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried this code : didn't work;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; tk.volume_sbos_sbl;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sastrain.application_extract;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; affordability_refer &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;affordability_refer = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*Capacity rule*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;array&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; aff{*} RB_postBurreasoncdetable_01-RB_postBurreasoncdetable_21;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; AppSystem in (&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'SBLoans'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; aff{*} in (&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'RA83'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'RA51'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'RA92'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'RA93'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'RA12'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'RA13'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'RA57'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'RA29'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; affordability_refer= &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; i = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;to&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;21&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Dec 2017 04:10:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/417985#M26917</guid>
      <dc:creator>bondtk</dc:creator>
      <dc:date>2017-12-03T04:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: data steps with nested do loops</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/418007#M26918</link>
      <description>&lt;P&gt;Maybe I should have spelled out a more complete program.&amp;nbsp; Let me take what you have done so far, and nudge it in the right direction.&amp;nbsp; Here would be a better version:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;tk.volume_sbos_sbl;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;sastrain.application_extract;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;affordability_refer&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;1.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;affordability_refer =&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*Capacity rule*/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;array&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;aff{*} RB_postBurreasoncdetable_01-RB_postBurreasoncdetable_21;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;AppSystem in (&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'SBLoans'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;)&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;then&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;do i=1 to 21 until (affordability_refer=1)&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;aff{i} in&amp;nbsp; &amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;(&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'RA83'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'RA51'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'RA92'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'RA93'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'RA12'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'RA13'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'RA57'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'RA29'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;)&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;affordability_refer=&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The DO loop uses UNTIL so it can stop checking the remaining items in the array, as soon as it finds a match on one item.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Dec 2017 13:52:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/418007#M26918</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-12-03T13:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: data steps with nested do loops</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/418096#M26920</link>
      <description>Thanks Astounding, this is perfect as I wanted, it worked perfectly...it created a new column i which I removed with drop statement . All the results are good with the proc freq statement. Just one question , I have got these numbers from yearly data , so proc freq has given me the volume that how many times these rules are hit , if I want to see a trend during the whole year how these rules are hit to this data what will be the easy option to achieve that..</description>
      <pubDate>Mon, 04 Dec 2017 09:42:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/418096#M26920</guid>
      <dc:creator>bondtk</dc:creator>
      <dc:date>2017-12-04T09:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: data steps with nested do loops</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/418155#M26922</link>
      <description>&lt;P&gt;You can only do that if you have some version of a date in the data set.&amp;nbsp; Then you could pick out the month (how you do that depends on what the date variable contains).&amp;nbsp; Give the month a value from 1 through 12, and use that as one dimension of the table in a PROC FREQ.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2017 14:17:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/data-steps-with-nested-do-loops/m-p/418155#M26922</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-12-04T14:17:21Z</dc:date>
    </item>
  </channel>
</rss>

