<?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: Problem with inserting DATE from a MACRO variable (Part II) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-inserting-DATE-from-a-MACRO-variable-Part-II/m-p/852630#M337023</link>
    <description>&lt;P&gt;I second&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;'s request for an explanation of what you are trying to do.&amp;nbsp; &amp;nbsp;As it stands, I don't have any idea.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the code presented has the earmarks of a hammer looking for a nail.&amp;nbsp; You might be offered a simpler alternative if we had a clearer idea of the objective.&lt;/P&gt;</description>
    <pubDate>Sat, 07 Jan 2023 04:55:07 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2023-01-07T04:55:07Z</dc:date>
    <item>
      <title>Problem with inserting DATE from a MACRO variable (Part II)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-inserting-DATE-from-a-MACRO-variable-Part-II/m-p/852061#M336817</link>
      <description>&lt;P&gt;Sorry for posting my question again but the previous post does not let me to reply to the comments:&lt;/P&gt;&lt;P&gt;Here is my code and error that I get:&lt;/P&gt;&lt;P&gt;Thanks for your help. Please see the entire code and log below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;%LET DAYS= %EVAL( %SYSFUNC(INTNX(QTR,'01JAN2022'D, (&amp;amp;LOOP-1), E))-%SYSFUNC(INTNX(QTR,'01JAN2022'D, (&amp;amp;LOOP-1), B)) + 1);&lt;BR /&gt;%LET QUARTER_DAY_START = %SYSFUNC(DEQUOTE(" '%SYSFUNC(INTNX(MONTH, '01JAN2022'D, (&amp;amp;LOOP-1)*3, B), DATE11.)' "));&lt;BR /&gt;%LET QUARTER_DAY_END = %SYSFUNC(DEQUOTE(" '%SYSFUNC(INTNX(MONTH, '01JAN2022'D, ((&amp;amp;LOOP-1)*3)+ 2, E), DATE11.)' "));&lt;BR /&gt;%LET QUARTER_START_DATE = %SYSFUNC(INTNX(QTR,'01JAN2022'D,0,B));&lt;BR /&gt;%LET QUARTER_END_DATE = %SYSFUNC(INTNX(QTR,'01JAN2022'D,0,E));&lt;BR /&gt;%PUT &amp;amp;=DAYS;&lt;BR /&gt;%PUT &amp;amp;=QUARTER_DAY_START;&lt;BR /&gt;%PUT &amp;amp;=QUARTER_DAY_END;&lt;/P&gt;&lt;P&gt;DATA MY_NEW_TABLE;&lt;BR /&gt;SET WORK.MY_OLD_TABLE;&lt;BR /&gt;date = intnx('qtr','01jan2022'd,qtr-1,'b') to intnx('qtr','01jan2022'd,qtr-1,'e');&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Log:&lt;/P&gt;&lt;P&gt;1 The SAS System 06:13 Tuesday, December 13, 2022&lt;/P&gt;&lt;P&gt;1 ;*';*";*/;quit;run;&lt;BR /&gt;2 OPTIONS PAGENO=MIN;&lt;BR /&gt;3 %LET _CLIENTTASKLABEL='Program 3';&lt;BR /&gt;4 %LET _CLIENTPROCESSFLOWNAME='Standalone Not In Project';&lt;BR /&gt;5 %LET _CLIENTPROJECTPATH='';&lt;BR /&gt;6 %LET _CLIENTPROJECTPATHHOST='';&lt;BR /&gt;7 %LET _CLIENTPROJECTNAME='';&lt;BR /&gt;8 %LET _SASPROGRAMFILE='';&lt;BR /&gt;9 %LET _SASPROGRAMFILEHOST='';&lt;BR /&gt;10&lt;BR /&gt;11 ODS _ALL_ CLOSE;&lt;BR /&gt;12 OPTIONS DEV=SVG;&lt;BR /&gt;13 GOPTIONS XPIXELS=0 YPIXELS=0;&lt;BR /&gt;14 %macro HTML5AccessibleGraphSupported;&lt;BR /&gt;15 %if %_SAS_VERCOMP_FV(9,4,4, 0,0,0) &amp;gt;= 0 %then ACCESSIBLE_GRAPH;&lt;BR /&gt;16 %mend;&lt;BR /&gt;17 FILENAME EGHTML TEMP;&lt;BR /&gt;18 ODS HTML5(ID=EGHTML) FILE=EGHTML&lt;BR /&gt;19 OPTIONS(BITMAP_MODE='INLINE')&lt;BR /&gt;20 %HTML5AccessibleGraphSupported&lt;BR /&gt;MPRINT(HTML5ACCESSIBLEGRAPHSUPPORTED): ACCESSIBLE_GRAPH&lt;BR /&gt;21 ENCODING='utf-8'&lt;BR /&gt;22 STYLE=HtmlBlue&lt;BR /&gt;23 NOGTITLE&lt;BR /&gt;24 NOGFOOTNOTE&lt;BR /&gt;25 GPATH=&amp;amp;sasworklocation&lt;BR /&gt;26 ;&lt;BR /&gt;NOTE: Writing HTML5(EGHTML) Body file: EGHTML&lt;BR /&gt;27&lt;BR /&gt;28 %LET DAYS= %EVAL( %SYSFUNC(INTNX(QTR,'01JAN2022'D, (&amp;amp;LOOP-1), E))-%SYSFUNC(INTNX(QTR,'01JAN2022'D, (&amp;amp;LOOP-1), B)) + 1)&lt;BR /&gt;28 ! ;&lt;BR /&gt;29 %LET QUARTER_DAY_START = %SYSFUNC(DEQUOTE(" '%SYSFUNC(INTNX(MONTH, '01JAN2022'D, (&amp;amp;LOOP-1)*3, B), DATE11.)' "));&lt;BR /&gt;30 %LET QUARTER_DAY_END = %SYSFUNC(DEQUOTE(" '%SYSFUNC(INTNX(MONTH, '01JAN2022'D, ((&amp;amp;LOOP-1)*3)+ 2, E), DATE11.)' "));&lt;BR /&gt;31 %LET QUARTER_START_DATE = %SYSFUNC(INTNX(QTR,'01JAN2022'D,0,B));&lt;BR /&gt;32 %LET QUARTER_END_DATE = %SYSFUNC(INTNX(QTR,'01JAN2022'D,0,E));&lt;BR /&gt;33 %PUT &amp;amp;=DAYS;&lt;BR /&gt;DAYS=90&lt;BR /&gt;34 %PUT &amp;amp;=QUARTER_DAY_START;&lt;BR /&gt;QUARTER_DAY_START='01-JAN-2022'&lt;BR /&gt;35 %PUT &amp;amp;=QUARTER_DAY_END;&lt;BR /&gt;QUARTER_DAY_END='31-MAR-2022'&lt;BR /&gt;36&lt;BR /&gt;37&lt;BR /&gt;37 ! DATA MY_NEW_TABLE;&lt;BR /&gt;38 SET WORK.MY_OLD_TABLE ;&lt;BR /&gt;39 date = intnx('qtr','01jan2022'd,qtr-1,'b') to intnx('qtr','01jan2022'd,qtr-1,'e');&lt;BR /&gt;__&lt;BR /&gt;22&lt;BR /&gt;202&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, *, **, +, -, /, ;, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;&amp;lt;, &amp;gt;=, AND, EQ, GE, GT,&lt;BR /&gt;IN, LE, LT, MAX, MIN, NE, NG, NL, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=.&lt;/P&gt;&lt;P&gt;ERROR 202-322: The option or parameter is not recognized and will be ignored.&lt;/P&gt;&lt;P&gt;40 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.MY_NEW_TABLE may be incomplete. When this step was stopped there were 0 observations and 5 variables.&lt;BR /&gt;2 The SAS System 06:13 Tuesday, December 13, 2022&lt;/P&gt;&lt;P&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;41&lt;BR /&gt;42 %LET _CLIENTTASKLABEL=;&lt;BR /&gt;43 %LET _CLIENTPROCESSFLOWNAME=;&lt;BR /&gt;44 %LET _CLIENTPROJECTPATH=;&lt;BR /&gt;45 %LET _CLIENTPROJECTPATHHOST=;&lt;BR /&gt;46 %LET _CLIENTPROJECTNAME=;&lt;BR /&gt;47 %LET _SASPROGRAMFILE=;&lt;BR /&gt;48 %LET _SASPROGRAMFILEHOST=;&lt;BR /&gt;49&lt;BR /&gt;50 ;*';*";*/;quit;run;&lt;BR /&gt;51 ODS _ALL_ CLOSE;&lt;BR /&gt;52&lt;BR /&gt;53&lt;BR /&gt;54 QUIT; RUN;&lt;BR /&gt;55&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 01:01:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-inserting-DATE-from-a-MACRO-variable-Part-II/m-p/852061#M336817</guid>
      <dc:creator>Emoji</dc:creator>
      <dc:date>2023-01-04T01:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with inserting DATE from a MACRO variable (Part II)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-inserting-DATE-from-a-MACRO-variable-Part-II/m-p/852551#M337002</link>
      <description>&lt;P&gt;&lt;SPAN&gt;What are you trying to do with this statement because the 'TO' is not valid here: &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; date = intnx('qtr','01jan2022'd,qtr-1,'b') to intnx('qtr','01jan2022'd,qtr-1,'e');&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With separate assignment statements it works:&lt;BR /&gt;&amp;nbsp; date1 = intnx('qtr','01jan2022'd,qtr-1,'b'); &lt;BR /&gt;&amp;nbsp; date2= intnx('qtr','01jan2022'd,qtr-1,'e'); &lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 20:13:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-inserting-DATE-from-a-MACRO-variable-Part-II/m-p/852551#M337002</guid>
      <dc:creator>russt_sas</dc:creator>
      <dc:date>2023-01-06T20:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with inserting DATE from a MACRO variable (Part II)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-inserting-DATE-from-a-MACRO-variable-Part-II/m-p/852553#M337003</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%LET DAYS= %EVAL( %SYSFUNC(INTNX(QTR,'01JAN2022'D, (&amp;amp;LOOP-1), E))-%SYSFUNC(INTNX(QTR,'01JAN2022'D, (&amp;amp;LOOP-1), B)) + 1);
%LET QUARTER_DAY_START = %SYSFUNC(DEQUOTE(" '%SYSFUNC(INTNX(MONTH, '01JAN2022'D, (&amp;amp;LOOP-1)*3, B), DATE11.)' "));
%LET QUARTER_DAY_END = %SYSFUNC(DEQUOTE(" '%SYSFUNC(INTNX(MONTH, '01JAN2022'D, ((&amp;amp;LOOP-1)*3)+ 2, E), DATE11.)' "));
%LET QUARTER_START_DATE = %SYSFUNC(INTNX(QTR,'01JAN2022'D,0,B));
%LET QUARTER_END_DATE = %SYSFUNC(INTNX(QTR,'01JAN2022'D,0,E));
%PUT &amp;amp;=DAYS;
%PUT &amp;amp;=QUARTER_DAY_START;
%PUT &amp;amp;=QUARTER_DAY_END;

DATA MY_NEW_TABLE;
SET WORK.MY_OLD_TABLE;

do date = intnx('qtr','01jan2022'd,qtr-1,'b') to intnx('qtr','01jan2022'd,qtr-1,'e');
    output;
end;

RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Jan 2023 20:30:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-inserting-DATE-from-a-MACRO-variable-Part-II/m-p/852553#M337003</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-01-06T20:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with inserting DATE from a MACRO variable (Part II)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-inserting-DATE-from-a-MACRO-variable-Part-II/m-p/852563#M337004</link>
      <description>&lt;P&gt;Is this code giving you an error?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;DATA MY_NEW_TABLE;
SET WORK.MY_OLD_TABLE;

do date = intnx('qtr','01jan2022'd,qtr-1,'b') to intnx('qtr','01jan2022'd,qtr-1,'e');
    output;
end;

RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Jan 2023 20:39:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-inserting-DATE-from-a-MACRO-variable-Part-II/m-p/852563#M337004</guid>
      <dc:creator>russt_sas</dc:creator>
      <dc:date>2023-01-06T20:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with inserting DATE from a MACRO variable (Part II)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-inserting-DATE-from-a-MACRO-variable-Part-II/m-p/852569#M337006</link>
      <description>&lt;P&gt;You still haven't explained what you are trying to do, as several people requested in the last thread.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please explain what you are trying to do. I get the feeling you are going about this in a very difficult way, when simpler code would work, but since I don't know what you are trying to do, I cannot help at this point in time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, several people in the earlier thread have pointed out that this is not valid SAS syntax&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;date = intnx('qtr','01jan2022'd,qtr-1,'b') to intnx('qtr','01jan2022'd,qtr-1,'e');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and they also pointed out that you &lt;FONT color="#FF0000"&gt;might&lt;/FONT&gt; want the statement to begin with a DO&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;do date = intnx('qtr','01jan2022'd,qtr-1,'b') to intnx('qtr','01jan2022'd,qtr-1,'e');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;although maybe that's not what you want, and again if you explained what you are trying to do, we could be more definitive in our advice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Its almost as if we are talking and you're not listening.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 21:13:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-inserting-DATE-from-a-MACRO-variable-Part-II/m-p/852569#M337006</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-01-06T21:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with inserting DATE from a MACRO variable (Part II)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-inserting-DATE-from-a-MACRO-variable-Part-II/m-p/852630#M337023</link>
      <description>&lt;P&gt;I second&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;'s request for an explanation of what you are trying to do.&amp;nbsp; &amp;nbsp;As it stands, I don't have any idea.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the code presented has the earmarks of a hammer looking for a nail.&amp;nbsp; You might be offered a simpler alternative if we had a clearer idea of the objective.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2023 04:55:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-inserting-DATE-from-a-MACRO-variable-Part-II/m-p/852630#M337023</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2023-01-07T04:55:07Z</dc:date>
    </item>
  </channel>
</rss>

