<?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: How to convert SAS date to character YYYY-MM in one step? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-SAS-date-to-character-YYYY-MM-in-one-step/m-p/615633#M180090</link>
    <description>&lt;P&gt;I merged your two, basically identical, questions.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jan 2020 11:54:30 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-01-07T11:54:30Z</dc:date>
    <item>
      <title>How to convert SAS date to character YYYY-MM in one step?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-SAS-date-to-character-YYYY-MM-in-one-step/m-p/615621#M180078</link>
      <description>&lt;P&gt;I've one field called 'Calendar_Month' and it is in date9. Format and I want to convert that field to character and the value should appear like YYYY-MM.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ex:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;AS IS:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Calendar_Month (numeric with date9. format)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;07Jan2020&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;TO BE:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Calendar_Month (Need in character)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;2020-01&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2020 11:05:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-SAS-date-to-character-YYYY-MM-in-one-step/m-p/615621#M180078</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-01-07T11:05:54Z</dc:date>
    </item>
    <item>
      <title>Convert SAS date to character YYYY-MM format in one step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-SAS-date-to-character-YYYY-MM-in-one-step/m-p/615624#M180087</link>
      <description>Could you please tell me how to convert the field which has SAS date value (07JAN2020) to character field YYYY-MM (2020-01) in one step?</description>
      <pubDate>Tue, 07 Jan 2020 11:15:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-SAS-date-to-character-YYYY-MM-in-one-step/m-p/615624#M180087</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-01-07T11:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert SAS date to character YYYY-MM in one step?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-SAS-date-to-character-YYYY-MM-in-one-step/m-p/615625#M180080</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292396"&gt;@David_Billa&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use the &lt;A href="https://documentation.sas.com/?docsetId=leforinforref&amp;amp;docsetTarget=n1k45hxg0vxohqn1ktr8k1tnmrn1.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank" rel="noopener"&gt;YYMMD. format&lt;/A&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want(drop=_cm);
set have(rename=(Calendar_Month=_cm));
Calendar_Month=put(_cm,yymmd.);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Jan 2020 11:16:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-SAS-date-to-character-YYYY-MM-in-one-step/m-p/615625#M180080</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-01-07T11:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert SAS date to character YYYY-MM in one step?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-SAS-date-to-character-YYYY-MM-in-one-step/m-p/615627#M180082</link>
      <description>Can't we do it without rename statement?&lt;BR /&gt;</description>
      <pubDate>Tue, 07 Jan 2020 11:19:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-SAS-date-to-character-YYYY-MM-in-one-step/m-p/615627#M180082</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-01-07T11:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Convert SAS date to character YYYY-MM format in one step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-SAS-date-to-character-YYYY-MM-in-one-step/m-p/615629#M180088</link>
      <description>&lt;P&gt;You can use the YYMMd format:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;str=put(date,yymmd7.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The "d" in the format name modifies the output to use a dash separator.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2020 11:27:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-SAS-date-to-character-YYYY-MM-in-one-step/m-p/615629#M180088</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2020-01-07T11:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Convert SAS date to character YYYY-MM format in one step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-SAS-date-to-character-YYYY-MM-in-one-step/m-p/615630#M180089</link>
      <description>&lt;P&gt;like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
    dt='07JAN2020'd;
    dtnew=put(dt, yymmd.);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Jan 2020 11:27:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-SAS-date-to-character-YYYY-MM-in-one-step/m-p/615630#M180089</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-01-07T11:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert SAS date to character YYYY-MM in one step?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-SAS-date-to-character-YYYY-MM-in-one-step/m-p/615631#M180086</link>
      <description>&lt;P&gt;You want the new character variable to have the same name as the original numeric variable. The type of an existing variable cannot be changed in place, hence we need two separate variables and different variables must have different names. So, at some point we need to change the old name to a new name (that's what I did with the RENAME= &lt;EM&gt;dataset option&lt;/EM&gt;) or vice versa.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2020 11:28:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-SAS-date-to-character-YYYY-MM-in-one-step/m-p/615631#M180086</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-01-07T11:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert SAS date to character YYYY-MM in one step?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-SAS-date-to-character-YYYY-MM-in-one-step/m-p/615633#M180090</link>
      <description>&lt;P&gt;I merged your two, basically identical, questions.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2020 11:54:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-SAS-date-to-character-YYYY-MM-in-one-step/m-p/615633#M180090</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-01-07T11:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert SAS date to character YYYY-MM in one step?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-SAS-date-to-character-YYYY-MM-in-one-step/m-p/615641#M180094</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292396"&gt;@David_Billa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Can't we do it without rename statement?&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In fact,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;does not use a statement, but a dataset option. These are two different things.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2020 12:37:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-SAS-date-to-character-YYYY-MM-in-one-step/m-p/615641#M180094</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-01-07T12:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert SAS date to character YYYY-MM in one step?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-SAS-date-to-character-YYYY-MM-in-one-step/m-p/615646#M180095</link>
      <description>I meant to say rename option only.&lt;BR /&gt;</description>
      <pubDate>Tue, 07 Jan 2020 12:46:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-SAS-date-to-character-YYYY-MM-in-one-step/m-p/615646#M180095</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-01-07T12:46:49Z</dc:date>
    </item>
  </channel>
</rss>

