<?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: Date value to a Data set suffix in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-value-to-a-Data-set-suffix/m-p/180906#M303016</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I believe you have pasted rather a piece of a script out of a process and trying to understand it. However, my sincere opinion is that it would make more sense for you to review the following preceding and subsequent steps in the same script just to understand how the resolved DT macro variable is being applied.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd even suggest you to try running your script with hard coded values&amp;nbsp; to get a better understanding just to know what this macro variable is doing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Dec 2013 12:03:39 GMT</pubDate>
    <dc:creator>NaveenSrinivasan</dc:creator>
    <dc:date>2013-12-26T12:03:39Z</dc:date>
    <item>
      <title>Date value to a Data set suffix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-value-to-a-Data-set-suffix/m-p/180903#M303013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm trying to understand what this code is doing as I'm having the error below when run and if there's away that can be modified would be great. the code was written some one else who is not around any more. Much appreciated your input.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;&lt;STRONG style="font-size: 11pt; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; font-size: 11pt;"&gt; _null_;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: #800080; font-size: 11pt;"&gt;suffix = put(&amp;amp;DT,yymmddn8.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: #800080; font-size: 11pt;"&gt;call symput('DATE', suffix);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;&lt;STRONG style="font-size: 11pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; font-size: 11pt;"&gt;;&lt;/SPAN&gt;&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: 11pt;"&gt;24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;25&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;26&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; suffix = put(&amp;amp;DT,yymmddn8.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: green; font-size: 11pt;"&gt;NOTE: Line generated by the macro variable "DT".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;26&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 16Dec2013&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: red; font-size: 11pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _______&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: red; font-size: 11pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: red; font-size: 11pt;"&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, IN, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: red; font-size: 11pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LE, LT, MAX, MIN, NE, NG, NL, NOTIN, OR, ^=, |, ||, ~=.&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;27&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;28&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput('DATE', suffix);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;29&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: auto; margin-bottom: auto; background: white;"&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Dec 2013 21:11:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-value-to-a-Data-set-suffix/m-p/180903#M303013</guid>
      <dc:creator>AliMN</dc:creator>
      <dc:date>2013-12-23T21:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Date value to a Data set suffix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-value-to-a-Data-set-suffix/m-p/180904#M303014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;amp;DT would need to resolve to "16Dec2013"d, not 16Dec2013 with no quotes or d ("xxx"d is a "date constant").&amp;nbsp; It's possible in the past the macro variable was defined as the numeric equivalent of the date, but now you're trying to use the text (which is fine).&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="color: #800080; font-style: inherit; line-height: 1.5em; font-size: 11pt; font-family: 'Courier New';"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="color: #800080; font-style: inherit; line-height: 1.5em; font-size: 11pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="color: #800080; font-style: inherit; font-weight: inherit; line-height: 1.5em; font-size: 11pt; font-family: 'Courier New';"&gt; _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 11pt; font-family: 'Courier New'; color: #800080;"&gt;suffix = put("&amp;amp;DT"d,yymmddn8.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 11pt; font-family: 'Courier New'; color: #800080;"&gt;call symput('DATE', suffix);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #800080;"&gt;&lt;STRONG style="font-style: inherit; font-size: 11pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 11pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise, you could consider trying something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let date=%sysfunc(today(),YYMMDDN8.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it's intended to be today, for example; other similar solutions exist for specifying particular dates, depending on how your particular date is arrived at.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Dec 2013 21:19:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-value-to-a-Data-set-suffix/m-p/180904#M303014</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2013-12-23T21:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: Date value to a Data set suffix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-value-to-a-Data-set-suffix/m-p/180905#M303015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd go back and check how DT should be inputted/created. My guess is the macro variable isn't being set appropriately or how the original programmer intended. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You're less likely to cause issues further down the line if the variable is used in other places if you change it at the "top" rather than in the middle of the program.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Dec 2013 21:37:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-value-to-a-Data-set-suffix/m-p/180905#M303015</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-12-23T21:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Date value to a Data set suffix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-value-to-a-Data-set-suffix/m-p/180906#M303016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I believe you have pasted rather a piece of a script out of a process and trying to understand it. However, my sincere opinion is that it would make more sense for you to review the following preceding and subsequent steps in the same script just to understand how the resolved DT macro variable is being applied.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd even suggest you to try running your script with hard coded values&amp;nbsp; to get a better understanding just to know what this macro variable is doing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Dec 2013 12:03:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-value-to-a-Data-set-suffix/m-p/180906#M303016</guid>
      <dc:creator>NaveenSrinivasan</dc:creator>
      <dc:date>2013-12-26T12:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: Date value to a Data set suffix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-value-to-a-Data-set-suffix/m-p/180907#M303017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For that code to work the macro variable DT would either need to be a date literal such as '16dec2013'd or an actual number of days since 1/1/1960.&lt;/P&gt;&lt;P&gt;You can either fix the code segment posted to add the quotes and the letter d to convert your macro variable value into a date literal.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-family: 'Courier New'; font-size: 15px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-family: 'Courier New'; font-size: 15px; background-color: #ffffff;"&gt;suffix = put("&amp;amp;DT"d,yymmddn8.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or change how the macro variable is set so that it contains a value that is a valid date.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Dec 2013 18:37:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-value-to-a-Data-set-suffix/m-p/180907#M303017</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-12-26T18:37:06Z</dc:date>
    </item>
  </channel>
</rss>

