<?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 variable names when batching SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-variable-names-when-batching-SAS/m-p/130248#M26576</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey I've come back to this old post to mark it as answered. I've had one hell of a busy month at work and only just got back around to this problem. Just wanted to make sure it's correctly marked as answered because Tom was right, when I looked at the initialisation it was showing that there was an issue resolving my user name and password. This in turn had a knock on effect where it ignored other variables in the code. Once I resolved my login and initialisation to SAS the batch ran perfectly fine as it did for Doc. Thanks again guys&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p.s. can't see the option to mark as answered this time, is this because it's an old post? I hope I can still give people points for it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Apr 2013 15:18:18 GMT</pubDate>
    <dc:creator>Thoney</dc:creator>
    <dc:date>2013-04-18T15:18:18Z</dc:date>
    <item>
      <title>Problem with variable names when batching SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-variable-names-when-batching-SAS/m-p/130244#M26572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been developing quite well on SAS over the past few months. I only come to you guys when I get so stumped even my manager doesn't know the answer (doesn't have time to work out the answer lol). I've got a section of SAS code that I need to run from a batch file everyday automatically. The issue with it is, it struggles with the variables I declare when run from the batch, but works absolutely fine if run from within SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example of the outputs;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the code and its output when run from within SAS:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;_Null_&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; symput(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 10pt;"&gt;'Yest'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;,put(intnx(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 10pt;"&gt;'DAY'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;,today(),-&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;DDMMYYn.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; symput(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 10pt;"&gt;'monyr'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;,put(intnx(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 10pt;"&gt;'DAY'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;,today(),-&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;MONYY.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; &amp;amp;Yest;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; &amp;amp;monyr;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;Output =&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data _Null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*today=today()-&amp;amp;i.;*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput('Yest',put(intnx('DAY',today(),-1),DDMMYYn.));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput('monyr',put(intnx('DAY',today(),-1),MONYY.));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;NOTE: DATA statement used (Total process time):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.04 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;6&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put &amp;amp;Yest;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;06032013&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put &amp;amp;monyr;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;MAR13&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;See how it has absolutely no trouble outputting 06032013 and MAR13??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;When I run it from a batch file with the following code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;"C:\Program Files\SAS\SAS 9.1\sas.exe" -sysin "S:\Dept Reports 4\Collections Systems\Individual Folders\Thomas Honeyfield\Projects\Outbound Report\02 SAS Code\Inboundinfile.sas" -config "C:\Program Files\SAS\SAS 9.1\sasv9.cfg" -log "S:\Dept Reports 4\Collections Systems\Individual Folders\Thomas Honeyfield\Projects\Outbound Report\04 Process Logs\Inboundinfile.log"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get a process log that looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data _Null_;&lt;BR /&gt;10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput('Yest',put(intnx('DAY',today(),-1),DDMMYYn.));&lt;BR /&gt;11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput('monyr',put(intnx('DAY',today(),-1),MONYY.));&lt;BR /&gt;12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference YEST not resolved.&lt;BR /&gt;13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;14&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put &amp;amp;Yest;&lt;BR /&gt;&amp;amp;Yest&lt;BR /&gt;15&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put &amp;amp;monyr;&lt;BR /&gt;WARNING: Apparent symbolic reference MONYR not resolved.&lt;BR /&gt;&amp;amp;monyr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This particular issue has driven me mad all day today, if anyone is having a go at answering and needs more surrounding code to get a better idea of what's gone wrong just say what you need and I'll elaborate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again many thanks in advance to anyone who takes a look, always have such a good response from you guys!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 17:23:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-variable-names-when-batching-SAS/m-p/130244#M26572</guid>
      <dc:creator>Thoney</dc:creator>
      <dc:date>2013-03-07T17:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with variable names when batching SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-variable-names-when-batching-SAS/m-p/130245#M26573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It ran fine in batch for me (Win 7 Pro x64, SAS 9.3 TS1M1 32bit); I got the same thing you did for interactive SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rather than running that long script, try running it by right-clicking on the program icon and then submitting in batch.&amp;nbsp; That will tell you whether the problem is in your SAS install or something that you need to tweak in the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also check the top of the batch log for warnings about missing configurations or something similar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doc Muhlbaier&lt;/P&gt;&lt;P&gt;Duke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 17:58:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-variable-names-when-batching-SAS/m-p/130245#M26573</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2013-03-07T17:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with variable names when batching SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-variable-names-when-batching-SAS/m-p/130246#M26574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What statements were on lines 1 to 8 of the file you submitted batch mode?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 19:58:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-variable-names-when-batching-SAS/m-p/130246#M26574</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-03-07T19:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with variable names when batching SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-variable-names-when-batching-SAS/m-p/130247#M26575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;I am surprised this statement works.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; symput(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 10pt;"&gt;'Yest'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;,put(intnx(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 10pt;"&gt;'DAY'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;,today(),-&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;DDMMYYn.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;note the format is &lt;/P&gt;&lt;P&gt;ddmmyyW.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;Based on your original problem description&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;I believe there is/are some initializations that you have done in your session&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;that are not being done in batch.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;As Tom requested:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;"Show us the whole log"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This assignment can also be:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;%let today&lt;/TD&gt;&lt;TD&gt;= %sysfunc(today()); &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;%let previous = %sysfunc(intnx(DAY,&amp;amp;today,-1));&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;%Let Yest &lt;/TD&gt;&lt;TD&gt;= %sysfunc(putn(&amp;amp;previous,DDMMYYn.));&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;%put yest:&amp;amp;Yest;&lt;/P&gt;&lt;P&gt;%Let monyr = %sysfunc(putn(&amp;amp;previous,MONYY.));&lt;/P&gt;&lt;P&gt;%put monyr:&amp;amp;monyr;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ron Fehd&amp;nbsp; dates maven&lt;/P&gt;&lt;P&gt;see also:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/Macro_Loops_with_Dates" title="http://www.sascommunity.org/wiki/Macro_Loops_with_Dates"&gt;http://www.sascommunity.org/wiki/Macro_Loops_with_Dates&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2013 15:08:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-variable-names-when-batching-SAS/m-p/130247#M26575</guid>
      <dc:creator>Ron_MacroMaven</dc:creator>
      <dc:date>2013-03-08T15:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with variable names when batching SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-variable-names-when-batching-SAS/m-p/130248#M26576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey I've come back to this old post to mark it as answered. I've had one hell of a busy month at work and only just got back around to this problem. Just wanted to make sure it's correctly marked as answered because Tom was right, when I looked at the initialisation it was showing that there was an issue resolving my user name and password. This in turn had a knock on effect where it ignored other variables in the code. Once I resolved my login and initialisation to SAS the batch ran perfectly fine as it did for Doc. Thanks again guys&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p.s. can't see the option to mark as answered this time, is this because it's an old post? I hope I can still give people points for it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Apr 2013 15:18:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-variable-names-when-batching-SAS/m-p/130248#M26576</guid>
      <dc:creator>Thoney</dc:creator>
      <dc:date>2013-04-18T15:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with variable names when batching SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-variable-names-when-batching-SAS/m-p/130249#M26577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;RTM %SYSFUNC has optional 2nd argument.:smileyinfo:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;19&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; Yest = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;(intnx(DAY,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;(today()),-&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #008080; background-color: #ffffff;"&gt;DDMMYYn.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;);&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;20&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; NOTE: &amp;amp;=yest;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;NOTE: YEST=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;17042013&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Apr 2013 16:02:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-variable-names-when-batching-SAS/m-p/130249#M26577</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-04-18T16:02:39Z</dc:date>
    </item>
  </channel>
</rss>

