<?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: Calling macro inside of macros, string limit length in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142869#M296871</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Begin by explaining and detailing your problem thoroughly &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a good idea of what you need, but hate making assumptions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 May 2014 15:14:36 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2014-05-05T15:14:36Z</dc:date>
    <item>
      <title>Calling macro inside of macros, string limit length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142859#M296861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello. I have been tasked with creating an Exception Management system from within Base SAS.&amp;nbsp; This produces all kinds of unique problems that i'm not yet aware of how to deal with, but I am running into the specific problem given below.&amp;nbsp; I have two distinct questions that I hope someone can answer! First I will explain the problem and then hopefully it will make more sense what problems I am running into!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Okay so basically our data has multiple levels, the primary one being Client. We have many exceptions, of which only specific runs are run by specific clients. I would like to dynamically build "if client = A&amp;nbsp; then do ;&amp;nbsp;&amp;nbsp; If Category=1 and Balance&amp;lt; 500000 then do ;&amp;nbsp; ExceptionA="true"; end; end; " type of logic for every single client and exception category.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to try to build a mapping table that shows which clients run which exceptions (can even be an excel file) that the business can go into and change the exceptions run on each client at any point in time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem I know I will run into is that the code will be much longer than 100,000 string length, as we have over 5,000 exceptions and 1,000 + distinct clients.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think we could include this into one macro string because of the length limit by definition... If I define a macro string that itself is made of 100 other macro strings, the length restriction still applies to the "master macro". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question 1)&lt;/P&gt;&lt;P&gt;My question then becomes, how would I go about building one datastep that has dynamic If then else logic, given that the string length of the entire datastep could be 2-3 millions bytes in lenght, with easily 10,000 + lines of code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question 2 Specifics). Would it be possible to write the strings in loops into something like a text file, and then read in the text file and put ALL of its data into a data step (that way we bypass macro variables entirely?)...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aka could we have a text file that looks like following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If&amp;nbsp; Client="brandon" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if balance &amp;gt; 100 and loantype="purchase" and age&amp;lt;50 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exceptioncode='3535asdf';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exceptiongrade='B';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExceptionAge="12 Months";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;else&amp;nbsp; Client="Enron" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if balance &amp;gt; 580 and loantype="purchase" and age&amp;lt;50 and producttype='test type' then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exceptioncode='3535asdf';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exceptiongrade='B';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExceptionAge="12 Months";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And could we somehow read this into sas and put THIS entire string above into a datastep? something like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data exceptions;&lt;/P&gt;&lt;P&gt;set basedata;&lt;/P&gt;&lt;P&gt;CALL TXT FILE?&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 18:07:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142859#M296861</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2014-05-02T18:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calling macro inside of macros, string limit length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142860#M296862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the code is relatively static then just use %INCLUDE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is dynamic is some way you can use a program write the code to a text file and use %INCLUDE to run it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename code temp;&lt;/P&gt;&lt;P&gt;... run some data step code to generate the lines of code. Possibly just copying it from a dataset.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;%inc code / source2 ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 18:35:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142860#M296862</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-05-02T18:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calling macro inside of macros, string limit length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142861#M296863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure how I would write the code to the text file and append new versions of the code onto itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example how would I dynamically create code in loops (say I want the code I did above, but each of the "else if" is created in a loop) that would append to the end of a txt file over and over again?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have zero experience writing to txt files, and using them in include statements.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 19:07:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142861#M296863</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2014-05-02T19:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calling macro inside of macros, string limit length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142862#M296864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Code generation is simple once you determine the logic and the data structure to use to drive it. &lt;/P&gt;&lt;P&gt;For example for you little example you might do something like this.&amp;nbsp; In this case I have left the condition for the IF () statement as just free text in the metadata that drives the code creation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; rules ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;infile&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; cards &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;dsd&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;dlm&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'|'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; exceptioncode $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;10&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; exceptiongrade $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; exceptionage $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;20&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; client $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;20&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; rule $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1000&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; exceptioncode -- rule ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;3535asdf|B|12 Months|Brandon|balance &amp;gt; 100 and loantype="purchase" and age&amp;lt;50 &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;3535asdf|B|12 Months|Enron|balance &amp;gt; 580 and loantype="purchase" and age&amp;lt;50 and producttype='test type'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;filename&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; code &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;temp&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;_null_&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; rules end=eof;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;file&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; code &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;lrecl&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;2000&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; client ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; _n_=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;put&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'select client;'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; first.client &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;put&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'&amp;nbsp; when ('&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; client :&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;$quote.&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;') then do;'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; @&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;6&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'if ('&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; rule &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;') then do;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp; / @&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;6&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'&amp;nbsp; '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; exceptioncode= :&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;$quote.&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;';'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp; / @&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;6&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'&amp;nbsp; '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; exceptiongrade= :&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;$quote.&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;';'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp; / @&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;6&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'&amp;nbsp; '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; exceptionage= :&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;$quote.&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;';'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp; / @&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;6&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'end;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; last.client &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;put&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'&amp;nbsp; end;'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; eof &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;put&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'end;'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Which would generate the following code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: red; background: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; client;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; when (&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"Brandon"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ) then do;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (balance &amp;gt; &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;100&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; and loantype=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"purchase"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; and age&amp;lt;&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;50&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ) then do;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exceptioncode=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"3535asdf"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exceptiongrade=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"B"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exceptionage=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"12 Months"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; when (&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"Enron"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ) then do;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (balance &amp;gt; &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;580&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; and loantype=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"purchase"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; and age&amp;lt;&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;50&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; and producttype=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'test type'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ) then do;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exceptioncode=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"3535asdf"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exceptiongrade=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"B"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exceptionage=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"12 Months"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 20:10:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142862#M296864</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-05-02T20:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calling macro inside of macros, string limit length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142863#M296865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Humm that's exactly what i'm looking for. I guess my next logical question is, I would run this by simply usign the %include and then the name of the file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You don't have a datastep or anything in the code, so could you do something like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data answer;&lt;/P&gt;&lt;P&gt;set mydata;&lt;/P&gt;&lt;P&gt;%inc code / source2 ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 20:24:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142863#M296865</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2014-05-02T20:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Calling macro inside of macros, string limit length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142864#M296866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes.&lt;/P&gt;&lt;P&gt;Sometimes&amp;nbsp; in such a system you might have the code generation and the code that uses it as separate programs.&amp;nbsp; So you only need to re-generate the code when the rules change, but you might run it many times against constantly updating data files.&amp;nbsp; In that case write to a permanent file instead using the TEMP engine to generate a temporary file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 21:22:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142864#M296866</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-05-02T21:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calling macro inside of macros, string limit length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142865#M296867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's a very good idea... I am curious, If I wrapped the txt file call inside of a macro, would you get the problem that you get in the sas compiler where if you have your code strings too long, the macro will cut off the varaibles at the (256 th?) digit?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i mean is, if I had a code that did this.&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000e6; font-size: 10pt;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; rules1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000e6; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; rules;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 10pt;"&gt;if upcase(clientname)="REDWOOD TRUST" and upcase(clientProjectName)=''REDWOOD TRUST-FLOW'' and OriginalPrincipalBalance&amp;lt;=1000000 and OriginalPrincipalBalance &amp;gt; 0 and upcase(LoanPurposeMUNI)="CASHOUT REFI" and upcase(OccupancyMUNI)="PRIMARY" and index(upcase(NumberofUnitsMUNI),''ONE'')&amp;gt;=1 and index(upcase(ProductTypeMUNI),''ARM'')&amp;gt;=1 and CLTV &amp;gt; 75&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000e6; font-size: 10pt;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;SAS would actually fail since the IF logic is too long (if wrapped in a macro, works in non macro code).&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;But if I wrote this to a txt file and read it in, I am curious of what restrictions exist! I will do some more testing, but if you had a paper you could reference me too that would be extremely helpful!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Now if I can figure out how to modify your code to allow for multiple exceptions per client, this is actually a pretty nifty proof of concept for an exception management system, managed through Excel Input sheets!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Brandon&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 21:49:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142865#M296867</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2014-05-02T21:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calling macro inside of macros, string limit length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142866#M296868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is not any limit to length of a statement or length code generated by a macro.&amp;nbsp; Did you try it?&amp;nbsp; Perhaps you tried to storing the code into a macro variable?&amp;nbsp; One macro variable can only hold about 32K characters.&amp;nbsp; Also there are memory limits on total space for macro variable storage.&amp;nbsp; So if you tried to generate a macro variable "array"&amp;nbsp; (RULE1, RULE2, ....) then you might run out of memory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code I posted already handles multiple records in the RULES table per client.&amp;nbsp; But I am not sure what you want to happen when there are multiple matches.&amp;nbsp; Perhaps you just want to add an OUTPUT statement inside of the IF-THEN DO loop ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 22:32:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142866#M296868</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-05-02T22:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calling macro inside of macros, string limit length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142867#M296869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you stuck with this method? I question if this is the best solution to your problem. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have control tables, it seems like there may be better methods to generate exceptions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 23:33:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142867#M296869</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-05-02T23:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calling macro inside of macros, string limit length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142868#M296870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom! Yep what I meant was how to handle the set up of the code for maximum efficiency given the multiple levels within the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example, each client can have X different exceptions, and each exception can have Y different clients. Furthermore a group of exceptions could have the same "grouping" attributes and only differ on one attribute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exception 1 could have "first lien", "fixed", "purchase", "Occupied"&amp;nbsp; as 4 of the 5 attributes, and it could share those 4 attributes with 1,000 + other exceptions. As such, those 4 attributes would make perfect sense in the first level of a sub-setting if clause. Something like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If lien="first" and producttype="Fixed" and Purpose="Purchase" and status="Occupied" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if client='ABC' then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ltv &amp;gt; 80 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exceptioncode='ABC';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExceptionGrade=3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if income &amp;lt; 30000 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExceptionCode='123';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exceptiongrade=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*Note the IF above is correct. These are two independent exceptions, both of which need to be able to trigger on the appropriate client level*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&amp;nbsp; if client='ABC' then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ltv &amp;gt; 90 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exceptioncode='ABC';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExceptionGrade=3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now this structure is more efficient than only 1 level of "client" in the IF-then else structure, however there is no way to know what the primary attributes are up-front and each new exception can change that structure, so I think going with client only as the primary level would be the most 'general efficient' methodology for now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Reeza&lt;/STRONG&gt; I am not AT ALL stuck with this method. Knowing&amp;nbsp; NOTHING about exception flagging this is what I logically thought would work.&amp;nbsp; Some background for you. I am running SAS on a local machine, and have nothing to do with the generation of the data. I am picking up the data after it is created from an application, and then running it through SAS to output exceptions.&amp;nbsp; That could change in the future and SAS could be used to interface with the application directly, which I would imply would allow me to use control tables!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you perhaps give a link to some examples of the control table structure you are referring too? I'm not even really sure where to begin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Brandon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2014 13:55:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142868#M296870</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2014-05-05T13:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calling macro inside of macros, string limit length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142869#M296871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Begin by explaining and detailing your problem thoroughly &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a good idea of what you need, but hate making assumptions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2014 15:14:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142869#M296871</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-05-05T15:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calling macro inside of macros, string limit length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142870#M296872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well outside of what I have already said the problem is a bit hard to explain, but I will do my best.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been given 300 different exceptions and the logic associated to trigger each one. I have been asked to write a code that will pull from a sql database and run these exceptions against the sql database loan level data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem becomes more difficult because I have been told there are over 8,000 + additional exceptions that will be coming, in no logical order. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addition, there are attributes in the data that can control the flow of the exceptions. Ex: Right now the attribute "client" allows specific exceptions to be run, and others to not be run.&amp;nbsp; This implies there are global exceptions, and client specific exceptions. I need to design a process that will incorporate both of these, and also allow users to change which exceptions run on which client at a given point in time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However even this control flow can (and likely will) change. Ex: Tomorrow the combination of Client and policy review level might control which exceptions are run, etc..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Furthermore an exception can AND DOES have minor changes by these attributes. Example the Exception of "LTV too high" could be the same on every field across clients, except the LTV portion... Please see the example right below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Client 'Brandon'&lt;/P&gt;&lt;P&gt;LTV &amp;gt;=80;&lt;/P&gt;&lt;P&gt;Client 'Karl'&lt;/P&gt;&lt;P&gt;Ltv&amp;gt;=90;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;etc..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was planning on handling this by making two exceptions and only running the appropriate one per client... There are a lot of ways of doing this however and i'm not convinced that is the 'most correct' methodology.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is compounded because I am not yet sure how to handle the situation of non-complete exception logic.&amp;nbsp; Again see the example below for a non-complete exception example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loan Purpose='Purchase'&lt;/P&gt;&lt;P&gt;ltv&amp;gt;=90&lt;/P&gt;&lt;P&gt;Product Type = 'Fixed';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By definition the above criteria is missing Arm loans, and all loan purposes who are not purchase. HOWEVER there could be another exception given later like below...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loan Purpose='Purchase'&lt;/P&gt;&lt;P&gt;ltv&amp;gt;=90&lt;/P&gt;&lt;P&gt;Product Type = Arm;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which covers the arm problem, so I am not yet sure how to&amp;nbsp; encorporate all exceptions and then check for missing criteria.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So really the majority of the job is an "exception architecture" instead of the actual coding of the exceptions... I could always just code independent if statements for EVERY exception, and then drop the exceptions that I don't want at the attribute levels that they're not needed at (client and policy review for example).&amp;nbsp; However since I will be running thousands of exceptions every time a loan is completed this is not efficient enough, hence why I asked the question to dynamically create the If - then statements...&amp;nbsp; Also the independent if then statements will be extremely hard to de-bug, etc.. if there are over 9,000 of them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that is in depth enough, please let me know if you have any clarifying questions!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2014 14:25:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142870#M296872</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2014-05-06T14:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Calling macro inside of macros, string limit length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142871#M296873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just want to chime in here and say that writing to a temporary file is not necessary.&amp;nbsp; You can utilize call execute to do exactly the same thing, using your rules dataset as the loop, and a proc sql insert statement to insert fallouts into a master table.&amp;nbsp; (Pinching your test data Tom, hope you don't mind):&lt;/P&gt;&lt;P&gt;data rules ;&lt;BR /&gt; infile cards dsd dlm='|';&lt;BR /&gt;&amp;nbsp; length exceptioncode $10 exceptiongrade $1 exceptionage $20 ;&lt;BR /&gt;&amp;nbsp; length client $20 rule $1000 ;&lt;BR /&gt;&amp;nbsp; input exceptioncode -- rule ;&lt;BR /&gt;cards;&lt;BR /&gt;3535asdf|B|12 Months|Brandon|balance &amp;gt; 100 and loantype="purchase" and age&amp;lt;50 &lt;BR /&gt;3535asdf|B|12 Months|Enron|balance &amp;gt; 580 and loantype="purchase" and age&amp;lt;50 and producttype='test type'&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;&amp;nbsp; create table EXCEPTIONS&lt;BR /&gt;&amp;nbsp; (&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXCEPTION_CODE char(200),&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NAME char(200)&lt;BR /&gt;&amp;nbsp; );&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;&amp;nbsp; set rules;&lt;BR /&gt;&amp;nbsp; call execute('proc sql;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; insert into EXCEPTIONS&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp; "'||strip(exceptioncode)||'",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NAME&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp; YOUR_DB_DATA&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where&amp;nbsp;&amp;nbsp; '||strip(exceptionrule)';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; quit;');&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its pretty much how OC does things, except there it is a cursor, here its a dataset.&amp;nbsp; So the rules are passed into the dataset.&amp;nbsp; The call execute generates the sql code including the rule, that is run after the datastep completes. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2014 14:40:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142871#M296873</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-05-06T14:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calling macro inside of macros, string limit length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142872#M296874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey RW9! I will take a peek into your example, thank you &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To clarify, what is OC? You say "pretty muc hhow OC does things".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2014 15:19:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142872#M296874</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2014-05-06T15:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calling macro inside of macros, string limit length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142873#M296875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, it is Oracle Clinical.&amp;nbsp; I am leaving for the day now, but can pick up further question tomorrow.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2014 15:21:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142873#M296875</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-05-06T15:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: Calling macro inside of macros, string limit length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142874#M296876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was faced with a similar requirement in student enrolment data, where hundreds of exceptions had to be monitored and the list of exceptions potentially could be enlarged from year to year.&amp;nbsp; I found it best to break the problem down into more manageable chunks, using SQL or datastep code as best fitted the type of exceptions.&amp;nbsp; Examples:&lt;/P&gt;&lt;P&gt;1. Null data in a field.&amp;nbsp; A data _null_ step (or a macro) could be used to generate from a list multiple statements of the type&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If missing(abc) then do ; Exceptioncode = 'xyz' ; output ; end ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A following datastep could then screen for all null exceptions.&amp;nbsp; Not suitable for conditions involving multiple nulls.&lt;/P&gt;&lt;P&gt;2. Generic range errors - check for non client specific out of range exceptions using formats created from the exception specifications - useful for identifying values above a maximum, or zero, or negative, or not in a list of specific values.&amp;nbsp; A data _Null_ step could create a dynamic list of exceptions of the type&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exceptioncode = Put(abc, xyz.) ; if not missing (Exceptioncode) then output ;&lt;/P&gt;&lt;P&gt;3. More complex conditions - if you have a relatively small number of clients with a relatively large list of specific exceptions it may pay to separate them out using&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Where client = 'abc' ;&lt;/P&gt;&lt;P&gt;4. Otherwise create the if statements for complex conditions in another data _null_ statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I quite like the idea of generating the multiple If statements in an external file and then using %include to process them.&amp;nbsp; It creates persistent, viewable and auditable lists of conditions that have been applied.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data Exceptions ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set rdbms.customer_info ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %Include "Null_exceptions.txt" ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %Include "Range_exceptions.txt" ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %Include "Complex_exceptions.txt" ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Keep id, exceptioncode, .... ;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data ABC_Exceptions ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set rdbms.customer_info (where = (client = 'ABC')) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %Include "ABC_exceptions.txt" ;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Keep id, exceptioncode, .... ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Run ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc Append Base = Exceptions &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data = ABC_Exceptions &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;Run ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2014 23:07:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142874#M296876</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2014-05-06T23:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calling macro inside of macros, string limit length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142875#M296877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hiya Richard. I agree that I do like the idea of creating the txt files for audit purposes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In our example we have hundreds (200+) of clients, with thousands of exceptions across clients.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The big problem I have is the unknown... If tomorrow they come and say "all 10,000 exceptions need to have an additional condition to only trigger if Field "XYZ" is equal to "correct".&amp;nbsp; I could run al 10,000 exceptions and then subset the results by that field bein "correct", or I could have a master If statement that would only run WHEN that field is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Option 2 is the "best" way to do it in my opinion from a coding standpoint, but it becomes very difficult to set up a table structure that will allow for multiple If then statements within the code (also should we really?).&amp;nbsp; I will continue to play around with the code more to determine if I want to run all exceptions and then sub-set the results, or if I want to try to code them into the IF statements....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 16:15:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142875#M296877</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2014-05-15T16:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calling macro inside of macros, string limit length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142876#M296878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="j-status-levels"&gt;&lt;IMG alt="Master" class="jiveImage" src="https://communities.sas.com/5.0.2/images/status/statusicon-51.gif" title="Master" /&gt; &lt;/SPAN&gt;&lt;SPAN class="j-post-author "&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="1002" data-externalid="" data-presence="null" data-userid="255172" data-username="Reeza" href="https://communities.sas.com/people/Reeza" id="jive-25517215550670020898711"&gt;Reeza&lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; , did my example give enough information for you to elaborate more on the control table method you are referring too?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Please let me know if I can give any further information to allow you to help. I am pretty stuck still on the best way to go about this project design.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 16:19:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142876#M296878</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2014-05-15T16:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calling macro inside of macros, string limit length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142877#M296879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="j-status-levels"&gt;&lt;IMG alt="Master" class="jiveImage" src="https://communities.sas.com/5.0.2/images/status/statusicon-51.gif" title="Master" /&gt; &lt;/SPAN&gt;&lt;SPAN class="j-post-author "&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="1002" data-externalid="" data-presence="null" data-userid="255172" data-username="Reeza" href="https://communities.sas.com/people/Reeza" id="jive-25517215895444695121711"&gt;Reeza&lt;/A&gt; &lt;/STRONG&gt;when you say Control tables, are you referring to something like attached in the following Excel sheet? (I assume you are).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;The more I think about your control table suggestion the more I like the idea of it actually.&amp;nbsp; I will do some experimenting on if this is a 'logical' way to go forward with these tables and see if I can build code that will dynamically write code based upon their design (mapping the columns into condition rows, etc..) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;The reason I like your control table idea (if anyone cares) are below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;If you notice in the attached sheet, I have only 2 exceptions by 2 clients, however their conditions are distinct per client. So really it is 4 distinct exceptions.&amp;nbsp; The problem I have is I will have 7,000 + exceptions, for over 100+ different clients, and each client WILL be slightly different per exception.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;As such I'm not sure if its best to map client into the exception like I have done, or create seperate tables and simply build the exceptions at run time. (I think i'm going to have to build the exceptions at run time per the clients that are found at this point).&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;The secondary (&lt;STRONG&gt;MAIN PROBLEM&lt;/STRONG&gt;)&amp;nbsp; is how do I handle adding new exceptions in this process, or massive global changes to exceptions?&amp;nbsp; I do like how control tables are a bit easier to work through for human eyes... I also imagine I could write code that would dynamiaclly loop through all of the control tables and look for particular exceptions to make changes... thus add a new row logic to every exception that has a specific output....&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;Oh Reeza, if this is NOT what a control table is (I honestly don't know what that is) please let me know!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2014 16:21:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142877#M296879</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2014-05-19T16:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Calling macro inside of macros, string limit length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142878#M296880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Brandon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's not what I had in mind. I'd use a control table to set up the criteria's which may be what you were trying to do in the first place.&lt;/P&gt;&lt;P&gt;If your string becomes too long to include in a macro program you can add the "/lrecl=256;" option to your include statement so that it will run as well. Or as long as it needs to be, I'm not sure what the limit is. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ClientID ConditionID Variable Condition ExceptionType&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp; LoanType&amp;nbsp;&amp;nbsp;&amp;nbsp; =ARM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exclude&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp; LoanAmount&amp;nbsp;&amp;nbsp; &amp;gt;180&amp;nbsp;&amp;nbsp;&amp;nbsp; Exclude&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Becomes &lt;/P&gt;&lt;P&gt;if ClientID = "A" and loanType="ARM" and LoanAmount&amp;gt;180 then exceptionType="Exclude"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is used to generate your code, with a unique condition generated by clientID condition so they can be strung together with an AND in the clauses. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps at least a little. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fareeza&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2014 22:57:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-macro-inside-of-macros-string-limit-length/m-p/142878#M296880</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-05-19T22:57:40Z</dc:date>
    </item>
  </channel>
</rss>

