<?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 MACRO variable resolving to null in batch mode and resolving to value in SAS eg in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/MACRO-variable-resolving-to-null-in-batch-mode-and-resolving-to/m-p/385064#M277121</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im trying to &amp;nbsp;resolve a value of start_date which has a value of date value as&amp;nbsp;&amp;nbsp;numeric (21032). im trying to resolve to see what date value it has , when i run &lt;SPAN&gt;&lt;FONT color="#FF6600"&gt;%put end_date: %sysfunc(inputn(&amp;amp;end_date.,worddate18.),date9.);&lt;/FONT&gt;&amp;nbsp;&lt;/SPAN&gt;it in sas eg it is resolving to something like 28jun2017, but when i execute same code in batch mode it is resolving to null(.) see below. any idea ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;SYMBOLGEN: Macro variable START_DATE resolves to 21032&lt;BR /&gt;SYMBOLGEN: Macro variable END_DATE resolves to 21032&lt;BR /&gt;537&lt;BR /&gt;538 %put &amp;amp;start_date &amp;amp;end_date;&lt;BR /&gt;21032 21032&lt;BR /&gt;539&lt;BR /&gt;540 %put start_date: %sysfunc(inputn(&amp;amp;start_date.,worddate18.),date9.);&lt;BR /&gt;SYMBOLGEN: Macro variable START_DATE resolves to 21032&lt;BR /&gt;WARNING: Argument 2 to function INPUTN referenced by the %SYSFUNC or %QSYSFUNC macro function is out of range.&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;NOTE: Mathematical operations could not be performed during %SYSFUNC function execution. The result of the operations have been set&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;to a missing value.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;start_date: .&lt;/FONT&gt;&lt;BR /&gt;541 %put end_date: %sysfunc(inputn(&amp;amp;end_date.,worddate18.),date9.);&lt;BR /&gt;SYMBOLGEN: Macro variable END_DATE resolves to 21032&lt;BR /&gt;WARNING: Argument 2 to function INPUTN referenced by the %SYSFUNC or %QSYSFUNC macro function is out of range.&lt;BR /&gt;NOTE: Mathematical operations could not be performed during %SYSFUNC function execution. The result of the operations have been set&lt;BR /&gt;to a missing value.&lt;BR /&gt;end_date: .&lt;/P&gt;</description>
    <pubDate>Wed, 02 Aug 2017 18:11:59 GMT</pubDate>
    <dc:creator>Deepti44</dc:creator>
    <dc:date>2017-08-02T18:11:59Z</dc:date>
    <item>
      <title>MACRO variable resolving to null in batch mode and resolving to value in SAS eg</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MACRO-variable-resolving-to-null-in-batch-mode-and-resolving-to/m-p/385064#M277121</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im trying to &amp;nbsp;resolve a value of start_date which has a value of date value as&amp;nbsp;&amp;nbsp;numeric (21032). im trying to resolve to see what date value it has , when i run &lt;SPAN&gt;&lt;FONT color="#FF6600"&gt;%put end_date: %sysfunc(inputn(&amp;amp;end_date.,worddate18.),date9.);&lt;/FONT&gt;&amp;nbsp;&lt;/SPAN&gt;it in sas eg it is resolving to something like 28jun2017, but when i execute same code in batch mode it is resolving to null(.) see below. any idea ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;SYMBOLGEN: Macro variable START_DATE resolves to 21032&lt;BR /&gt;SYMBOLGEN: Macro variable END_DATE resolves to 21032&lt;BR /&gt;537&lt;BR /&gt;538 %put &amp;amp;start_date &amp;amp;end_date;&lt;BR /&gt;21032 21032&lt;BR /&gt;539&lt;BR /&gt;540 %put start_date: %sysfunc(inputn(&amp;amp;start_date.,worddate18.),date9.);&lt;BR /&gt;SYMBOLGEN: Macro variable START_DATE resolves to 21032&lt;BR /&gt;WARNING: Argument 2 to function INPUTN referenced by the %SYSFUNC or %QSYSFUNC macro function is out of range.&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;NOTE: Mathematical operations could not be performed during %SYSFUNC function execution. The result of the operations have been set&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;to a missing value.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;start_date: .&lt;/FONT&gt;&lt;BR /&gt;541 %put end_date: %sysfunc(inputn(&amp;amp;end_date.,worddate18.),date9.);&lt;BR /&gt;SYMBOLGEN: Macro variable END_DATE resolves to 21032&lt;BR /&gt;WARNING: Argument 2 to function INPUTN referenced by the %SYSFUNC or %QSYSFUNC macro function is out of range.&lt;BR /&gt;NOTE: Mathematical operations could not be performed during %SYSFUNC function execution. The result of the operations have been set&lt;BR /&gt;to a missing value.&lt;BR /&gt;end_date: .&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 18:11:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MACRO-variable-resolving-to-null-in-batch-mode-and-resolving-to/m-p/385064#M277121</guid>
      <dc:creator>Deepti44</dc:creator>
      <dc:date>2017-08-02T18:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO variable resolving to null in batch mode and resolving to value in SAS eg</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MACRO-variable-resolving-to-null-in-batch-mode-and-resolving-to/m-p/385068#M277122</link>
      <description>&lt;P&gt;What does the code submitted via batch look like?&lt;/P&gt;
&lt;P&gt;I think running in batch, is the equivalent of running in a 'clean session' so nothing you previously created is accessible if it's not store permanently somewhere, and macro variables are not kept across sessions.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 18:23:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MACRO-variable-resolving-to-null-in-batch-mode-and-resolving-to/m-p/385068#M277122</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-02T18:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO variable resolving to null in batch mode and resolving to value in SAS eg</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MACRO-variable-resolving-to-null-in-batch-mode-and-resolving-to/m-p/385071#M277123</link>
      <description>&lt;P&gt;reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;same code below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL INOBS=10;&lt;BR /&gt;CREATE TABLE m1 AS&lt;BR /&gt;SELECT A.*,input(substr(ver_desc,18,10),mmddyy10.) as date1 FROM table1&amp;nbsp;&amp;nbsp;A&lt;BR /&gt;WHERE VER=0;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select date1 into :start_date from m1 ;&lt;BR /&gt;select date1 into :end_date from m1 ;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;%put &amp;amp;start_date &amp;amp;end_date;&lt;/P&gt;&lt;P&gt;%put start_date: %sysfunc(inputn(&amp;amp;start_date.,worddate18.),date9.);&lt;BR /&gt;%put end_date: %sysfunc(inputn(&amp;amp;end_date.,worddate18.),date9.);&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 18:26:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MACRO-variable-resolving-to-null-in-batch-mode-and-resolving-to/m-p/385071#M277123</guid>
      <dc:creator>Deepti44</dc:creator>
      <dc:date>2017-08-02T18:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO variable resolving to null in batch mode and resolving to value in SAS eg</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MACRO-variable-resolving-to-null-in-batch-mode-and-resolving-to/m-p/385072#M277124</link>
      <description>&lt;P&gt;Hi, is inputn necessary to read a number which is not a formtted date value/character value? Or am i missing something&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%put %sysfunc(putn(21033,date9.));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am wondering how can a &lt;SPAN&gt;worddate18. informat be used to read 21033&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 18:30:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MACRO-variable-resolving-to-null-in-batch-mode-and-resolving-to/m-p/385072#M277124</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-08-02T18:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO variable resolving to null in batch mode and resolving to value in SAS eg</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MACRO-variable-resolving-to-null-in-batch-mode-and-resolving-to/m-p/385074#M277125</link>
      <description>&lt;P&gt;My guess is that when you're running in batch mode you haven't created table1 in your work directory.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 18:32:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MACRO-variable-resolving-to-null-in-batch-mode-and-resolving-to/m-p/385074#M277125</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-08-02T18:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO variable resolving to null in batch mode and resolving to value in SAS eg</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MACRO-variable-resolving-to-null-in-batch-mode-and-resolving-to/m-p/385076#M277126</link>
      <description>&lt;P&gt;INFORMAT represents the data the format is already in and you want to read it in.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FORMAT is how you want to display the information.&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/138205"&gt;@novinosrin&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi, is inputn necessary to read a number which is not a formtted date value/character value? Or am i missing something&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%put %sysfunc(putn(21033,date9.));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am wondering how can a &lt;SPAN&gt;worddate18. informat be used to read 21033&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 18:44:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MACRO-variable-resolving-to-null-in-batch-mode-and-resolving-to/m-p/385076#M277126</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-02T18:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO variable resolving to null in batch mode and resolving to value in SAS eg</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MACRO-variable-resolving-to-null-in-batch-mode-and-resolving-to/m-p/385078#M277127</link>
      <description>&lt;P&gt;Yep, Thats what my understanding is too and that also raised my eyebrows failing to comprehend OP's put statements-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let start_date=20133;/*i am testing*/&lt;/P&gt;&lt;P&gt;%let&amp;nbsp;&lt;SPAN&gt;end_date=20133&amp;nbsp;/*i am testing*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*OP's put statement*/&lt;BR /&gt;%put start_date: %sysfunc(inputn(&amp;amp;start_date.,worddate18.),date9.);&lt;BR /&gt;%put end_date: %sysfunc(inputn(&amp;amp;end_date.,worddate18.),date9.);&lt;/P&gt;&lt;P&gt;/*my log*/&lt;/P&gt;&lt;P&gt;WARNING: Argument 2 to function INPUTN referenced by the %SYSFUNC or %QSYSFUNC macro function is&lt;BR /&gt;out of range.&lt;BR /&gt;NOTE: Mathematical operations could not be performed during %SYSFUNC function execution. The&lt;BR /&gt;result of the operations have been set to a missing value.&lt;BR /&gt;start_date: .&lt;BR /&gt;4 %put end_date: %sysfunc(inputn(&amp;amp;end_date.,worddate18.),date9.);&lt;BR /&gt;WARNING: Argument 2 to function INPUTN referenced by the %SYSFUNC or %QSYSFUNC macro function is&lt;BR /&gt;out of range.&lt;BR /&gt;NOTE: Mathematical operations could not be performed during %SYSFUNC function execution. The&lt;BR /&gt;result of the operations have been set to a missing value.&lt;BR /&gt;end_date: .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the correct put statement should be -&lt;/P&gt;&lt;P&gt;%put %sysfunc(putn(&amp;amp;start_date.,worddate18.));&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%put %sysfunc(putn(&amp;amp;end_date.,worddate18.));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 18:54:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MACRO-variable-resolving-to-null-in-batch-mode-and-resolving-to/m-p/385078#M277127</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-08-02T18:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO variable resolving to null in batch mode and resolving to value in SAS eg</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MACRO-variable-resolving-to-null-in-batch-mode-and-resolving-to/m-p/385153#M277128</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but only my question is when i run below statement in sas eg it is displaying date9 something like "28jun2017" ? not sure y.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%put start_date: %sysfunc(inputn(&amp;amp;start_date.,worddate18.),date9.);&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 00:18:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MACRO-variable-resolving-to-null-in-batch-mode-and-resolving-to/m-p/385153#M277128</guid>
      <dc:creator>Deepti44</dc:creator>
      <dc:date>2017-08-03T00:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO variable resolving to null in batch mode and resolving to value in SAS eg</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MACRO-variable-resolving-to-null-in-batch-mode-and-resolving-to/m-p/385479#M277129</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/134796"&gt;@Deepti44&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but only my question is when i run below statement in sas eg it is displaying date9 something like "28jun2017" ? not sure y.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;%put start_date: %sysfunc(inputn(&amp;amp;start_date.,worddate18.),date9.);&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please show the value you are using for &amp;amp;start_date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I would expect that to generate an error as WORDATE. is &lt;STRONG&gt;not&lt;/STRONG&gt; an informat that can be used with input&lt;/P&gt;
&lt;PRE&gt;11   data junk;
12      y=input('January 1, 2017', Worddate18.);
                                   -----------
                                   485
NOTE 485-185: Informat WORDDATE was not found or could not be loaded.

13   run;
&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Aug 2017 20:21:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MACRO-variable-resolving-to-null-in-batch-mode-and-resolving-to/m-p/385479#M277129</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-03T20:21:17Z</dc:date>
    </item>
  </channel>
</rss>

