<?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 with format YYYY-MM-DD and no inverted commas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/DATE-with-format-YYYY-MM-DD-and-no-inverted-commas/m-p/597008#M171993</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/293213"&gt;@dgoel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;I am looking for the global variable which has the format of YYYY-MM-DD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have&amp;nbsp;TD_ASOFDT which returns '2019-10-16'&lt;/P&gt;
&lt;P&gt;I have date which is of format YYYYMMDDN8 and returns like 20191016.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I return 2019-10-16, i.e. there are - as separators but no inverted commas.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What is a &lt;STRONG&gt;global&lt;/STRONG&gt; variable?&amp;nbsp; Did you mean a macro variable?&amp;nbsp; Perhaps one defined in the GLOBAL scope?&lt;/P&gt;
&lt;P&gt;Hopefully your macro variable does not include upside commas (what does that even mean? Are you talking about fancy quotes with different angles for opening and closing quotes?) but instead has nice normal single quote characters, like in your example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To convert&amp;nbsp;'2019-10-16' to&amp;nbsp;2019-10-16 just remove the quotes.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let want=%sysfunc(dequote(&amp;amp;TD_ASOFDT ));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is not at all clear what your other variable is or even what name to use to refer to it.&lt;/P&gt;
&lt;P&gt;Is it also a macro variable?&amp;nbsp; Or is it an actual variable in a dataset?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's assume, again, that you are talking about a character string stored in a macro variable. (Note that everything stored in a macro variable is a character string.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could convert it to a date and then regenerate a character string again only using a format that generates the characters you want.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let want=%sysfunc(inputn(&amp;amp;date,yymmdd8.),yymmdd10.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Oct 2019 21:00:26 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-10-16T21:00:26Z</dc:date>
    <item>
      <title>DATE with format YYYY-MM-DD and no inverted commas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATE-with-format-YYYY-MM-DD-and-no-inverted-commas/m-p/596996#M171988</link>
      <description>&lt;P&gt;&amp;nbsp;I am looking for the global variable which has the format of YYYY-MM-DD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have&amp;nbsp;TD_ASOFDT which returns '2019-10-16'&lt;/P&gt;&lt;P&gt;I have date which is of format YYYYMMDDN8 and returns like 20191016.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I return 2019-10-16, i.e. there are - as separators but no inverted commas.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 17:26:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATE-with-format-YYYY-MM-DD-and-no-inverted-commas/m-p/596996#M171988</guid>
      <dc:creator>dgoel</dc:creator>
      <dc:date>2019-10-16T17:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: DATE with format YYYY-MM-DD and no inverted commas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATE-with-format-YYYY-MM-DD-and-no-inverted-commas/m-p/596999#M171990</link>
      <description>&lt;P&gt;Try&amp;nbsp;format &lt;STRONG&gt;YYMMDD10.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 17:32:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATE-with-format-YYYY-MM-DD-and-no-inverted-commas/m-p/596999#M171990</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-10-16T17:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: DATE with format YYYY-MM-DD and no inverted commas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATE-with-format-YYYY-MM-DD-and-no-inverted-commas/m-p/597000#M171991</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/293213"&gt;@dgoel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have&amp;nbsp;TD_ASOFDT which returns '2019-10-16'&lt;/P&gt;
&lt;P&gt;I have date which is of format YYYYMMDDN8 and returns like 20191016.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I return 2019-10-16, i.e. there are - as separators but no inverted commas.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If your format is 8 characters wide, you don't have enough room left to right to include the dashes/hyphens.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try format YYMMDDD10.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 17:33:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATE-with-format-YYYY-MM-DD-and-no-inverted-commas/m-p/597000#M171991</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-10-16T17:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: DATE with format YYYY-MM-DD and no inverted commas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATE-with-format-YYYY-MM-DD-and-no-inverted-commas/m-p/597008#M171993</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/293213"&gt;@dgoel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;I am looking for the global variable which has the format of YYYY-MM-DD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have&amp;nbsp;TD_ASOFDT which returns '2019-10-16'&lt;/P&gt;
&lt;P&gt;I have date which is of format YYYYMMDDN8 and returns like 20191016.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I return 2019-10-16, i.e. there are - as separators but no inverted commas.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What is a &lt;STRONG&gt;global&lt;/STRONG&gt; variable?&amp;nbsp; Did you mean a macro variable?&amp;nbsp; Perhaps one defined in the GLOBAL scope?&lt;/P&gt;
&lt;P&gt;Hopefully your macro variable does not include upside commas (what does that even mean? Are you talking about fancy quotes with different angles for opening and closing quotes?) but instead has nice normal single quote characters, like in your example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To convert&amp;nbsp;'2019-10-16' to&amp;nbsp;2019-10-16 just remove the quotes.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let want=%sysfunc(dequote(&amp;amp;TD_ASOFDT ));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is not at all clear what your other variable is or even what name to use to refer to it.&lt;/P&gt;
&lt;P&gt;Is it also a macro variable?&amp;nbsp; Or is it an actual variable in a dataset?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's assume, again, that you are talking about a character string stored in a macro variable. (Note that everything stored in a macro variable is a character string.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could convert it to a date and then regenerate a character string again only using a format that generates the characters you want.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let want=%sysfunc(inputn(&amp;amp;date,yymmdd8.),yymmdd10.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 21:00:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATE-with-format-YYYY-MM-DD-and-no-inverted-commas/m-p/597008#M171993</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-10-16T21:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: DATE with format YYYY-MM-DD and no inverted commas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATE-with-format-YYYY-MM-DD-and-no-inverted-commas/m-p/598468#M172586</link>
      <description>&lt;P&gt;Thank You, it worked.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 17:46:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATE-with-format-YYYY-MM-DD-and-no-inverted-commas/m-p/598468#M172586</guid>
      <dc:creator>dgoel</dc:creator>
      <dc:date>2019-10-22T17:46:07Z</dc:date>
    </item>
  </channel>
</rss>

