<?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: Cycle Through Maco List? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Cycle-Through-Maco-List/m-p/196154#M36878</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. Or you could combine the datasets and process them all at once using BY statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One way to start is just replace the reference to the input data set with a &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;macro variable&lt;/STRONG&gt;&lt;/SPAN&gt; instead.&amp;nbsp; Or perhaps with just the prefix part.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;%let prefix=F2F_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's assume your main analysis code that you want to repeat is something like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc summary data=&amp;amp;prefix.source ;&amp;nbsp; output out=&amp;amp;prefix.means; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc print data=&amp;amp;prefix.means; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could then save the main code into a separate program and then call it three times.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let prefix=F2F_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%inc 'main_program.sas';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let prefix=IT_ ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%inc 'main_program.sas';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The next step is to convert your program to a SAS &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;macro&lt;/STRONG&gt;&lt;/SPAN&gt; and then call it three times with different parameter value.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%macro main(prefix);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc summary....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%mend main ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%main(F2F_);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%main(IT_);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The next step is add a %DO loop so that you could call it with multiple prefixes at once and it would scan through them.&amp;nbsp; You could add this logic into the macro or make a new macro that does the looping and calls the other macro to do the work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%macro main_looper(prefixlist);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%local i;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%do i=1 %to %sysfunc(countw(&amp;amp;prefixlist),%str( )) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; %main(%scan(&amp;amp;prefixlist,&amp;amp;i,%str( )));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%mend main_looper;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%main_looper(F2F_ IT_)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 May 2015 15:53:28 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2015-05-29T15:53:28Z</dc:date>
    <item>
      <title>Cycle Through Maco List?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cycle-Through-Maco-List/m-p/196151#M36875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible for code to be ran by cycling through macros that I have listed?&amp;nbsp; For example, I am trying to run the exact same code three, on 3 different main datasets;&amp;nbsp; One dataset is all course types, one is face to face only course types, and the last is online only course types.&amp;nbsp; Right now I have three separate SAS files, one for each course type previously listed.&amp;nbsp; Is there a way that I can write a macro or program to run all the code for all course types, then run again for face to face, and then again for online?&amp;nbsp; I know that I can create macro variables and change the macro three times and have it work, but can I have it 'cycle' or 'run' through 3 macros that I have listed with changing it and running it 3 times, or running 3 separate files?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reasoning for wanting this: Since the three files are exact with the exception of the main datasets used initially and the naming of created datasets (i.e. face to face have F2F_ as a prefix on all WORK files and internet have IT_), I am thinking that if I have an addition or edit I think have to edit 3 files, rather than just one.&amp;nbsp; Editing that many files can lead to more errors that may be avoidable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 15:25:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cycle-Through-Maco-List/m-p/196151#M36875</guid>
      <dc:creator>laura6728</dc:creator>
      <dc:date>2015-05-29T15:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Cycle Through Maco List?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cycle-Through-Maco-List/m-p/196152#M36876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is why you can used macros (routine) or generate sas-code from a dataset (dosubl). Answer: Yes it is possible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 15:37:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cycle-Through-Maco-List/m-p/196152#M36876</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2015-05-29T15:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Cycle Through Maco List?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cycle-Through-Maco-List/m-p/196153#M36877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What should I do or search for on how to accomplish this?&amp;nbsp; Is there a specific macro I can use?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 15:42:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cycle-Through-Maco-List/m-p/196153#M36877</guid>
      <dc:creator>laura6728</dc:creator>
      <dc:date>2015-05-29T15:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: Cycle Through Maco List?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cycle-Through-Maco-List/m-p/196154#M36878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. Or you could combine the datasets and process them all at once using BY statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One way to start is just replace the reference to the input data set with a &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;macro variable&lt;/STRONG&gt;&lt;/SPAN&gt; instead.&amp;nbsp; Or perhaps with just the prefix part.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;%let prefix=F2F_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's assume your main analysis code that you want to repeat is something like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc summary data=&amp;amp;prefix.source ;&amp;nbsp; output out=&amp;amp;prefix.means; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc print data=&amp;amp;prefix.means; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could then save the main code into a separate program and then call it three times.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let prefix=F2F_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%inc 'main_program.sas';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let prefix=IT_ ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%inc 'main_program.sas';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The next step is to convert your program to a SAS &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;macro&lt;/STRONG&gt;&lt;/SPAN&gt; and then call it three times with different parameter value.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%macro main(prefix);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc summary....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%mend main ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%main(F2F_);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%main(IT_);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The next step is add a %DO loop so that you could call it with multiple prefixes at once and it would scan through them.&amp;nbsp; You could add this logic into the macro or make a new macro that does the looping and calls the other macro to do the work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%macro main_looper(prefixlist);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%local i;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%do i=1 %to %sysfunc(countw(&amp;amp;prefixlist),%str( )) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; %main(%scan(&amp;amp;prefixlist,&amp;amp;i,%str( )));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%mend main_looper;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%main_looper(F2F_ IT_)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 15:53:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cycle-Through-Maco-List/m-p/196154#M36878</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-05-29T15:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Cycle Through Maco List?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cycle-Through-Maco-List/m-p/196155#M36879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is the next question. The dosubl function&amp;nbsp; calls code from a datastep the call execute is one that appends code to be executed after the running datastep. All 3 options are their advantages and disadvantages. The best one to choose is up to you and dependicy on the complextiy of your code and your skills. &lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/67398/HTML/default/viewer.htm#p09dcftd1xxg1kn1brnjyc0q93yk.htm" title="http://support.sas.com/documentation/cdl/en/lefunctionsref/67398/HTML/default/viewer.htm#p09dcftd1xxg1kn1brnjyc0q93yk.htm"&gt;SAS(R) 9.4 Functions and CALL Routines: Reference, Third Edition&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 15:59:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cycle-Through-Maco-List/m-p/196155#M36879</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2015-05-29T15:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Cycle Through Maco List?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cycle-Through-Maco-List/m-p/196156#M36880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, I am going to try this and see how it goes!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 16:03:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cycle-Through-Maco-List/m-p/196156#M36880</guid>
      <dc:creator>laura6728</dc:creator>
      <dc:date>2015-05-29T16:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: Cycle Through Maco List?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cycle-Through-Maco-List/m-p/196157#M36881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;BY processing suggestion.&lt;/P&gt;&lt;P&gt;Combine the data into one large dataset with a source variable.&amp;nbsp; Then add this source variable as a BY variable to all of your later steps.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;data all ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;&amp;nbsp; length source indsname $41.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp; set f2f_input it_input indsname=indsname;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp; source=indsname ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;proc summary data=all ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;&amp;nbsp; by source ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;&amp;nbsp; output out=means;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;proc print data=means;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;&amp;nbsp; by source;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 16:05:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cycle-Through-Maco-List/m-p/196157#M36881</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-05-29T16:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Cycle Through Maco List?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cycle-Through-Maco-List/m-p/196158#M36882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can also use Call Execute and/or macro lists to add to your options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I prefer call execute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://gist.github.com/statgeek/beb97b1c6d4517dde3b2" title="https://gist.github.com/statgeek/beb97b1c6d4517dde3b2"&gt;SAS - Call macro using parameters from data set&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/********************************************************************&lt;/P&gt;&lt;P&gt;Example : Call macro using parameters from data set&lt;/P&gt;&lt;P&gt;********************************************************************/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=sashelp.class out=class;&lt;/P&gt;&lt;P&gt;by age sex;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro summary(age=, sex=);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=sashelp.class;&lt;/P&gt;&lt;P&gt;where age=&amp;amp;age and sex="&amp;amp;sex";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data sample;&lt;/P&gt;&lt;P&gt;set class;&lt;/P&gt;&lt;P&gt;by age sex;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if last.sex;&lt;/P&gt;&lt;P&gt;string =&lt;/P&gt;&lt;P&gt;&amp;nbsp; catt('%summary(age=', age, ',sex=', sex, ');');&lt;/P&gt;&lt;P&gt;put string;&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;data _null_;&lt;/P&gt;&lt;P&gt;set sample;&lt;/P&gt;&lt;P&gt;call execute(string);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 16:39:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cycle-Through-Maco-List/m-p/196158#M36882</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-05-29T16:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: Cycle Through Maco List?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cycle-Through-Maco-List/m-p/196159#M36883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have written a macro, CallMacro,&lt;/P&gt;&lt;P&gt;that has two parameters&lt;/P&gt;&lt;P&gt;1. data set&lt;/P&gt;&lt;P&gt;2. macro name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I call the data set a list, SAS calls it a control data set;&lt;/P&gt;&lt;P&gt;see e.g. proc format cntlin =&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each row in the list is a set of parameters.&lt;/P&gt;&lt;P&gt;That means that the variables names must match the parameters of the macro being called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA list_class_types;&lt;/P&gt;&lt;P&gt;attrib data length = $32;&lt;/P&gt;&lt;P&gt;data = 'all_course_types';&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;data = 'face_to_face_only_course_types'&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;data ='online_only_course_types';&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;stop;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%CallMacr(data = list_class_types,&lt;/P&gt;&lt;P&gt;macro_name = mymacro)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ron Fehd&amp;nbsp; automagic maven&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/Macro_CallMacr" title="http://www.sascommunity.org/wiki/Macro_CallMacr"&gt;http://www.sascommunity.org/wiki/Macro_CallMacr&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you want to use it, ping me&lt;/P&gt;&lt;P&gt;as I have a few modifications that are not on the sco.wiki page.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 22:08:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cycle-Through-Maco-List/m-p/196159#M36883</guid>
      <dc:creator>Ron_MacroMaven</dc:creator>
      <dc:date>2015-05-29T22:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Cycle Through Maco List?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cycle-Through-Maco-List/m-p/196160#M36884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is what I ultimately used and worked, thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 18:05:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cycle-Through-Maco-List/m-p/196160#M36884</guid>
      <dc:creator>laura6728</dc:creator>
      <dc:date>2015-08-13T18:05:37Z</dc:date>
    </item>
  </channel>
</rss>

