<?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: Changing date value from dd/mm/yyyy in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Changing-date-value-from-dd-mm-yyyy/m-p/17117#M2445</link>
    <description>You are attempting to use a PUT where you need to be using an INPUT.  The code you have shared is reading up your "date-string" as character with the specified INFORMAT in your INPUT statement.&lt;BR /&gt;
&lt;BR /&gt;
To convert that character string to a SAS numeric DATE variable, you need to use the INPUT function with the specific INFORMAT based on the string.&lt;BR /&gt;
&lt;BR /&gt;
Also, with your INFILE statement, you may want to explore whether or not the DSD parameter may be needed, if you might have null input fields to read up.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Step-by-Step Programming with Base SAS Software, Working with Dates in the SAS System&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001304321.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001304321.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
SAS Language Reference: Dictionary, Informats&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000309877.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000309877.htm&lt;/A&gt;</description>
    <pubDate>Mon, 16 Nov 2009 01:28:02 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2009-11-16T01:28:02Z</dc:date>
    <item>
      <title>Changing date value from dd/mm/yyyy</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-date-value-from-dd-mm-yyyy/m-p/17116#M2444</link>
      <description>Hi All&lt;BR /&gt;
&lt;BR /&gt;
I am having come issues changing the date format from dd/mm/yyyy to yyyymmdd.&lt;BR /&gt;
&lt;BR /&gt;
Everything i do I get &lt;BR /&gt;
ERROR 48-59: The format $YYMMDD was not found or could not be loaded.&lt;BR /&gt;
&lt;BR /&gt;
Here is my SAS program which is run on the mainframe:&lt;BR /&gt;
&lt;BR /&gt;
 OPTIONS ERRORABEND;                             &lt;BR /&gt;
                                                 &lt;BR /&gt;
DATA ONE;                                        &lt;BR /&gt;
LENGTH INVDATEL                       $10.;      &lt;BR /&gt;
LENGTH INV_NO                         $06.;      &lt;BR /&gt;
LENGTH NETDUEDATE                     $10.;      &lt;BR /&gt;
                                                 &lt;BR /&gt;
INFILE DMINPUT DELIMITER = ',' MISSOVER;         &lt;BR /&gt;
           &lt;BR /&gt;
                                                 &lt;BR /&gt;
INPUT                                            &lt;BR /&gt;
       INV_HEADER_TYPE                $          &lt;BR /&gt;
       NETDUEDATE                      $          &lt;BR /&gt;
       INV_NO                         $          &lt;BR /&gt;
;&lt;BR /&gt;
 CURRENTDATE = DATE();                &lt;BR /&gt;
 NETDUEDATE2=PUT(NETDUEDATE,YYMMDD6.);&lt;BR /&gt;
&lt;BR /&gt;
DATA SENDIT;                                   &lt;BR /&gt;
SET ONE;                                       &lt;BR /&gt;
FILE DMOUTPT;                                  &lt;BR /&gt;
  PUT @029 NETDUEDATE2                YYMMDD6. &lt;BR /&gt;
                        ;                      &lt;BR /&gt;
&lt;BR /&gt;
Thanks for your help</description>
      <pubDate>Mon, 16 Nov 2009 01:07:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-date-value-from-dd-mm-yyyy/m-p/17116#M2444</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-11-16T01:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Changing date value from dd/mm/yyyy</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-date-value-from-dd-mm-yyyy/m-p/17117#M2445</link>
      <description>You are attempting to use a PUT where you need to be using an INPUT.  The code you have shared is reading up your "date-string" as character with the specified INFORMAT in your INPUT statement.&lt;BR /&gt;
&lt;BR /&gt;
To convert that character string to a SAS numeric DATE variable, you need to use the INPUT function with the specific INFORMAT based on the string.&lt;BR /&gt;
&lt;BR /&gt;
Also, with your INFILE statement, you may want to explore whether or not the DSD parameter may be needed, if you might have null input fields to read up.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Step-by-Step Programming with Base SAS Software, Working with Dates in the SAS System&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001304321.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001304321.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
SAS Language Reference: Dictionary, Informats&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000309877.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000309877.htm&lt;/A&gt;</description>
      <pubDate>Mon, 16 Nov 2009 01:28:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-date-value-from-dd-mm-yyyy/m-p/17117#M2445</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-11-16T01:28:02Z</dc:date>
    </item>
  </channel>
</rss>

