<?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: Convert character into date9. format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-character-into-date9-format/m-p/589176#M168470</link>
    <description>&lt;P&gt;Since your date variable RFICDT is already formatted as date9., there doesn't seem to be much point in turning it into a character string. Any time SAS has to use this variable, it will ALWAYS display it as date9.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the answer to your problem is to do nothing. Write no code! Problem solved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unless there's something you haven't explained as to why you need a character string here.&lt;/P&gt;</description>
    <pubDate>Mon, 16 Sep 2019 19:48:05 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-09-16T19:48:05Z</dc:date>
    <item>
      <title>Convert character into date9. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-character-into-date9-format/m-p/589173#M168467</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know there's a few posts regarding this topic but none has worked in my situation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get a log message for date9, format:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;20 ;&lt;BR /&gt;NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR&lt;BR /&gt;21&lt;BR /&gt;22 GOPTIONS ACCESSIBLE;&lt;BR /&gt;23 data adsl1;&lt;BR /&gt;24 merge adsl(in=a)&lt;BR /&gt;25 ecall&lt;BR /&gt;26 ;&lt;BR /&gt;27 by studyid usubjid;&lt;BR /&gt;28&lt;BR /&gt;29&lt;BR /&gt;30 ***col6;&lt;BR /&gt;31 ecstdtc_=substr(ecstdtc,1,10);&lt;BR /&gt;32 col6= strip(put(ecstdtc_, date9.));&lt;BR /&gt;______&lt;BR /&gt;484&lt;BR /&gt;NOTE 484-185: Format $DATE was not found or could not be loaded.&lt;/P&gt;&lt;P&gt;33 run;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;data:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dates.PNG" style="width: 156px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32512iD898DC92E2A6381F/image-size/large?v=v2&amp;amp;px=999" role="button" title="dates.PNG" alt="dates.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data adsl1;
  merge adsl(in=a)
		ecall
		;
  by studyid usubjid;
 

	 ***col6;
	 ecstdtc_=substr(ecstdtc,1,10);
	 col6= strip(put(ecstdtc_, date9.));
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2019 19:56:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-character-into-date9-format/m-p/589173#M168467</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2019-09-16T19:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character into date9. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-character-into-date9-format/m-p/589174#M168468</link>
      <description>&lt;P&gt;please post the code that generated this log?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2019 19:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-character-into-date9-format/m-p/589174#M168468</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-09-16T19:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character into date9. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-character-into-date9-format/m-p/589175#M168469</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/111564"&gt;@HitmonTran&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know there's a few posts regarding this topic but none has worked in my situation.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get a log message for date9, format:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
662 col5= strip(put(rficdt, date9.));
663 
664
665 ***col6;
666 *if BRTHDTC ne "" then BRTHDT= input(substr(strip(BRTHDTC),1,10),is8601da.);
667 col6= strip(put(BRTHDTC, date9.));
______
484
NOTE 484-185: Format $DATE was not found or could not be loaded.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dates.PNG" style="width: 189px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32511iA5355DB8CA65D3F7/image-size/large?v=v2&amp;amp;px=999" role="button" title="dates.PNG" alt="dates.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please describe what you are attempting to do. In considerable detail.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your Brthdtc variable appears to be a character value that looks like a year. As such it is inappropriate to attempt to use a date valued format like date9 in any form. Also if the value is only a year then what date of a year would you want that to represent??&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2019 19:43:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-character-into-date9-format/m-p/589175#M168469</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-16T19:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character into date9. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-character-into-date9-format/m-p/589176#M168470</link>
      <description>&lt;P&gt;Since your date variable RFICDT is already formatted as date9., there doesn't seem to be much point in turning it into a character string. Any time SAS has to use this variable, it will ALWAYS display it as date9.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the answer to your problem is to do nothing. Write no code! Problem solved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unless there's something you haven't explained as to why you need a character string here.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2019 19:48:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-character-into-date9-format/m-p/589176#M168470</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-16T19:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character into date9. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-character-into-date9-format/m-p/589178#M168471</link>
      <description>Hi Draycut,&lt;BR /&gt;&lt;BR /&gt;I updated the post.</description>
      <pubDate>Mon, 16 Sep 2019 19:54:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-character-into-date9-format/m-p/589178#M168471</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2019-09-16T19:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character into date9. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-character-into-date9-format/m-p/589179#M168472</link>
      <description>Hi Paige,&lt;BR /&gt;&lt;BR /&gt;I updated the post with another example. Can you please take a look? Thank you</description>
      <pubDate>Mon, 16 Sep 2019 19:57:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-character-into-date9-format/m-p/589179#M168472</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2019-09-16T19:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character into date9. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-character-into-date9-format/m-p/589180#M168473</link>
      <description>&lt;P&gt;Please run PROC CONTENTS on data set &lt;SPAN&gt;adsl&amp;nbsp;&lt;/SPAN&gt;and SHOW US if this variable&amp;nbsp;ecstdtc is numeric or character.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2019 20:01:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-character-into-date9-format/m-p/589180#M168473</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-16T20:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character into date9. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-character-into-date9-format/m-p/589182#M168474</link>
      <description>&lt;P&gt;So you took the first 10 characters of a string and tried to use the PUT() function to apply a NUMERIC format to it. SAS very kindly assumed you just forgot to include the $ in your format specification and so it added one. But then it could not find any character format named $DATE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you want to create a DATE value?&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;col6 = input(ecstdtc, yymmdd10.);
format col6 date9.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or do you want to create another string that also looks like a date, only this time showing the date in a different style?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;col6 = put(input(ecstdtc, yymmdd10.),date9.);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2019 20:02:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-character-into-date9-format/m-p/589182#M168474</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-09-16T20:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character into date9. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-character-into-date9-format/m-p/589183#M168475</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/111564"&gt;@HitmonTran&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hi Paige,&lt;BR /&gt;&lt;BR /&gt;I updated the post with another example. Can you please take a look? Thank you&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;As others have asked, would you please explain why you are doing this if you already have a string of text (either a formatted number or an actual character string) that appears to be in DATE9. format?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2019 20:04:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-character-into-date9-format/m-p/589183#M168475</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-16T20:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Convert character into date9. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-character-into-date9-format/m-p/589187#M168476</link>
      <description>Thanks Tom! the second option is what I wanted!</description>
      <pubDate>Mon, 16 Sep 2019 20:16:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-character-into-date9-format/m-p/589187#M168476</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2019-09-16T20:16:02Z</dc:date>
    </item>
  </channel>
</rss>

