<?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 Write a result with multiple macro variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Write-a-result-with-multiple-macro-variables/m-p/911642#M359470</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Let Reporting_Period = %sysfunc(Today());

%Macro REPMTH(Day=&amp;amp;Reporting_Period);
	%IF &amp;amp;day = %sysfunc(Intnx(Month,&amp;amp;Day,0,b)) %THEN %DO;
		%sysfunc(Intnx(Month,&amp;amp;Day,-2,s),MMYYN4.);
	%END;
	%ELSE %DO;
		%sysfunc(Intnx(Month,&amp;amp;Day,-1,s),MMYYN4.);
	%END;
%Mend;

%LET Today = %sysfunc(putn(&amp;amp;Reporting_Period,ddmmyyn2.));


%Macro MonthlyFile(date=&amp;amp;Today);
	%IF &amp;amp;date &amp;lt; 3 %THEN %DO;
		T
	%END;
	%IF &amp;amp;date &amp;lt; 7 %THEN %DO;
	%END;
	%IF &amp;amp;date &amp;lt; 9 %THEN %DO;
		A
	%END;
	%IF &amp;amp;date &amp;lt; 32 %THEN %DO;
		F
	%END;
%Mend;

%put NOTE: &amp;amp;reporting_period;
%put NOTE: %sysfunc(putn(&amp;amp;reporting_period,ddmmyy10.));
%put NOTE: &amp;amp;today;

%put NOTE:  %Repmth();
%put NOTE:  %monthlyfile();

&lt;FONT color="#0000FF"&gt;%put NOTE:  %Repmth()%monthlyfile();&lt;/FONT&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hi guys,&lt;/P&gt;
&lt;P&gt;Need help on my last part, why i cant write a result of &lt;FONT color="#0000FF"&gt;1223F&lt;/FONT&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I got an error says :&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;Statement is not valid or it is used out of proper order&lt;/FONT&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jan 2024 14:09:53 GMT</pubDate>
    <dc:creator>ChrisWoo</dc:creator>
    <dc:date>2024-01-16T14:09:53Z</dc:date>
    <item>
      <title>Write a result with multiple macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Write-a-result-with-multiple-macro-variables/m-p/911642#M359470</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Let Reporting_Period = %sysfunc(Today());

%Macro REPMTH(Day=&amp;amp;Reporting_Period);
	%IF &amp;amp;day = %sysfunc(Intnx(Month,&amp;amp;Day,0,b)) %THEN %DO;
		%sysfunc(Intnx(Month,&amp;amp;Day,-2,s),MMYYN4.);
	%END;
	%ELSE %DO;
		%sysfunc(Intnx(Month,&amp;amp;Day,-1,s),MMYYN4.);
	%END;
%Mend;

%LET Today = %sysfunc(putn(&amp;amp;Reporting_Period,ddmmyyn2.));


%Macro MonthlyFile(date=&amp;amp;Today);
	%IF &amp;amp;date &amp;lt; 3 %THEN %DO;
		T
	%END;
	%IF &amp;amp;date &amp;lt; 7 %THEN %DO;
	%END;
	%IF &amp;amp;date &amp;lt; 9 %THEN %DO;
		A
	%END;
	%IF &amp;amp;date &amp;lt; 32 %THEN %DO;
		F
	%END;
%Mend;

%put NOTE: &amp;amp;reporting_period;
%put NOTE: %sysfunc(putn(&amp;amp;reporting_period,ddmmyy10.));
%put NOTE: &amp;amp;today;

%put NOTE:  %Repmth();
%put NOTE:  %monthlyfile();

&lt;FONT color="#0000FF"&gt;%put NOTE:  %Repmth()%monthlyfile();&lt;/FONT&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hi guys,&lt;/P&gt;
&lt;P&gt;Need help on my last part, why i cant write a result of &lt;FONT color="#0000FF"&gt;1223F&lt;/FONT&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I got an error says :&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;Statement is not valid or it is used out of proper order&lt;/FONT&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 14:09:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Write-a-result-with-multiple-macro-variables/m-p/911642#M359470</guid>
      <dc:creator>ChrisWoo</dc:creator>
      <dc:date>2024-01-16T14:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Write a result with multiple macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Write-a-result-with-multiple-macro-variables/m-p/911647#M359471</link>
      <description>&lt;P&gt;Your first macro is emitting a semicolon.&lt;/P&gt;
&lt;P&gt;If does not impact your first usages since running code like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put xxx;;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Just results in an extra empty statement.&lt;/P&gt;
&lt;P&gt;But running code like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put 1233;F;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Is invalid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS If you want the day of the month just use the DAY() function.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%LET Today = %sysfunc(day(&amp;amp;Reporting_Period),z2.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Jan 2024 14:39:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Write-a-result-with-multiple-macro-variables/m-p/911647#M359471</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-01-16T14:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Write a result with multiple macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Write-a-result-with-multiple-macro-variables/m-p/911648#M359472</link>
      <description>Ahh, i got it now, all i want just a text and that semi colon is unnecessary.</description>
      <pubDate>Tue, 16 Jan 2024 14:49:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Write-a-result-with-multiple-macro-variables/m-p/911648#M359472</guid>
      <dc:creator>ChrisWoo</dc:creator>
      <dc:date>2024-01-16T14:49:29Z</dc:date>
    </item>
  </channel>
</rss>

