<?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: macro variable to daete in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/macro-variable-to-date/m-p/372935#M11306</link>
    <description>&lt;P&gt;ok got it. Yes i forgot to put the macro in " " &amp;nbsp;and the informat i needed was&amp;nbsp;ANYDTDTM. Thanks for help.&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jul 2017 08:15:31 GMT</pubDate>
    <dc:creator>Thylacine</dc:creator>
    <dc:date>2017-07-04T08:15:31Z</dc:date>
    <item>
      <title>macro variable to date</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/macro-variable-to-date/m-p/372753#M11302</link>
      <description>&lt;P&gt;I have z macro variable with date inside (2017-07-03 10:08:03) when i try to use it like this: variable=Scan(&amp;amp;data_z_nazwy,1,' ')&lt;/P&gt;&lt;P&gt;i get an error (in attachment). Got it also when trying in various ways to change it to date format. Can someone suggest a way to assign it to a variable with datetime format?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/14024iF6540E77CDD56ADB/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="error.png" title="error.png" /&gt;</description>
      <pubDate>Mon, 03 Jul 2017 14:59:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/macro-variable-to-date/m-p/372753#M11302</guid>
      <dc:creator>Thylacine</dc:creator>
      <dc:date>2017-07-03T14:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable to daete</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/macro-variable-to-date/m-p/372755#M11303</link>
      <description>&lt;P&gt;The most likely change is this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;variable = scan("&amp;amp;data_z_nazwy", 1, ' ');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS language requires quotes around character strings, to recognize that they are character strings.&amp;nbsp; Double quotes (not single) are required here.&amp;nbsp; Single quotes would prevent resolution of the macro variable into its value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Related questions:&amp;nbsp; You attempted to read the first word (the date part) using SCAN.&amp;nbsp; That creates a character variable, not a date variable.&amp;nbsp; So this change follows along those lines and creates a character variable.&amp;nbsp; If&amp;nbsp; you actually wanted a date:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;date_variable = input("&amp;amp;data_z_nazwy", yymmdd10.);&lt;/P&gt;
&lt;P&gt;format date_variable yymmdd10.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if&amp;nbsp; you actually wanted a date-time variable, yet a different formula would be required.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2017 15:02:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/macro-variable-to-date/m-p/372755#M11303</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-07-03T15:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable to daete</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/macro-variable-to-date/m-p/372935#M11306</link>
      <description>&lt;P&gt;ok got it. Yes i forgot to put the macro in " " &amp;nbsp;and the informat i needed was&amp;nbsp;ANYDTDTM. Thanks for help.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 08:15:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/macro-variable-to-date/m-p/372935#M11306</guid>
      <dc:creator>Thylacine</dc:creator>
      <dc:date>2017-07-04T08:15:31Z</dc:date>
    </item>
  </channel>
</rss>

