<?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: Converting numeric YYMMDD10. to numeric Date9. in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Converting-numeric-YYMMDD10-to-numeric-Date9/m-p/935634#M42037</link>
    <description>&lt;P&gt;INPUT function requires text. If you use a numeric value then SAS will do an automatic conversion from number to text using a best format that will have leading spaces and not match the YYMMDD10 expected values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So control the conversion with a PUT function call&lt;/P&gt;
&lt;PRE&gt;DATA WANT;
	tdy_date=20120712;
                 
   DATE = INPUT(put(tdy_date,8.),YYMMDD10.);                              
   ForMAT DATE DATE9.;                  
RUN;&lt;/PRE&gt;
&lt;P&gt;If your data is clean you could re-use the variable name tdy_date and not create a new variable.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jul 2024 17:28:24 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2024-07-12T17:28:24Z</dc:date>
    <item>
      <title>Converting numeric YYMMDD10. to numeric Date9.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Converting-numeric-YYMMDD10-to-numeric-Date9/m-p/935632#M42036</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I would like to convert a numeric YYMMDD10. to a numeric Date9.&lt;BR /&gt;I have the following code but I'm not getting a result.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;DATA WANT;
	SET HAVE;
                 
DATE = INPUT(tdy_date,YYMMDD10.);                              
FROMAT DATE DATE9.;                  
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Jul 2024 17:08:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Converting-numeric-YYMMDD10-to-numeric-Date9/m-p/935632#M42036</guid>
      <dc:creator>shami</dc:creator>
      <dc:date>2024-07-12T17:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Converting numeric YYMMDD10. to numeric Date9.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Converting-numeric-YYMMDD10-to-numeric-Date9/m-p/935634#M42037</link>
      <description>&lt;P&gt;INPUT function requires text. If you use a numeric value then SAS will do an automatic conversion from number to text using a best format that will have leading spaces and not match the YYMMDD10 expected values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So control the conversion with a PUT function call&lt;/P&gt;
&lt;PRE&gt;DATA WANT;
	tdy_date=20120712;
                 
   DATE = INPUT(put(tdy_date,8.),YYMMDD10.);                              
   ForMAT DATE DATE9.;                  
RUN;&lt;/PRE&gt;
&lt;P&gt;If your data is clean you could re-use the variable name tdy_date and not create a new variable.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 17:28:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Converting-numeric-YYMMDD10-to-numeric-Date9/m-p/935634#M42037</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-07-12T17:28:24Z</dc:date>
    </item>
  </channel>
</rss>

