<?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 Convert a character variable to sas date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-to-sas-date/m-p/704911#M216137</link>
    <description>&lt;P&gt;I need to convert a character variable which is in the format of '200905' (i.e., year and month) to a sas date format YYMMDw. which keeps the year and month&lt;/P&gt;
&lt;P&gt;Degree_Term=input(TERM_DEG_GRANT, YYMMD7.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I keep getting error message in sas log:&amp;nbsp;The informat YYMMD was not found or could not be loaded.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyone can help me how to modify the code? Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 10 Dec 2020 03:19:00 GMT</pubDate>
    <dc:creator>xliu1</dc:creator>
    <dc:date>2020-12-10T03:19:00Z</dc:date>
    <item>
      <title>Convert a character variable to sas date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-to-sas-date/m-p/704911#M216137</link>
      <description>&lt;P&gt;I need to convert a character variable which is in the format of '200905' (i.e., year and month) to a sas date format YYMMDw. which keeps the year and month&lt;/P&gt;
&lt;P&gt;Degree_Term=input(TERM_DEG_GRANT, YYMMD7.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I keep getting error message in sas log:&amp;nbsp;The informat YYMMD was not found or could not be loaded.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyone can help me how to modify the code? Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 03:19:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-to-sas-date/m-p/704911#M216137</guid>
      <dc:creator>xliu1</dc:creator>
      <dc:date>2020-12-10T03:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a character variable to sas date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-to-sas-date/m-p/704912#M216138</link>
      <description>&lt;P&gt;To convert text to values you need to use an INFORMAT.&amp;nbsp; Formats are for converting values to text.&lt;/P&gt;
&lt;P&gt;There is no informat with that name.&lt;/P&gt;
&lt;P&gt;There is on named YYMMN that will read strings with just year and month. The returned date will be the first day of the month.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 03:44:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-to-sas-date/m-p/704912#M216138</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-12-10T03:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a character variable to sas date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-to-sas-date/m-p/704923#M216140</link>
      <description>&lt;P&gt;The message is pretty clear:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;The informat YYMMD was not found or could not be loaded.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This informat does not exist. You cannot make up informat names that don't exist.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For the string you have, the informat to use is&amp;nbsp;&amp;nbsp;&lt;FONT face="courier new,courier"&gt;yymmn.&amp;nbsp;&lt;/FONT&gt; as explained above.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 04:12:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-to-sas-date/m-p/704923#M216140</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-12-10T04:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a character variable to sas date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-to-sas-date/m-p/704943#M216149</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The message is pretty clear:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;The informat YYMMD was not found or could not be loaded.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This informat does not exist. You cannot make up informat names that don't exist.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For the string you have, the informat to use is&amp;nbsp;&amp;nbsp;&lt;FONT face="courier new,courier"&gt;yymmn.&amp;nbsp;&lt;/FONT&gt; as explained above.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Unless you write the code yourself ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not interested in writing many custom date informats though.&lt;span class="lia-unicode-emoji" title=":smirking_face:"&gt;😏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 05:09:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-to-sas-date/m-p/704943#M216149</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-12-10T05:09:15Z</dc:date>
    </item>
  </channel>
</rss>

