<?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 Variable Parameter Not Recognized in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487467#M127030</link>
    <description>Thank you ! My mistake. Thanks!</description>
    <pubDate>Thu, 16 Aug 2018 15:05:26 GMT</pubDate>
    <dc:creator>Ivy</dc:creator>
    <dc:date>2018-08-16T15:05:26Z</dc:date>
    <item>
      <title>Macro Variable Parameter Not Recognized</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487137#M126886</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am calling the macro below. However,&amp;nbsp; program cannot recognize macro variable &amp;amp;linenumber = 0 , however, it can recognize &amp;amp;linenumber = 1&amp;nbsp; is there anything wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Ivy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro demo( linenumber ,indsn , agevar, outdsn ) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%if &amp;amp;linenumber. = 0 %then %do ;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%if &amp;amp;linenumber. = 1 %then %do ;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%demo( linenumber = 0 ,indsn=ads.ads , agevar = MetDiagnosisDate, outdsn = demog0 ) ;&lt;/P&gt;&lt;P&gt;%demo( linenumber = 1 ,indsn=ads.ads , agevar = stdtline1, outdsn = demog1 ) ;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 19:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487137#M126886</guid>
      <dc:creator>Ivy</dc:creator>
      <dc:date>2018-08-15T19:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable Parameter Not Recognized</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487145#M126891</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/70526"&gt;@Ivy&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am calling the macro below. However,&amp;nbsp; program cannot recognize macro variable &amp;amp;linenumber = 0 , however, it can recognize &amp;amp;linenumber = 1&amp;nbsp; is there anything wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;Ivy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro demo( linenumber ,indsn , agevar, outdsn ) ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if &amp;amp;linenumber. = 0 %then %do ;&lt;/P&gt;
&lt;P&gt;%end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if &amp;amp;linenumber. = 1 %then %do ;&lt;/P&gt;
&lt;P&gt;%end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%mend;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%demo( linenumber = 0 ,indsn=ads.ads , agevar = MetDiagnosisDate, outdsn = demog0 ) ;&lt;/P&gt;
&lt;P&gt;%demo( linenumber = 1 ,indsn=ads.ads , agevar = stdtline1, outdsn = demog1 ) ;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Since you have severely edited the macro it is very hard to tell what might be going on. What is your symptom that the parameter is not recognized.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest rerunning you code after setting:&lt;/P&gt;
&lt;P&gt;options mprint mlogic;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%demo( linenumber = 0 ,indsn=ads.ads , agevar = MetDiagnosisDate, outdsn = demog0 ) ;&lt;/P&gt;
&lt;P&gt;and turn of the macro diagnostics with&lt;/P&gt;
&lt;P&gt;options nomprint nomlogic;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This should generate with some details of what is going on such as results of macro logic (%if for example) and generated code.&lt;/P&gt;
&lt;P&gt;And SAS error or notes should appear in better context as well.&lt;/P&gt;
&lt;P&gt;If you still haven't determined what the issue is them copy and paste the log results of running that macro from the %demo until the end of the macro code into a code box opened using the forum's {I}. Pasting log info into the main message windows will reformat the text and may make it harder to determine what is going on.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 19:19:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487145#M126891</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-15T19:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable Parameter Not Recognized</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487146#M126892</link>
      <description>&lt;P&gt;Works fine for me, your error is somewhere else:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro demo( linenumber ,indsn , agevar, outdsn ) ;

 

%if &amp;amp;linenumber. = 0 %then %do ;
%put 'Line Number = 0';
%end;

 

%if &amp;amp;linenumber. = 1 %then %do ;
%put 'Line Number = 1';
%end;

 

%mend;

 

%demo( linenumber = 0 ,indsn=ads.ads , agevar = MetDiagnosisDate, outdsn = demog0 ) ;

%demo( linenumber = 1 ,indsn=ads.ads , agevar = stdtline1, outdsn = demog1 ) ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Log showing correct evaluation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1247 %macro demo( linenumber ,indsn , agevar, outdsn ) ;&lt;BR /&gt;1248&lt;BR /&gt;1249&lt;BR /&gt;1250&lt;BR /&gt;1251 %if &amp;amp;linenumber. = 0 %then %do ;&lt;BR /&gt;1252 %put 'Line Number = 0';&lt;BR /&gt;1253 %end;&lt;BR /&gt;1254&lt;BR /&gt;1255&lt;BR /&gt;1256&lt;BR /&gt;1257 %if &amp;amp;linenumber. = 1 %then %do ;&lt;BR /&gt;1258 %put 'Line Number = 1';&lt;BR /&gt;1259 %end;&lt;BR /&gt;1260&lt;BR /&gt;1261&lt;BR /&gt;1262&lt;BR /&gt;1263 %mend;&lt;BR /&gt;1264&lt;BR /&gt;1265&lt;BR /&gt;1266&lt;BR /&gt;1267 %demo( linenumber = 0 ,indsn=ads.ads , agevar = MetDiagnosisDate, outdsn = demog0 ) ;&lt;BR /&gt;&lt;FONT color="#008080"&gt;&lt;STRONG&gt;'Line Number = 0'&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;1268&lt;BR /&gt;1269 %demo( linenumber = 1 ,indsn=ads.ads , agevar = stdtline1, outdsn = demog1 ) ;&lt;BR /&gt;&lt;FONT color="#008080"&gt;&lt;STRONG&gt;'Line Number = 1'&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/70526"&gt;@Ivy&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am calling the macro below. However,&amp;nbsp; program cannot recognize macro variable &amp;amp;linenumber = 0 , however, it can recognize &amp;amp;linenumber = 1&amp;nbsp; is there anything wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;Ivy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro demo( linenumber ,indsn , agevar, outdsn ) ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if &amp;amp;linenumber. = 0 %then %do ;&lt;/P&gt;
&lt;P&gt;%end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if &amp;amp;linenumber. = 1 %then %do ;&lt;/P&gt;
&lt;P&gt;%end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%mend;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%demo( linenumber = 0 ,indsn=ads.ads , agevar = MetDiagnosisDate, outdsn = demog0 ) ;&lt;/P&gt;
&lt;P&gt;%demo( linenumber = 1 ,indsn=ads.ads , agevar = stdtline1, outdsn = demog1 ) ;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 19:20:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487146#M126892</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-15T19:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable Parameter Not Recognized</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487148#M126893</link>
      <description>&lt;P&gt;The posted code looks fine.&amp;nbsp; Check your SAS log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One possibility is that you attempted to re-define an existing macro, changing the parameter names, and there were some errors in the macro definition (missing %END or something) so that it did not get compiled&amp;nbsp; &amp;nbsp;So you are actually calling an old version of the macro that uses different parameters.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 19:25:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487148#M126893</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-08-15T19:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable Parameter Not Recognized</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487158#M126899</link>
      <description>&lt;P&gt;Thanks, Reeze.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are right, when I add other statement, error showed.&amp;nbsp; I am not sure why there was error. The following is whole log.&amp;nbsp; Program skip the two %if condition to the following statements:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%demo( linenumber=0 ,indsn=ads.ads , agevar = MetDiagnosisDate, outdsn = demog0 ) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;24 GOPTIONS ACCESSIBLE;&lt;BR /&gt;25 %macro demo( linenumber ,indsn , agevar, outdsn ) ;&lt;BR /&gt;26&lt;BR /&gt;27 %if &amp;amp;linenumber. =0 %then %do ;&lt;BR /&gt;28 data demo;&lt;BR /&gt;29 set &amp;amp;indsn.;&lt;BR /&gt;30 yearmet = year(MetDiagnosisDate);&lt;BR /&gt;31 age = year(&amp;amp;agevar.) - birthyear;&lt;BR /&gt;32 run;&lt;BR /&gt;33 %let var = yearmet gender age weight0 PracticeType LLY_region Race ecog0 GroupStage ER PR HER2;&lt;BR /&gt;34 %end;&lt;BR /&gt;35&lt;BR /&gt;36 %if &amp;amp;linenumber. = 1 %then %do;&lt;BR /&gt;37 data demo;&lt;BR /&gt;38 set &amp;amp;indsn.;&lt;BR /&gt;39 yearmet = year(MetDiagnosisDate);&lt;BR /&gt;40 age = year(&amp;amp;agevar.) - birthyear;&lt;BR /&gt;41 run;&lt;BR /&gt;42 %let var = yearmet gender age weight1 PracticeType LLY_region Race ecog0 GroupStage ER PR HER2;&lt;BR /&gt;43 %end;&lt;BR /&gt;44&lt;BR /&gt;45 data demog;&lt;BR /&gt;46 length cohort $30;&lt;BR /&gt;47 set demo(in=a)&lt;BR /&gt;48 demo(in=b)&lt;BR /&gt;49 demo(where=(HR='positive' and her2='negative') in=c)&lt;BR /&gt;50 demo(where=(HR='positive' and her2='positive') in=d)&lt;BR /&gt;51 demo(where=(HR='negative' and her2='negative') in=e)&lt;BR /&gt;52 demo(where=(HR='negative' and her2='positive') in=f) ;&lt;BR /&gt;53 if a then cohort = 'overall';&lt;BR /&gt;54 if b then cohort = put(treat, 1.);&lt;BR /&gt;55 if c then cohort = 'subtypeA';&lt;BR /&gt;56 if d then cohort = 'subtypeB';&lt;BR /&gt;57 if e then cohort = 'subtypeC';&lt;BR /&gt;2 The SAS System&lt;/P&gt;&lt;P&gt;58 if f then cohort = 'subtypeD';&lt;BR /&gt;59 run;&lt;BR /&gt;60&lt;BR /&gt;61&lt;BR /&gt;62 %mend;&lt;BR /&gt;63&lt;BR /&gt;64 %demo;&lt;BR /&gt;MLOGIC(DEMO): Beginning execution.&lt;BR /&gt;MLOGIC(DEMO): Parameter LINENUMBER has value&lt;BR /&gt;MLOGIC(DEMO): Parameter INDSN has value&lt;BR /&gt;MLOGIC(DEMO): Parameter AGEVAR has value&lt;BR /&gt;MLOGIC(DEMO): Parameter OUTDSN has value&lt;BR /&gt;MLOGIC(DEMO): %IF condition &amp;amp;linenumber. =0 is FALSE&lt;BR /&gt;MLOGIC(DEMO): %IF condition &amp;amp;linenumber. = 1 is FALSE&lt;BR /&gt;MPRINT(DEMO): data demog;&lt;BR /&gt;MPRINT(DEMO): length cohort $30;&lt;BR /&gt;MPRINT(DEMO): set demo(in=a) demo(in=b) demo(where=(HR='positive' and her2='negative') in=c) demo(where=(HR='positive' and&lt;BR /&gt;her2='positive') in=d) demo(where=(HR='negative' and her2='negative') in=e) demo(where=(HR='negative' and her2='positive') in=f) ;&lt;BR /&gt;ERROR: File WORK.DEMO.DATA does not exist.&lt;BR /&gt;ERROR: File WORK.DEMO.DATA does not exist.&lt;BR /&gt;ERROR: File WORK.DEMO.DATA does not exist.&lt;BR /&gt;ERROR: File WORK.DEMO.DATA does not exist.&lt;BR /&gt;ERROR: File WORK.DEMO.DATA does not exist.&lt;BR /&gt;ERROR: File WORK.DEMO.DATA does not exist.&lt;BR /&gt;MPRINT(DEMO): if a then cohort = 'overall';&lt;BR /&gt;MPRINT(DEMO): if b then cohort = put(treat, 1.);&lt;BR /&gt;MPRINT(DEMO): if c then cohort = 'subtypeA';&lt;BR /&gt;MPRINT(DEMO): if d then cohort = 'subtypeB';&lt;BR /&gt;MPRINT(DEMO): if e then cohort = 'subtypeC';&lt;BR /&gt;MPRINT(DEMO): if f then cohort = 'subtypeD';&lt;BR /&gt;MPRINT(DEMO): run;&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.DEMOG may be incomplete. When this step was stopped there were 0 observations and 2 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;MLOGIC(DEMO): Ending execution.&lt;BR /&gt;65&lt;BR /&gt;66&lt;BR /&gt;67 %demo( linenumber=0 ,indsn=ads.ads , agevar = MetDiagnosisDate, outdsn = demog0 ) ;&lt;BR /&gt;MLOGIC(DEMO): Beginning execution.&lt;BR /&gt;MLOGIC(DEMO): Parameter LINENUMBER has value 0&lt;BR /&gt;MLOGIC(DEMO): Parameter INDSN has value ads.ads&lt;BR /&gt;MLOGIC(DEMO): Parameter AGEVAR has value MetDiagnosisDate&lt;BR /&gt;MLOGIC(DEMO): Parameter OUTDSN has value demog0&lt;BR /&gt;MLOGIC(DEMO): %IF condition &amp;amp;linenumber. =0 is TRUE&lt;BR /&gt;MPRINT(DEMO): data demo;&lt;BR /&gt;MPRINT(DEMO): set ads.ads;&lt;BR /&gt;MPRINT(DEMO): yearmet = year(MetDiagnosisDate);&lt;BR /&gt;MPRINT(DEMO): age = year(MetDiagnosisDate) - birthyear;&lt;BR /&gt;MPRINT(DEMO): run;&lt;/P&gt;&lt;P&gt;NOTE: There were 9841 observations read from the data set ADS.ADS.&lt;BR /&gt;NOTE: The data set WORK.DEMO has 9841 observations and 46 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;3 The SAS System&lt;/P&gt;&lt;P&gt;real time 0.02 seconds&lt;BR /&gt;cpu time 0.02 seconds&lt;/P&gt;&lt;P&gt;MLOGIC(DEMO): %LET (variable name is VAR)&lt;BR /&gt;MLOGIC(DEMO): %IF condition &amp;amp;linenumber. = 1 is FALSE&lt;BR /&gt;MPRINT(DEMO): data demog;&lt;BR /&gt;MPRINT(DEMO): length cohort $30;&lt;BR /&gt;MPRINT(DEMO): set demo(in=a) demo(in=b) demo(where=(HR='positive' and her2='negative') in=c) demo(where=(HR='positive' and&lt;BR /&gt;her2='positive') in=d) demo(where=(HR='negative' and her2='negative') in=e) demo(where=(HR='negative' and her2='positive') in=f) ;&lt;BR /&gt;MPRINT(DEMO): if a then cohort = 'overall';&lt;BR /&gt;MPRINT(DEMO): if b then cohort = put(treat, 1.);&lt;BR /&gt;MPRINT(DEMO): if c then cohort = 'subtypeA';&lt;BR /&gt;MPRINT(DEMO): if d then cohort = 'subtypeB';&lt;BR /&gt;MPRINT(DEMO): if e then cohort = 'subtypeC';&lt;BR /&gt;MPRINT(DEMO): if f then cohort = 'subtypeD';&lt;BR /&gt;MPRINT(DEMO): run;&lt;/P&gt;&lt;P&gt;NOTE: There were 9841 observations read from the data set WORK.DEMO.&lt;BR /&gt;NOTE: There were 9841 observations read from the data set WORK.DEMO.&lt;BR /&gt;NOTE: There were 5467 observations read from the data set WORK.DEMO.&lt;BR /&gt;WHERE (HR='positive') and (her2='negative');&lt;BR /&gt;NOTE: There were 458 observations read from the data set WORK.DEMO.&lt;BR /&gt;WHERE (HR='positive') and (her2='positive');&lt;BR /&gt;NOTE: There were 1775 observations read from the data set WORK.DEMO.&lt;BR /&gt;WHERE (HR='negative') and (her2='negative');&lt;BR /&gt;NOTE: There were 354 observations read from the data set WORK.DEMO.&lt;BR /&gt;WHERE (HR='negative') and (her2='positive');&lt;BR /&gt;NOTE: The data set WORK.DEMOG has 27736 observations and 47 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.05 seconds&lt;BR /&gt;cpu time 0.04 seconds&lt;/P&gt;&lt;P&gt;MLOGIC(DEMO): Ending execution.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 19:45:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487158#M126899</guid>
      <dc:creator>Ivy</dc:creator>
      <dc:date>2018-08-15T19:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable Parameter Not Recognized</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487183#M126912</link>
      <description>&lt;P&gt;Dear all, thank you so much for your advices.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The program is when I adding the other parts, the error showing up.&amp;nbsp; It skip two %if condition to run the programs after two %if condition , then coming back to run %if condition, however, I want %if condition run first, then run the rest program:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro demo( linenumber ,indsn , agevar, outdsn ) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%if &amp;amp;linenumber. =0 %then %do ;&lt;BR /&gt;data demo;&lt;BR /&gt;set &amp;amp;indsn.;&lt;BR /&gt;yearmet = year(MetDiagnosisDate);&lt;BR /&gt;age = year(&amp;amp;agevar.) - birthyear;&lt;BR /&gt;run;&lt;BR /&gt;%let var = yearmet gender age weight0 PracticeType LLY_region Race ecog0 GroupStage ER PR HER2;&lt;BR /&gt;%end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%if &amp;amp;linenumber. = 1 %then %do;&lt;BR /&gt;data demo;&lt;BR /&gt;set &amp;amp;indsn.;&lt;BR /&gt;yearmet = year(MetDiagnosisDate);&lt;BR /&gt;age = year(&amp;amp;agevar.) - birthyear;&lt;BR /&gt;run;&lt;BR /&gt;%let var = yearmet gender age weight1 PracticeType LLY_region Race ecog1 GroupStage ER PR HER2;&lt;BR /&gt;%end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data demog;&lt;BR /&gt;length cohort $30;&lt;BR /&gt;set demo(in=a)&lt;BR /&gt;demo(in=b)&lt;BR /&gt;demo(where=(HR='positive' and her2='negative') in=c)&lt;BR /&gt;demo(where=(HR='positive' and her2='positive') in=d)&lt;BR /&gt;demo(where=(HR='negative' and her2='negative') in=e)&lt;BR /&gt;demo(where=(HR='negative' and her2='positive') in=f) ;&lt;BR /&gt;if a then cohort = 'overall';&lt;BR /&gt;if b then cohort = put(treat, 1.);&lt;BR /&gt;if c then cohort = 'subtypeA';&lt;BR /&gt;if d then cohort = 'subtypeB';&lt;BR /&gt;if e then cohort = 'subtypeC';&lt;BR /&gt;if f then cohort = 'subtypeD';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;%demo;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%demo( linenumber=0 ,indsn=ads.ads , agevar = MetDiagnosisDate, outdsn = demog0 ) ;&lt;/P&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: Writing HTML(EGHTML) Body file: EGHTML&lt;BR /&gt;23&lt;BR /&gt;24 GOPTIONS ACCESSIBLE;&lt;BR /&gt;25 option mprint mlogic;&lt;BR /&gt;26&lt;BR /&gt;27 %macro demo( linenumber ,indsn , agevar, outdsn ) ;&lt;BR /&gt;28&lt;BR /&gt;29 %if &amp;amp;linenumber. = 0 %then %do ;&lt;BR /&gt;30 data demo;&lt;BR /&gt;31 set &amp;amp;indsn.;&lt;BR /&gt;32 yearmet = year(MetDiagnosisDate);&lt;BR /&gt;33 age = year(&amp;amp;agevar.) - birthyear;&lt;BR /&gt;34 run;&lt;BR /&gt;35 %let var = yearmet gender age weight0 PracticeType LLY_region Race ecog0 GroupStage ER PR HER2;&lt;BR /&gt;36 %end;&lt;BR /&gt;37&lt;BR /&gt;38 %if &amp;amp;linenumber. = 1 %then %do;&lt;BR /&gt;39 data demo;&lt;BR /&gt;40 set &amp;amp;indsn.;&lt;BR /&gt;41 yearmet = year(MetDiagnosisDate);&lt;BR /&gt;42 age = year(&amp;amp;agevar.) - birthyear;&lt;BR /&gt;43 run;&lt;BR /&gt;44 %let var = yearmet gender age weight1 PracticeType LLY_region Race ecog1 GroupStage ER PR HER2;&lt;BR /&gt;45 %end;&lt;BR /&gt;46&lt;BR /&gt;47 data demog;&lt;BR /&gt;48 length cohort $30;&lt;BR /&gt;49 set demo(in=a)&lt;BR /&gt;50 demo(in=b)&lt;BR /&gt;51 demo(where=(HR='positive' and her2='negative') in=c)&lt;BR /&gt;52 demo(where=(HR='positive' and her2='positive') in=d)&lt;BR /&gt;53 demo(where=(HR='negative' and her2='negative') in=e)&lt;BR /&gt;54 demo(where=(HR='negative' and her2='positive') in=f) ;&lt;BR /&gt;55 if a then cohort = 'overall';&lt;BR /&gt;56 if b then cohort = put(treat, 1.);&lt;BR /&gt;57 if c then cohort = 'subtypeA';&lt;BR /&gt;2 The SAS System&lt;/P&gt;&lt;P&gt;58 if d then cohort = 'subtypeB';&lt;BR /&gt;59 if e then cohort = 'subtypeC';&lt;BR /&gt;60 if f then cohort = 'subtypeD';&lt;BR /&gt;61 run;&lt;BR /&gt;62&lt;BR /&gt;63&lt;BR /&gt;64&lt;BR /&gt;65 %mend;&lt;BR /&gt;66&lt;BR /&gt;67 %demo;&lt;BR /&gt;MLOGIC(DEMO): Beginning execution.&lt;BR /&gt;MLOGIC(DEMO): Parameter LINENUMBER has value&lt;BR /&gt;MLOGIC(DEMO): Parameter INDSN has value&lt;BR /&gt;MLOGIC(DEMO): Parameter AGEVAR has value&lt;BR /&gt;MLOGIC(DEMO): Parameter OUTDSN has value&lt;BR /&gt;MLOGIC(DEMO): %IF condition &amp;amp;linenumber. = 0 is FALSE&lt;BR /&gt;MLOGIC(DEMO): %IF condition &amp;amp;linenumber. = 1 is FALSE&lt;BR /&gt;MPRINT(DEMO): data demog;&lt;BR /&gt;MPRINT(DEMO): length cohort $30;&lt;BR /&gt;MPRINT(DEMO): set demo(in=a) demo(in=b) demo(where=(HR='positive' and her2='negative') in=c) demo(where=(HR='positive' and&lt;BR /&gt;her2='positive') in=d) demo(where=(HR='negative' and her2='negative') in=e) demo(where=(HR='negative' and her2='positive') in=f) ;&lt;BR /&gt;ERROR: File WORK.DEMO.DATA does not exist.&lt;BR /&gt;ERROR: File WORK.DEMO.DATA does not exist.&lt;BR /&gt;ERROR: File WORK.DEMO.DATA does not exist.&lt;BR /&gt;ERROR: File WORK.DEMO.DATA does not exist.&lt;BR /&gt;ERROR: File WORK.DEMO.DATA does not exist.&lt;BR /&gt;ERROR: File WORK.DEMO.DATA does not exist.&lt;BR /&gt;MPRINT(DEMO): if a then cohort = 'overall';&lt;BR /&gt;MPRINT(DEMO): if b then cohort = put(treat, 1.);&lt;BR /&gt;MPRINT(DEMO): if c then cohort = 'subtypeA';&lt;BR /&gt;MPRINT(DEMO): if d then cohort = 'subtypeB';&lt;BR /&gt;MPRINT(DEMO): if e then cohort = 'subtypeC';&lt;BR /&gt;MPRINT(DEMO): if f then cohort = 'subtypeD';&lt;BR /&gt;MPRINT(DEMO): run;&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.DEMOG may be incomplete. When this step was stopped there were 0 observations and 2 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;MLOGIC(DEMO): Ending execution.&lt;BR /&gt;68&lt;BR /&gt;69&lt;BR /&gt;70 %demo( linenumber= 0 ,indsn=ads.ads , agevar = MetDiagnosisDate, outdsn = demog0 ) ;&lt;BR /&gt;MLOGIC(DEMO): Beginning execution.&lt;BR /&gt;MLOGIC(DEMO): Parameter LINENUMBER has value 0&lt;BR /&gt;MLOGIC(DEMO): Parameter INDSN has value ads.ads&lt;BR /&gt;MLOGIC(DEMO): Parameter AGEVAR has value MetDiagnosisDate&lt;BR /&gt;MLOGIC(DEMO): Parameter OUTDSN has value demog0&lt;BR /&gt;MLOGIC(DEMO): %IF condition &amp;amp;linenumber. = 0 is TRUE&lt;BR /&gt;MPRINT(DEMO): data demo;&lt;BR /&gt;MPRINT(DEMO): set ads.ads;&lt;BR /&gt;MPRINT(DEMO): yearmet = year(MetDiagnosisDate);&lt;BR /&gt;MPRINT(DEMO): age = year(MetDiagnosisDate) - birthyear;&lt;BR /&gt;MPRINT(DEMO): run;&lt;/P&gt;&lt;P&gt;3 The SAS System&lt;/P&gt;&lt;P&gt;NOTE: There were 9841 observations read from the data set ADS.ADS.&lt;BR /&gt;NOTE: The data set WORK.DEMO has 9841 observations and 46 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.02 seconds&lt;BR /&gt;cpu time 0.02 seconds&lt;/P&gt;&lt;P&gt;MLOGIC(DEMO): %LET (variable name is VAR)&lt;BR /&gt;MLOGIC(DEMO): %IF condition &amp;amp;linenumber. = 1 is FALSE&lt;BR /&gt;MPRINT(DEMO): data demog;&lt;BR /&gt;MPRINT(DEMO): length cohort $30;&lt;BR /&gt;MPRINT(DEMO): set demo(in=a) demo(in=b) demo(where=(HR='positive' and her2='negative') in=c) demo(where=(HR='positive' and&lt;BR /&gt;her2='positive') in=d) demo(where=(HR='negative' and her2='negative') in=e) demo(where=(HR='negative' and her2='positive') in=f) ;&lt;BR /&gt;MPRINT(DEMO): if a then cohort = 'overall';&lt;BR /&gt;MPRINT(DEMO): if b then cohort = put(treat, 1.);&lt;BR /&gt;MPRINT(DEMO): if c then cohort = 'subtypeA';&lt;BR /&gt;MPRINT(DEMO): if d then cohort = 'subtypeB';&lt;BR /&gt;MPRINT(DEMO): if e then cohort = 'subtypeC';&lt;BR /&gt;MPRINT(DEMO): if f then cohort = 'subtypeD';&lt;BR /&gt;MPRINT(DEMO): run;&lt;/P&gt;&lt;P&gt;NOTE: There were 9841 observations read from the data set WORK.DEMO.&lt;BR /&gt;NOTE: There were 9841 observations read from the data set WORK.DEMO.&lt;BR /&gt;NOTE: There were 5467 observations read from the data set WORK.DEMO.&lt;BR /&gt;WHERE (HR='positive') and (her2='negative');&lt;BR /&gt;NOTE: There were 458 observations read from the data set WORK.DEMO.&lt;BR /&gt;WHERE (HR='positive') and (her2='positive');&lt;BR /&gt;NOTE: There were 1775 observations read from the data set WORK.DEMO.&lt;BR /&gt;WHERE (HR='negative') and (her2='negative');&lt;BR /&gt;NOTE: There were 354 observations read from the data set WORK.DEMO.&lt;BR /&gt;WHERE (HR='negative') and (her2='positive');&lt;BR /&gt;NOTE: The data set WORK.DEMOG has 27736 observations and 47 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.05 seconds&lt;BR /&gt;cpu time 0.05 seconds&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 20:24:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487183#M126912</guid>
      <dc:creator>Ivy</dc:creator>
      <dc:date>2018-08-15T20:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable Parameter Not Recognized</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487187#M126914</link>
      <description>Do these data sets exist? SAS doesn't think so. Are you perhaps running things on a server, but having data locally as well on the server? &lt;BR /&gt;&lt;BR /&gt;ERROR: File WORK.DEMO.DATA does not exist.&lt;BR /&gt;ERROR: File WORK.DEMO.DATA does not exist.&lt;BR /&gt;ERROR: File WORK.DEMO.DATA does not exist.&lt;BR /&gt;ERROR: File WORK.DEMO.DATA does not exist.&lt;BR /&gt;ERROR: File WORK.DEMO.DATA does not exist.&lt;BR /&gt;ERROR: File WORK.DEMO.DATA does not exist.</description>
      <pubDate>Wed, 15 Aug 2018 20:27:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487187#M126914</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-15T20:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable Parameter Not Recognized</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487188#M126915</link>
      <description>Just a note this is likely an issue with the indsn, your input data set.</description>
      <pubDate>Wed, 15 Aug 2018 20:27:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487188#M126915</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-15T20:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable Parameter Not Recognized</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487191#M126916</link>
      <description>&lt;P&gt;The program skip %if condition to run the next data statement which is based on the data created from %if statement, so it is empty since the %if statement has not run yet.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 20:34:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487191#M126916</guid>
      <dc:creator>Ivy</dc:creator>
      <dc:date>2018-08-15T20:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable Parameter Not Recognized</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487194#M126919</link>
      <description>&lt;P&gt;If the only difference between those two lines is WEIGHT, why not just add that to the weight variable rather than add conditional logic.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure what's wrong and can't run it without data. I would restart your SAS session to ensure you don't have any issues hanging around from previous errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 20:42:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487194#M126919</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-15T20:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable Parameter Not Recognized</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487211#M126922</link>
      <description>&lt;P&gt;When you call the macro with this command:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%demo;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;amp;LINENUMBER has a null value.&amp;nbsp; It's not 0.&amp;nbsp; It's not 1.&amp;nbsp; So both %IF comparisons are false, and your data set just doesn't get created.&amp;nbsp; No wonder it doesn't exist when you try to read it next.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just use a call to the macro (as you have done several times) that supplies a value for &amp;amp;LINENUMBER.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 21:27:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487211#M126922</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-08-15T21:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable Parameter Not Recognized</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487467#M127030</link>
      <description>Thank you ! My mistake. Thanks!</description>
      <pubDate>Thu, 16 Aug 2018 15:05:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-Parameter-Not-Recognized/m-p/487467#M127030</guid>
      <dc:creator>Ivy</dc:creator>
      <dc:date>2018-08-16T15:05:26Z</dc:date>
    </item>
  </channel>
</rss>

