<?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: ods excelxp filename with macro in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excelxp-filename-with-macro/m-p/410889#M19789</link>
    <description>&lt;P&gt;Thanks for the reply. I tried several times you mentioned. The macro has values. It only can not be resolved when I put it to the file name of&amp;nbsp; ODS excelxp output. I want to know what is the rules&amp;nbsp;of&amp;nbsp;ods tagsets excelxp path file name ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Nov 2017 15:17:10 GMT</pubDate>
    <dc:creator>daisy6</dc:creator>
    <dc:date>2017-11-06T15:17:10Z</dc:date>
    <item>
      <title>ods excelxp filename with macro</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excelxp-filename-with-macro/m-p/410450#M19778</link>
      <description>&lt;P&gt;Hi SAS guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I run&amp;nbsp; into a problem. When I use ods excelxp to output my table to xml file, the file name can not be resovled.&lt;/P&gt;&lt;P&gt;Here is part of my code:&lt;/P&gt;&lt;P&gt;...........&lt;/P&gt;&lt;P&gt;ODS noresults;&lt;BR /&gt;ODS listing close; /*Turn off the standard line printer destination*/&lt;BR /&gt;ods tagsets.ExcelXP path="&amp;amp;dir./&amp;amp;&amp;amp;examdegree&amp;amp;i."&lt;BR /&gt;file="&amp;amp;&amp;amp;abexamd&amp;amp;i._&amp;amp;&amp;amp;degree&amp;amp;k._&amp;amp;mon..xml"&lt;BR /&gt;style=seaside /*Styles to control appearance of output*/;&lt;BR /&gt;ods tagsets.ExcelXP&lt;BR /&gt;options ( sheet_name= "Directory" embedded_titles='yes' autofit_height= 'yes' frozen_headers= '1' autofilter= 'yes' frozen_rowheaders="2" absolute_column_width= '20,20,4,4,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8');&lt;BR /&gt;options missing=" ";&lt;BR /&gt;title j=l "&amp;amp;&amp;amp;examdegree&amp;amp;i. ";&lt;BR /&gt;title1 j=l "Breakout: &amp;amp;&amp;amp;degree&amp;amp;k.";&lt;BR /&gt;title2 j=l "Reporting Window: &amp;amp;mon.";&lt;BR /&gt;proc Report data=uall NOWD&lt;BR /&gt;style(header)=[foreground=white background=CX4D7EBF];&lt;BR /&gt;Column form summary roster;&lt;BR /&gt;define form /Center display "Form Name";&lt;BR /&gt;define summary / center display "Summary";&lt;BR /&gt;define roster / center display "Roster" ;&lt;BR /&gt;compute form;&lt;BR /&gt;row+1;&lt;BR /&gt;if (mod(row,2)) then do;&lt;BR /&gt;call define(_row_,"style","style=[background=CXECEDEC]");&lt;BR /&gt;end;&lt;BR /&gt;endcomp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the log window shows:&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference ABEXAMD1_ not resolved.&lt;BR /&gt;WARNING: Apparent symbolic reference DEGREE3_2017_08 not resolved.&lt;BR /&gt;NOTE: Writing TAGSETS.EXCELXP Body file: &amp;amp;abexamd1_&amp;amp;degree3_2017_08.xml&lt;BR /&gt;NOTE: This is the Excel XP tagset (Compatible with SAS 9.1.3 and above, v1.130, 05/01/2011). Add&lt;BR /&gt;options(doc='help') to the ods statement for more information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Those &amp;amp;&amp;amp;abexamd&amp;amp;i. and &amp;amp;&amp;amp;degree&amp;amp;k. have values when I use %put &lt;SPAN&gt;&amp;amp;&amp;amp;abexamd&amp;amp;i. &amp;amp;&amp;amp;degree&amp;amp;k.&amp;nbsp; command.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The titles which have macro values are resolved.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2017 20:27:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excelxp-filename-with-macro/m-p/410450#M19778</guid>
      <dc:creator>daisy6</dc:creator>
      <dc:date>2017-11-03T20:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: ods excelxp filename with macro</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excelxp-filename-with-macro/m-p/410456#M19779</link>
      <description>&lt;P&gt;Did you try your %put for the problem variables in code immediately following the ods tagsets.ExcelXP&amp;nbsp;statement that is generating the error?&lt;/P&gt;
&lt;P&gt;If your test the value elsewhere you may have something defined that is not available (yet) at that point in your code.&lt;/P&gt;
&lt;P&gt;If your %put test was in a separate macro it may be a scope issue.&lt;/P&gt;
&lt;P&gt;If I have code (a very skeleton description) such as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro one ();&lt;/P&gt;
&lt;P&gt;&amp;lt;does something that creates macro variables "&amp;amp;&amp;amp;abexamd&amp;amp;I&amp;gt;&lt;/P&gt;
&lt;P&gt;%mend;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And call that macro elsewhere:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro othermacro ();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%one;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;my excelxp output&amp;gt;&lt;/P&gt;
&lt;P&gt;%mend;&lt;/P&gt;
&lt;P&gt;then the variables created in macro one may not be available in Othermacro if they are not declared as global when created.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2017 20:46:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excelxp-filename-with-macro/m-p/410456#M19779</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-11-03T20:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: ods excelxp filename with macro</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excelxp-filename-with-macro/m-p/410889#M19789</link>
      <description>&lt;P&gt;Thanks for the reply. I tried several times you mentioned. The macro has values. It only can not be resolved when I put it to the file name of&amp;nbsp; ODS excelxp output. I want to know what is the rules&amp;nbsp;of&amp;nbsp;ods tagsets excelxp path file name ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 15:17:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excelxp-filename-with-macro/m-p/410889#M19789</guid>
      <dc:creator>daisy6</dc:creator>
      <dc:date>2017-11-06T15:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: ods excelxp filename with macro</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excelxp-filename-with-macro/m-p/410945#M19790</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;file="&amp;amp;&amp;amp;abexamd&amp;amp;i._&amp;amp;&amp;amp;degree&amp;amp;k._&amp;amp;mon..xml"&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I think you need two dots after &amp;amp;&amp;amp;abexamd&amp;amp;i and two dots after &amp;amp;&amp;amp;degree&amp;amp;k&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 18:10:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excelxp-filename-with-macro/m-p/410945#M19790</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-11-06T18:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: ods excelxp filename with macro</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excelxp-filename-with-macro/m-p/410957#M19791</link>
      <description>&lt;P&gt;You have&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;file="&amp;amp;&amp;amp;abexamd&amp;amp;i._&amp;amp;&amp;amp;degree&amp;amp;k._&amp;amp;mon..xml"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So if I set some values for I,K, and MON.&amp;nbsp; And also create ABEXAMD(i) and DEGREE(k) variables that I assume you are trying to resolve.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let i=1 ;
%let k=2 ;
%let mon=JAN ;
%let abexamd1=XXX ;
%let degree2=YYY;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And try your string I get errors that macro variables are not found.&lt;/P&gt;
&lt;PRE&gt;130   %put file="&amp;amp;&amp;amp;abexamd&amp;amp;i._&amp;amp;&amp;amp;degree&amp;amp;k._&amp;amp;mon..xml" ;
WARNING: Apparent symbolic reference ABEXAMD1_ not resolved.
WARNING: Apparent symbolic reference DEGREE2_JAN not resolved.
file="&amp;amp;abexamd1_&amp;amp;degree2_JAN.xml"&lt;/PRE&gt;
&lt;P&gt;So you need to add another period since the SAS macro processor is making two passes because of the &amp;amp;&amp;amp; included in the expression.&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;file="&amp;amp;&amp;amp;abexamd&amp;amp;i.._&amp;amp;&amp;amp;degree&amp;amp;k.._&amp;amp;mon..xml"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Testing&lt;/P&gt;
&lt;PRE&gt;137   %put file="&amp;amp;&amp;amp;abexamd&amp;amp;i.._&amp;amp;&amp;amp;degree&amp;amp;k.._&amp;amp;mon..xml" ;
file="XXX_YYY_JAN.xml"&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 18:46:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excelxp-filename-with-macro/m-p/410957#M19791</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-11-06T18:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: ods excelxp filename with macro</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excelxp-filename-with-macro/m-p/410972#M19793</link>
      <description>&lt;P&gt;Thank Tom very much. You help works and&amp;nbsp; I appreciate! You save my day!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 20:01:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ods-excelxp-filename-with-macro/m-p/410972#M19793</guid>
      <dc:creator>daisy6</dc:creator>
      <dc:date>2017-11-06T20:01:53Z</dc:date>
    </item>
  </channel>
</rss>

