<?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 How to pass value to the parameterized macro inside sas XML Tags in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740144#M231143</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to pass the value to the&amp;nbsp;file_loop macro inside the XML tag.&lt;/P&gt;&lt;P&gt;Example:&amp;nbsp; '&amp;lt;value&amp;gt;'&lt;STRONG&gt; DC_01&lt;/STRONG&gt; +(-1) '&amp;lt;/value&amp;gt;'; i need to pass the value of DC_01 to the file_loop macro.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data _null_;&lt;BR /&gt;set transformed_data;&lt;BR /&gt;file "$test/DB/TEST_test1.xml";&lt;BR /&gt;if _n_=1 then&lt;BR /&gt;do;&lt;BR /&gt;put '&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;';&lt;BR /&gt;put '&amp;lt;soapenv:Envelope xmlns:soapenv="&lt;A href="http://schemas.xmlsoap.org/soap/envelope/" target="_blank"&gt;http://schemas.xmlsoap.org/soap/envelope/&lt;/A&gt;" xmlns:type="&lt;A href="http://www.quinity.com/qis/soap/qisxmlpolicyrequestservice/type" target="_blank"&gt;http://www.quinity.com/qis/soap/qisxmlpolicyrequestservice/type&lt;/A&gt;"&amp;gt;';&lt;BR /&gt;put '&amp;lt;soapenv:Header /&amp;gt;';&lt;BR /&gt;put '&amp;lt;soapenv:Body&amp;gt;';&lt;BR /&gt;put '&amp;lt;handlePolicyApplicationRequest&amp;gt;';&lt;BR /&gt;put '&amp;lt;policyRequest&amp;gt;';&lt;BR /&gt;options mprint;&lt;BR /&gt;options mlogic;&lt;BR /&gt;options symbolgen;&lt;BR /&gt;%macro file_loop(DC_ID);&lt;BR /&gt;%if &amp;amp;DC_ID. ne Missing %then %Do;&lt;BR /&gt;put '&amp;lt;answer&amp;gt;';&lt;BR /&gt;put '&amp;lt;value&amp;gt;' &amp;amp;DC_ID. +(-1) '&amp;lt;/value&amp;gt;';&lt;BR /&gt;put '&amp;lt;/answer&amp;gt;';&lt;BR /&gt;%End;&lt;BR /&gt;%else %Do;&lt;BR /&gt;put '&amp;lt;answer&amp;gt;';&lt;BR /&gt;put '&amp;lt;value/&amp;gt;';&lt;BR /&gt;put '&amp;lt;/answer&amp;gt;';&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;Put '&amp;lt;applicationForm&amp;gt;';&lt;BR /&gt;Put '&amp;lt;applicationFormGroupList&amp;gt;';&lt;BR /&gt;put '&amp;lt;applicationFormGroup&amp;gt;';&lt;BR /&gt;put '&amp;lt;formGroupRef&amp;gt;';&lt;BR /&gt;put '&amp;lt;externalIdentifier&amp;gt;PolicyDate&amp;lt;/externalIdentifier&amp;gt;';&lt;BR /&gt;put '&amp;lt;/formGroupRef&amp;gt;';&lt;BR /&gt;put '&amp;lt;applicationFormQuestionList&amp;gt;';&lt;BR /&gt;put '&amp;lt;applicationFormQuestion&amp;gt;';&lt;BR /&gt;put '&amp;lt;formQuestionRef&amp;gt;';&lt;BR /&gt;put '&amp;lt;externalIdentifier&amp;gt;Policy&amp;lt;/externalIdentifier&amp;gt;';&lt;BR /&gt;put '&amp;lt;/formQuestionRef&amp;gt;';&lt;BR /&gt;put '&amp;lt;answer&amp;gt;';&lt;BR /&gt;put '&amp;lt;value&amp;gt;' DC_01 +(-1) '&amp;lt;/value&amp;gt;';&lt;BR /&gt;/* %file_loop(DC_01);*/&lt;BR /&gt;put '&amp;lt;/answer&amp;gt;';&lt;BR /&gt;put '&amp;lt;/applicationFormQuestion&amp;gt;';&lt;BR /&gt;put '&amp;lt;/applicationFormQuestionList&amp;gt;';&lt;BR /&gt;put '&amp;lt;/applicationFormGroup&amp;gt;';&lt;/P&gt;&lt;P&gt;put '&amp;lt;applicationFormGroup&amp;gt;';&lt;BR /&gt;put '&amp;lt;formGroupRef&amp;gt;';&lt;BR /&gt;put '&amp;lt;externalIdentifier&amp;gt;Prod&amp;lt;/externalIdentifier&amp;gt;';&lt;BR /&gt;put '&amp;lt;/formGroupRef&amp;gt;';&lt;BR /&gt;put '&amp;lt;applicationFormQuestionList&amp;gt;';&lt;BR /&gt;put '&amp;lt;applicationFormQuestion&amp;gt;';&lt;BR /&gt;put '&amp;lt;formQuestionRef&amp;gt;';&lt;BR /&gt;put '&amp;lt;externalIdentifier&amp;gt;ProdName&amp;lt;/externalIdentifier&amp;gt;';&lt;BR /&gt;put '&amp;lt;/formQuestionRef&amp;gt;';&lt;BR /&gt;put '&amp;lt;answer&amp;gt;';&lt;BR /&gt;put '&amp;lt;value&amp;gt;' DC_02 +(-1) '&amp;lt;/value&amp;gt;';&lt;BR /&gt;/* %file_loop(DC_02;*/&lt;BR /&gt;put '&amp;lt;/answer&amp;gt;';&lt;BR /&gt;put '&amp;lt;/applicationFormQuestion&amp;gt;';&lt;BR /&gt;put '&amp;lt;/applicationFormQuestionList&amp;gt;';&lt;BR /&gt;put '&amp;lt;/applicationFormGroup&amp;gt;';&lt;BR /&gt;put '&amp;lt;/applicationFormGroupList&amp;gt;';&lt;BR /&gt;put '&amp;lt;/applicationForm&amp;gt;';&lt;BR /&gt;put '&amp;lt;/policyRequest&amp;gt;';&lt;BR /&gt;put '&amp;lt;/handlePolicyApplicationRequest&amp;gt;';&lt;BR /&gt;put '&amp;lt;/soapenv:Body&amp;gt;';&lt;BR /&gt;put '&amp;lt;/soapenv:Envelope&amp;gt;';&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Mon, 10 May 2021 12:04:39 GMT</pubDate>
    <dc:creator>Shantaram</dc:creator>
    <dc:date>2021-05-10T12:04:39Z</dc:date>
    <item>
      <title>How to pass value to the parameterized macro inside sas XML Tags</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740144#M231143</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to pass the value to the&amp;nbsp;file_loop macro inside the XML tag.&lt;/P&gt;&lt;P&gt;Example:&amp;nbsp; '&amp;lt;value&amp;gt;'&lt;STRONG&gt; DC_01&lt;/STRONG&gt; +(-1) '&amp;lt;/value&amp;gt;'; i need to pass the value of DC_01 to the file_loop macro.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data _null_;&lt;BR /&gt;set transformed_data;&lt;BR /&gt;file "$test/DB/TEST_test1.xml";&lt;BR /&gt;if _n_=1 then&lt;BR /&gt;do;&lt;BR /&gt;put '&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;';&lt;BR /&gt;put '&amp;lt;soapenv:Envelope xmlns:soapenv="&lt;A href="http://schemas.xmlsoap.org/soap/envelope/" target="_blank"&gt;http://schemas.xmlsoap.org/soap/envelope/&lt;/A&gt;" xmlns:type="&lt;A href="http://www.quinity.com/qis/soap/qisxmlpolicyrequestservice/type" target="_blank"&gt;http://www.quinity.com/qis/soap/qisxmlpolicyrequestservice/type&lt;/A&gt;"&amp;gt;';&lt;BR /&gt;put '&amp;lt;soapenv:Header /&amp;gt;';&lt;BR /&gt;put '&amp;lt;soapenv:Body&amp;gt;';&lt;BR /&gt;put '&amp;lt;handlePolicyApplicationRequest&amp;gt;';&lt;BR /&gt;put '&amp;lt;policyRequest&amp;gt;';&lt;BR /&gt;options mprint;&lt;BR /&gt;options mlogic;&lt;BR /&gt;options symbolgen;&lt;BR /&gt;%macro file_loop(DC_ID);&lt;BR /&gt;%if &amp;amp;DC_ID. ne Missing %then %Do;&lt;BR /&gt;put '&amp;lt;answer&amp;gt;';&lt;BR /&gt;put '&amp;lt;value&amp;gt;' &amp;amp;DC_ID. +(-1) '&amp;lt;/value&amp;gt;';&lt;BR /&gt;put '&amp;lt;/answer&amp;gt;';&lt;BR /&gt;%End;&lt;BR /&gt;%else %Do;&lt;BR /&gt;put '&amp;lt;answer&amp;gt;';&lt;BR /&gt;put '&amp;lt;value/&amp;gt;';&lt;BR /&gt;put '&amp;lt;/answer&amp;gt;';&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;Put '&amp;lt;applicationForm&amp;gt;';&lt;BR /&gt;Put '&amp;lt;applicationFormGroupList&amp;gt;';&lt;BR /&gt;put '&amp;lt;applicationFormGroup&amp;gt;';&lt;BR /&gt;put '&amp;lt;formGroupRef&amp;gt;';&lt;BR /&gt;put '&amp;lt;externalIdentifier&amp;gt;PolicyDate&amp;lt;/externalIdentifier&amp;gt;';&lt;BR /&gt;put '&amp;lt;/formGroupRef&amp;gt;';&lt;BR /&gt;put '&amp;lt;applicationFormQuestionList&amp;gt;';&lt;BR /&gt;put '&amp;lt;applicationFormQuestion&amp;gt;';&lt;BR /&gt;put '&amp;lt;formQuestionRef&amp;gt;';&lt;BR /&gt;put '&amp;lt;externalIdentifier&amp;gt;Policy&amp;lt;/externalIdentifier&amp;gt;';&lt;BR /&gt;put '&amp;lt;/formQuestionRef&amp;gt;';&lt;BR /&gt;put '&amp;lt;answer&amp;gt;';&lt;BR /&gt;put '&amp;lt;value&amp;gt;' DC_01 +(-1) '&amp;lt;/value&amp;gt;';&lt;BR /&gt;/* %file_loop(DC_01);*/&lt;BR /&gt;put '&amp;lt;/answer&amp;gt;';&lt;BR /&gt;put '&amp;lt;/applicationFormQuestion&amp;gt;';&lt;BR /&gt;put '&amp;lt;/applicationFormQuestionList&amp;gt;';&lt;BR /&gt;put '&amp;lt;/applicationFormGroup&amp;gt;';&lt;/P&gt;&lt;P&gt;put '&amp;lt;applicationFormGroup&amp;gt;';&lt;BR /&gt;put '&amp;lt;formGroupRef&amp;gt;';&lt;BR /&gt;put '&amp;lt;externalIdentifier&amp;gt;Prod&amp;lt;/externalIdentifier&amp;gt;';&lt;BR /&gt;put '&amp;lt;/formGroupRef&amp;gt;';&lt;BR /&gt;put '&amp;lt;applicationFormQuestionList&amp;gt;';&lt;BR /&gt;put '&amp;lt;applicationFormQuestion&amp;gt;';&lt;BR /&gt;put '&amp;lt;formQuestionRef&amp;gt;';&lt;BR /&gt;put '&amp;lt;externalIdentifier&amp;gt;ProdName&amp;lt;/externalIdentifier&amp;gt;';&lt;BR /&gt;put '&amp;lt;/formQuestionRef&amp;gt;';&lt;BR /&gt;put '&amp;lt;answer&amp;gt;';&lt;BR /&gt;put '&amp;lt;value&amp;gt;' DC_02 +(-1) '&amp;lt;/value&amp;gt;';&lt;BR /&gt;/* %file_loop(DC_02;*/&lt;BR /&gt;put '&amp;lt;/answer&amp;gt;';&lt;BR /&gt;put '&amp;lt;/applicationFormQuestion&amp;gt;';&lt;BR /&gt;put '&amp;lt;/applicationFormQuestionList&amp;gt;';&lt;BR /&gt;put '&amp;lt;/applicationFormGroup&amp;gt;';&lt;BR /&gt;put '&amp;lt;/applicationFormGroupList&amp;gt;';&lt;BR /&gt;put '&amp;lt;/applicationForm&amp;gt;';&lt;BR /&gt;put '&amp;lt;/policyRequest&amp;gt;';&lt;BR /&gt;put '&amp;lt;/handlePolicyApplicationRequest&amp;gt;';&lt;BR /&gt;put '&amp;lt;/soapenv:Body&amp;gt;';&lt;BR /&gt;put '&amp;lt;/soapenv:Envelope&amp;gt;';&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 12:04:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740144#M231143</guid>
      <dc:creator>Shantaram</dc:creator>
      <dc:date>2021-05-10T12:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass value to the parameterized macro inside sas XML Tags</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740185#M231156</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45547"&gt;@Shantaram&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;It's not clear to me what you are trying to achieve, can you reword your request maybe with a simple example without any macros&lt;BR /&gt;&lt;BR /&gt;A couple of points to make your code clearer to understand:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Move your macro definition (&lt;SPAN&gt;%macro file_loop(DC_ID); ... %mend&lt;/SPAN&gt;) out side of the data step&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Move the option statements (option mprint ; etc.) out&amp;nbsp;side of the data step&amp;nbsp;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;When working with macros it is easier if you initially create the code without any macros and test. Then add macro variables (e.g. %let var=5; put "my macro variable value is %var" ; ) and test. Finally create macro definitions (%macro name; %mend)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 14:18:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740185#M231156</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2021-05-10T14:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass value to the parameterized macro inside sas XML Tags</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740191#M231158</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Inside file_loop you need to quote the text +(-1) as well.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put '&amp;lt;value&amp;gt;' &amp;amp;DC_ID. '+(-1) &amp;lt;/value&amp;gt;';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want to check whether a dataset variable has been passed to %file_loop then check vs nothing like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if &amp;amp;DC_ID. ne %then %Do;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro file_loop(DC_ID);
%if &amp;amp;DC_ID. ne %then %Do;
put '&amp;lt;answer&amp;gt;';
put '&amp;lt;value&amp;gt;' &amp;amp;DC_ID. '+(-1) &amp;lt;/value&amp;gt;';
put '&amp;lt;/answer&amp;gt;';
%End;
%else %Do;
put '&amp;lt;answer&amp;gt;';
put '&amp;lt;value/&amp;gt;';
put '&amp;lt;/answer&amp;gt;';
%end;
%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 14:29:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740191#M231158</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2021-05-10T14:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass value to the parameterized macro inside sas XML Tags</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740268#M231201</link>
      <description>&lt;P&gt;This question:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;How to pass the value to the&amp;nbsp;file_loop macro inside the XML tag.&lt;/P&gt;
&lt;P&gt;Example:&amp;nbsp; '&amp;lt;value&amp;gt;'&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;DC_01&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;+(-1) '&amp;lt;/value&amp;gt;'; i need to pass the value of DC_01 to the file_loop macro&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Does not make much sense.&amp;nbsp; You pass text to a macro.&amp;nbsp; So you could pass the text DC_01 to the macro and use the macro to generate SAS code that uses the string DC_01 as the name of a variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to pass the value of the variable named DC_01 in the source dataset TRANSFORMED_DATA to the text file&amp;nbsp;&lt;SPAN&gt;"$test/DB/TEST_test1.xml" then why would you need any macro code?&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;This PUT statement should do that.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put  '&amp;lt;value&amp;gt;'&amp;nbsp;DC_01&amp;nbsp;+(-1) '&amp;lt;/value&amp;gt;';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;If you want to pass the value of DC_01 to the macro then that cannot happen in the context this data step.&amp;nbsp; The statements that exist in a data step have to all have been compiled before the data step starts running and so before it can access the values of any variables.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 20:13:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740268#M231201</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-05-10T20:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass value to the parameterized macro inside sas XML Tags</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740366#M231265</link>
      <description>Hi AMSAS,&lt;BR /&gt;&lt;BR /&gt;put '&amp;lt;formQuestionRef&amp;gt;';&lt;BR /&gt;put '&amp;lt;externalIdentifier&amp;gt;Policyno&amp;lt;/externalIdentifier&amp;gt;';&lt;BR /&gt;put '&amp;lt;/formQuestionRef&amp;gt;';&lt;BR /&gt;put '&amp;lt;answer&amp;gt;';&lt;BR /&gt;put '&amp;lt;value&amp;gt;' DC_01 +(-1) '&amp;lt;/value&amp;gt;';&lt;BR /&gt;put '&amp;lt;/answer&amp;gt;';&lt;BR /&gt;EX. policy_no is a question and DC_01 is the answer. Suppose policy number is empty(answer value) in the table at that time i need &amp;lt;/Value&amp;gt; not like &amp;lt;value&amp;gt; &amp;lt;/value&amp;gt; output.</description>
      <pubDate>Tue, 11 May 2021 04:22:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740366#M231265</guid>
      <dc:creator>Shantaram</dc:creator>
      <dc:date>2021-05-11T04:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass value to the parameterized macro inside sas XML Tags</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740367#M231266</link>
      <description>I have to pass value from (put '&amp;lt;value&amp;gt;' &amp;amp;DC_ID. '+(-1) &amp;lt;/value&amp;gt;';) here. instead if &amp;amp;DC_id. i have to pass column value to the macro.</description>
      <pubDate>Tue, 11 May 2021 04:27:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740367#M231266</guid>
      <dc:creator>Shantaram</dc:creator>
      <dc:date>2021-05-11T04:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass value to the parameterized macro inside sas XML Tags</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740368#M231267</link>
      <description>Thanks TOM&lt;BR /&gt;put '&amp;lt;value&amp;gt;' DC_01 +(-1) '&amp;lt;/value&amp;gt;';&lt;BR /&gt;Consider their is missing value of DC_01 then it will print &amp;lt;value&amp;gt; &amp;lt;/value&amp;gt; but i need to print like this &amp;lt;/value&amp;gt; only.</description>
      <pubDate>Tue, 11 May 2021 04:32:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740368#M231267</guid>
      <dc:creator>Shantaram</dc:creator>
      <dc:date>2021-05-11T04:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass value to the parameterized macro inside sas XML Tags</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740404#M231284</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45547"&gt;@Shantaram&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I have to pass value from (put '&amp;lt;value&amp;gt;' &amp;amp;DC_ID. '+(-1) &amp;lt;/value&amp;gt;';) here. instead if &amp;amp;DC_id. i have to pass column value to the macro.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;ok, I think what you want is this: (replace -100 / 100 with the value needed&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro file_loop(DC_ID,addValue);
   if &amp;amp;DC_ID. ne . then Do;
      put '&amp;lt;answer&amp;gt;';
      &amp;amp;DC_ID.=&amp;amp;DC_ID.+&amp;amp;addValue.;
      put '&amp;lt;value&amp;gt;' &amp;amp;DC_ID.'&amp;lt;/value&amp;gt;';
      put '&amp;lt;/answer&amp;gt;';
   End;
   else Do;
      put '&amp;lt;answer&amp;gt;';
      put '&amp;lt;value/&amp;gt;';
      put '&amp;lt;/answer&amp;gt;';
   end;
%mend file_loop;

options mprint mlogic symbolgen;

data _null_;
set transformed_data;
file "$test/DB/TEST_test1.xml";
if _n_=1 then
do;
put '&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;';
put '&amp;lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:type="http://www.quinity.com/qis/soap/qisxmlpolicyrequestservice/type"&amp;gt;';
put '&amp;lt;soapenv:Header /&amp;gt;';
put '&amp;lt;soapenv:Body&amp;gt;';
put '&amp;lt;handlePolicyApplicationRequest&amp;gt;';
put '&amp;lt;policyRequest&amp;gt;';

Put '&amp;lt;applicationForm&amp;gt;';
Put '&amp;lt;applicationFormGroupList&amp;gt;';
put '&amp;lt;applicationFormGroup&amp;gt;';
put '&amp;lt;formGroupRef&amp;gt;';
put '&amp;lt;externalIdentifier&amp;gt;PolicyDate&amp;lt;/externalIdentifier&amp;gt;';
put '&amp;lt;/formGroupRef&amp;gt;';
put '&amp;lt;applicationFormQuestionList&amp;gt;';
put '&amp;lt;applicationFormQuestion&amp;gt;';
put '&amp;lt;formQuestionRef&amp;gt;';
put '&amp;lt;externalIdentifier&amp;gt;Policy&amp;lt;/externalIdentifier&amp;gt;';
put '&amp;lt;/formQuestionRef&amp;gt;';
%file_loop(DC_01,-100);
put '&amp;lt;/applicationFormQuestion&amp;gt;';
put '&amp;lt;/applicationFormQuestionList&amp;gt;';
put '&amp;lt;/applicationFormGroup&amp;gt;';
put '&amp;lt;applicationFormGroup&amp;gt;';
put '&amp;lt;formGroupRef&amp;gt;';
put '&amp;lt;externalIdentifier&amp;gt;Prod&amp;lt;/externalIdentifier&amp;gt;';
put '&amp;lt;/formGroupRef&amp;gt;';
put '&amp;lt;applicationFormQuestionList&amp;gt;';
put '&amp;lt;applicationFormQuestion&amp;gt;';
put '&amp;lt;formQuestionRef&amp;gt;';
put '&amp;lt;externalIdentifier&amp;gt;ProdName&amp;lt;/externalIdentifier&amp;gt;';
put '&amp;lt;/formQuestionRef&amp;gt;';
%file_loop(DC_02,100);
put '&amp;lt;/applicationFormQuestion&amp;gt;';
put '&amp;lt;/applicationFormQuestionList&amp;gt;';
put '&amp;lt;/applicationFormGroup&amp;gt;';
put '&amp;lt;/applicationFormGroupList&amp;gt;';
put '&amp;lt;/applicationForm&amp;gt;';
put '&amp;lt;/policyRequest&amp;gt;';
put '&amp;lt;/handlePolicyApplicationRequest&amp;gt;';
put '&amp;lt;/soapenv:Body&amp;gt;';
put '&amp;lt;/soapenv:Envelope&amp;gt;';
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 May 2021 08:25:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740404#M231284</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2021-05-11T08:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass value to the parameterized macro inside sas XML Tags</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740431#M231294</link>
      <description>Hi Oligolas,&lt;BR /&gt;&lt;BR /&gt;Thank you so much.&lt;BR /&gt;Its working.</description>
      <pubDate>Tue, 11 May 2021 11:29:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740431#M231294</guid>
      <dc:creator>Shantaram</dc:creator>
      <dc:date>2021-05-11T11:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass value to the parameterized macro inside sas XML Tags</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740432#M231295</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45547"&gt;@Shantaram&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks TOM&lt;BR /&gt;put '&amp;lt;value&amp;gt;' DC_01 +(-1) '&amp;lt;/value&amp;gt;';&lt;BR /&gt;Consider their is missing value of DC_01 then it will print &amp;lt;value&amp;gt; &amp;lt;/value&amp;gt; but i need to print like this &amp;lt;/value&amp;gt; only.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;To test if the variable DC_01 has a missing value on this observation use SAS code, not macro code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if missing(DC_01) then do;
   ...
end;
else do;
  ...
end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Are you sure the user of the XML file cares how you have coded the XML to represent a missing value?&amp;nbsp; These two lines should mean the same thing.&lt;/P&gt;
&lt;PRE&gt;&amp;lt;value&amp;gt;&amp;lt;/value&amp;gt;
&amp;lt;value/&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 May 2021 11:38:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740432#M231295</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-05-11T11:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass value to the parameterized macro inside sas XML Tags</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740433#M231296</link>
      <description>Thanks TOM.</description>
      <pubDate>Tue, 11 May 2021 11:43:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-value-to-the-parameterized-macro-inside-sas-XML-Tags/m-p/740433#M231296</guid>
      <dc:creator>Shantaram</dc:creator>
      <dc:date>2021-05-11T11:43:15Z</dc:date>
    </item>
  </channel>
</rss>

