<?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: Macro help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168733#M32369</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SAS deletes the temporary files when you clear the fileref or close the session.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Jul 2014 17:14:21 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2014-07-08T17:14:21Z</dc:date>
    <item>
      <title>Macro help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168724#M32360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to print different excel file on particular location based on the name from dataset 'Country'.(Program in attached text file)&lt;/P&gt;&lt;P&gt;To that file,&amp;nbsp; I want to add another excel file output in sheet2 which are generated from another table "XXX" ( if the country are matching)&lt;/P&gt;&lt;P&gt;But I am not able to succeed.&lt;/P&gt;&lt;P&gt;Can anybody help me.&lt;/P&gt;&lt;P&gt;Attached program and output to be displayed for your reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May be is there any altenative way to keep the code simple&lt;/P&gt;&lt;P&gt;&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>Mon, 07 Jul 2014 12:11:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168724#M32360</guid>
      <dc:creator>Abraham</dc:creator>
      <dc:date>2014-07-07T12:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168725#M32361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure I am following what the problem is.&amp;nbsp; You could change the code slightly to:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table LOOP as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select distinct COUNTRY from HAVE;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;ods tagsets.excelxp file="...\file.xlsx";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* This loops over each country and prints the dataset with the corresponding country name to the tagset */&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set LOOP;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('ods tagsets.excelxp options=(sheet_name="'||strip(country)||'");&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc print data='||strip(country)||';&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;ods tagsets.excelxp options=(sheet_name="Help");&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;ods tagsets.excelxp close;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 12:40:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168725#M32361</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-07T12:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168726#M32362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks RW for looking into the issue.&lt;/P&gt;&lt;P&gt;I have not that much idea regarding the macro.&lt;/P&gt;&lt;P&gt;In my attached program, three datasets are there (country, xxx and cre_time) out of which I want to print the excel file based on distinct name from dataset country.&amp;nbsp; (e.g. if name =india, US, then two excel output will be generated ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once the excel file is generated, I want to create another sheet (on the existing) name as "Data2". To the sheet (Data2), data will be added from another dataset (xxx) if the name are matching.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.g. For datasets xxx and country, the common matching variable is 'name'.&amp;nbsp; So data from dataset (xxx) will be added to&amp;nbsp; sheet (Data2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attach output for your reference.&lt;/P&gt;&lt;P&gt;Output should be like below (as distinct name would be india, us and uk, so three excel spreadsheet will be created in C drive)&lt;/P&gt;&lt;P&gt;UK_23JAN2014_25MAR2014.xlsx&lt;/P&gt;&lt;P&gt;US_23JAN2014_25MAR2014.xlsx&lt;/P&gt;&lt;P&gt;India_23JAN2014_25MAR2014.xlsx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2014 08:13:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168726#M32362</guid>
      <dc:creator>Abraham</dc:creator>
      <dc:date>2014-07-08T08:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168727#M32363</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;Yes, you just need to modify the code presented:&lt;/P&gt;&lt;P&gt;proc sql;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Get a list of countries, we will loop over the code once for each of them */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table LOOP as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select distinct COUNTRY from HAVE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table DATA2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Create an empty table to print to data2 */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (COL1 char(200));&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* This loops over each country and prints the dataset with the corresponding country name to the tagset */&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set LOOP;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('ods tagsets.excelxp file="...\'||strip(country)||'.xlsx";&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Create a file as per country */&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ods tagsets.excelxp options=(sheet_name="'||strip(country)||'");&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Set the sheetname as country */&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc print data=xxx where=(country="'||strip(country)||'"));&amp;nbsp; /* Print the xxx data only where country=current country */ &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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('ods tagsets.excelxp options=(sheet_name="data2");&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc print data=data2;&amp;nbsp;&amp;nbsp; /* Print the empty dataset data2 to the spreadsheet to get second tab */&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ods tagsets.excelxp close;');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2014 08:43:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168727#M32363</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-08T08:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168728#M32364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You RW9 for explaining elaborately. I have modified the code, excel file also generated but with no output. I have also added the time range. May I request you to have a look once again Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2014 10:03:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168728#M32364</guid>
      <dc:creator>Abraham</dc:creator>
      <dc:date>2014-07-08T10:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168729#M32365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, my post got removed for some reason.&amp;nbsp; See attached, note that name needs to be in xxx exactly, you had some extra characters.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2014 13:06:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168729#M32365</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-08T13:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168730#M32366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice solution RW9.&amp;nbsp; I never think to use call execute() for something like this.&amp;nbsp; I would have put the country values into macro variables and then used a macro with a %do loop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2014 14:57:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168730#M32366</guid>
      <dc:creator>bentleyj1</dc:creator>
      <dc:date>2014-07-08T14:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168731#M32367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Personally I find it much easier to generate the code using a data step and then %INCLUDE it than use CALL EXECUTE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) You can look at the generated code and check if it is right. Pull it into the editor and submit the top one or two blocks.&lt;/P&gt;&lt;P&gt;2) You can take advantage of the power of the PUT command and avoid string concatenation.&amp;nbsp; For example if you dataset variable names match your macro parameter names or statement option names then you can use the VAR= syntax in the PUT statements to get both the name and the value output.&lt;/P&gt;&lt;P&gt;3) You can avoid the timing issues of having macro statements executed while the commands are bring pushed onto the stack.&lt;/P&gt;&lt;P&gt;4) You can avoid generating hundreds (thousands) of macro variables and having to create macro to allow %DO to loop over them.&lt;/P&gt;&lt;P&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="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&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;&amp;nbsp; &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; LOOP;&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;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;/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; file=cats(&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;,country,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'.xlsx'&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;put&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'ods tagsets.excelxp '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; file= :&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;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;put&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'ods tagsets.excelxp options=(sheet_name='&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; country :&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;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; ;&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;put&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'proc print data=xxx;'&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: purple; background: white;"&gt;&amp;nbsp;&amp;nbsp; / '&amp;nbsp; where '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; country= :&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;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'run;'&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; ;&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;put&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'ods tagsets.excelxp options=(sheet_name="data2");'&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;put&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'proc print data=data2;'&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;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'run;'&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; ;&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;put&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'ods tagsets.excelxp close;'&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="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&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&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%include&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; code / source2 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2014 16:03:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168731#M32367</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-07-08T16:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168732#M32368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I have seen this approach a fair bit over time.&amp;nbsp; Personally I don't like the temporary files lying around (which also show up in version control), and there is a minor overhead of read/write to the file.&amp;nbsp; If you don't trust your code or want to run parts of it then just add a debug in (and maybe keep the dataset in work:&lt;/P&gt;&lt;P&gt;data stored_code;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set loop;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; attrib cmdline format=$2000.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Create your commands and output */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmdline=cats'ods tagsets.excelxp file="',,,,, ; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmdline='proc print...;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Run only commands up to a certain point */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if 1 &amp;lt;= _n_ &amp;lt;= /* Enter a value here of command lines to process */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute(cmdlien);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2014 16:25:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168732#M32368</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-08T16:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168733#M32369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SAS deletes the temporary files when you clear the fileref or close the session.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2014 17:14:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168733#M32369</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-07-08T17:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168734#M32370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You so much RW9 for providing the solution. Thank you TOM also.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 03:47:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/168734#M32370</guid>
      <dc:creator>Abraham</dc:creator>
      <dc:date>2014-07-09T03:47:52Z</dc:date>
    </item>
  </channel>
</rss>

