<?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: SAS MAINFRAME DATE FORMAT in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-MAINFRAME-DATE-FORMAT/m-p/572341#M161523</link>
    <description>&lt;P&gt;Is source value a date variable or a character variable? Do you want to create a date variable or a character variable?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  input @1 charvar $10. @1 datevar ddmmyy10.;
  charvar2 = put(datevar,ddmmyyp10.);
  datevar2 = input(charvar,ddmmyy10.);
  format datevar datevar2 ddmmyyp10.;
datalines;
25.12.2017
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;Obs     charvar         datevar     charvar2       datevar2

 1     25.12.2017    25.12.2017    25.12.2017    25.12.2017
&lt;/PRE&gt;
&lt;P&gt;PS Not sure why you are using d-m-y order for your dates (or why people use m-d-y order either).&amp;nbsp; It is just asking for confusion.&amp;nbsp; Use either DATE9 or YYMMDD10 so that you don't accidentally confuse 10th of December with November 12th.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jul 2019 13:08:38 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-07-10T13:08:38Z</dc:date>
    <item>
      <title>SAS MAINFRAME DATE FORMAT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-MAINFRAME-DATE-FORMAT/m-p/572327#M161513</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Currently, I'M facing sas date format issue in my existing code kindly give the solution for the below code&amp;nbsp;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;infile lss279;&lt;/P&gt;&lt;P&gt;input&amp;nbsp;@1 sdte $char10.;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;25.12.2017&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;dte2 = put(dte1,ddmmyy10.);&lt;/P&gt;&lt;P&gt;dte2 =&amp;nbsp;substr(dte1,7,4)||substr(dte1,4,2)||substr(dte1,1,2);&amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and here is the output: (&lt;FONT color="#FF6600"&gt;2017.12.25)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;and my requirement is&amp;nbsp;&lt;FONT color="#FF6600"&gt; 25.12.2017&lt;/FONT&gt; but why I am getting that results I'm not able to understand&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;and the thing is I'm using ZOS 8.1 version (mainframe )&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Thanks &amp;amp; regards&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;rohitkrishna&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 11:49:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-MAINFRAME-DATE-FORMAT/m-p/572327#M161513</guid>
      <dc:creator>rohitkrishna</dc:creator>
      <dc:date>2019-07-10T11:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAS MAINFRAME DATE FORMAT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-MAINFRAME-DATE-FORMAT/m-p/572328#M161514</link>
      <description>sorry it's not lss279 its datalines</description>
      <pubDate>Wed, 10 Jul 2019 11:50:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-MAINFRAME-DATE-FORMAT/m-p/572328#M161514</guid>
      <dc:creator>rohitkrishna</dc:creator>
      <dc:date>2019-07-10T11:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS MAINFRAME DATE FORMAT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-MAINFRAME-DATE-FORMAT/m-p/572332#M161515</link>
      <description>&lt;P&gt;Any time you use DATALINES, it must come at the end of the DATA step.&amp;nbsp; So these statements would need to be moved:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dte2 = put(dte1,ddmmyy10.);&lt;/P&gt;
&lt;P&gt;dte2 =&amp;nbsp;substr(dte1,7,4)||substr(dte1,4,2)||substr(dte1,1,2);&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Whichever one you use, it would have to appear after the INPUT statement and before the DATALINES statement.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 12:06:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-MAINFRAME-DATE-FORMAT/m-p/572332#M161515</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-07-10T12:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: SAS MAINFRAME DATE FORMAT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-MAINFRAME-DATE-FORMAT/m-p/572341#M161523</link>
      <description>&lt;P&gt;Is source value a date variable or a character variable? Do you want to create a date variable or a character variable?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  input @1 charvar $10. @1 datevar ddmmyy10.;
  charvar2 = put(datevar,ddmmyyp10.);
  datevar2 = input(charvar,ddmmyy10.);
  format datevar datevar2 ddmmyyp10.;
datalines;
25.12.2017
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;Obs     charvar         datevar     charvar2       datevar2

 1     25.12.2017    25.12.2017    25.12.2017    25.12.2017
&lt;/PRE&gt;
&lt;P&gt;PS Not sure why you are using d-m-y order for your dates (or why people use m-d-y order either).&amp;nbsp; It is just asking for confusion.&amp;nbsp; Use either DATE9 or YYMMDD10 so that you don't accidentally confuse 10th of December with November 12th.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 13:08:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-MAINFRAME-DATE-FORMAT/m-p/572341#M161523</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-10T13:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS MAINFRAME DATE FORMAT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-MAINFRAME-DATE-FORMAT/m-p/572413#M161533</link>
      <description>&lt;P&gt;Use the DDMMYYX format. The X allows you to specify a separator.&lt;/P&gt;
&lt;P&gt;In this case I think you want to use DDMMYYP10. with a date value instead of messing with character values. Character values will not sort correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data example;
input  sdte ddmmyy10.;
format sdte ddmmyyp10.;
datalines;
25.12.2017
;

proc print;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jul 2019 15:39:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-MAINFRAME-DATE-FORMAT/m-p/572413#M161533</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-07-10T15:39:06Z</dc:date>
    </item>
  </channel>
</rss>

