<?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: can macro call be imitated in the datastep in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/can-macro-call-be-imitated-in-the-datastep/m-p/433146#M107369</link>
    <description>&lt;P&gt;You're mixing macro and data step logic and with out the rest of the code or any sort of sample data or a clear question it's going to be really hard to help you.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Feb 2018 15:56:48 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-02-01T15:56:48Z</dc:date>
    <item>
      <title>can macro call be imitated in the datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-macro-call-be-imitated-in-the-datastep/m-p/433070#M107332</link>
      <description>&lt;P&gt;I have a macro program which calls screened and screenfailure and it is optional. Below in the datastep i use these for calculating. If i change in the macro call instead of screened as screening and scrn fail instead of screenfailure can i make the datastep also change. I Know it is weird but can there any step where i can do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;		if upcase(DSTERM) in ("SCREENING" "SCREENED") then do;
		   %if &amp;amp;TotIncl ne %then %do;
		      &amp;amp;armvar="&amp;amp;TotName";
		   %end;
		    descr='Patients screened';
			sort1=1;
			sort2=1;
			n=count;
			n_pct=.;
			output;
		end;

		%* Screen failure*;
	    if upcase(DSTERM) in ("SCREENING FAILURE" "SCREEN FAILURE") then do;
		   %if &amp;amp;TotIncl ne %then %do;
		      &amp;amp;armvar="&amp;amp;TotName";
		   %end;
		   descr='Screening failures';
		   n=count;
		   n_pct=.;
           sort1=2;
		   sort2=1;
		   output;
		end;&lt;/PRE&gt;
&lt;P&gt;macro call is&lt;/P&gt;
&lt;PRE&gt;%macro inc(	
        Anl = sdtm.ds,
	AnlSel = %quote(DSTERM in ("SCREENED" "SCREEN FAILURE"))
etc...
);&lt;/PRE&gt;
&lt;P&gt;any help&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 11:56:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-macro-call-be-imitated-in-the-datastep/m-p/433070#M107332</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2018-02-01T11:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: can macro call be imitated in the datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-macro-call-be-imitated-in-the-datastep/m-p/433076#M107337</link>
      <description>&lt;P&gt;Sas Documentation for call Execute, it is to call macro from a datastep execution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n1q1527d51eivsn1ob5hnz0yd1hx.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n1q1527d51eivsn1ob5hnz0yd1hx.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data xxx;
.....

call execute('%inc(Anl = '||sdtm.ds/*Data step Variable*/||', AnlSel = %quote(DSTERM in ("SCREENED" "SCREEN FAILURE"))');


.....

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 12:16:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-macro-call-be-imitated-in-the-datastep/m-p/433076#M107337</guid>
      <dc:creator>Satish_Parida</dc:creator>
      <dc:date>2018-02-01T12:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: can macro call be imitated in the datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-macro-call-be-imitated-in-the-datastep/m-p/433096#M107347</link>
      <description>&lt;P&gt;Your post makes no sense at all.&amp;nbsp; You give a brief definition of a macro called inc which is not used anywhere in the code given.&amp;nbsp; You call macros which you have not given any description.&lt;/P&gt;
&lt;P&gt;Second up, why do you even need all these macros and such like, your just overcomplicating things for the purpose of doing it.&amp;nbsp; If you want to do some logic for screened data and some other code for non-screen then this is an if/then scenario e.g:&lt;/P&gt;
&lt;PRE&gt;...
  if upcase(dsterm) in ("SCREENING","SCREENED") then do;
    /* Code to do if true */
  end;
  else do;
    /* Code to do if false */
  end;
...&lt;/PRE&gt;
&lt;P&gt;Also DSTERM is a standard variable from the DS domain, why are you needing to upper case it, and check if it is in a list, the values should already be consistent within you SDTM domain - possible even as part of a value list.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 13:04:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-macro-call-be-imitated-in-the-datastep/m-p/433096#M107347</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-02-01T13:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: can macro call be imitated in the datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-macro-call-be-imitated-in-the-datastep/m-p/433146#M107369</link>
      <description>&lt;P&gt;You're mixing macro and data step logic and with out the rest of the code or any sort of sample data or a clear question it's going to be really hard to help you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 15:56:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-macro-call-be-imitated-in-the-datastep/m-p/433146#M107369</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-01T15:56:48Z</dc:date>
    </item>
  </channel>
</rss>

