<?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: ccyymmdd format in sas mainframe in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ccyymmdd-format-in-sas-mainframe/m-p/614938#M179816</link>
    <description>&lt;P&gt;It seems you want a date formatted as yymmddn8. in your macro variable, so you only need to move the century to the front:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
infile nsdate;
input @1 date $8.;
call symput('busdt',substr(date,7,2)!!substr(date,1,6));
run;

%put &amp;amp;busdt.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 03 Jan 2020 11:05:08 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-01-03T11:05:08Z</dc:date>
    <item>
      <title>ccyymmdd format in sas mainframe</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ccyymmdd-format-in-sas-mainframe/m-p/614920#M179809</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;I'm facing one issue with the current business date&amp;nbsp; in sas mainframe dataset please find the below mention input data and output screen shot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the input file contains date in a YYMMDDCC format&amp;nbsp;&lt;/P&gt;&lt;P&gt;input file name is nsdate&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;20010320&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----------------------------------------------------------------------------------------------------------------&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;above the input date and&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and the sas code has&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;------------------------------------------------------------------------&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data _null_;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;infile nsdate;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;input&amp;nbsp;@1 date yymmdd6.;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;edate=put(date,yymmdd10.);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;cudt=compree(translate(edate,' ','-'));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;call symput('busdt',cudt);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%put busdt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;--------------------------------------------------------------------------------------------&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;while run the above code we are getting century mismatch instead of&amp;nbsp; 20 it coming the 19&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;why bez the date filed has to calculate from 1960 Jan 1 to till date, but up to 2019 Dec 31 it calculates properly&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;but from 2020 it's not picking&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;RAM&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EDTE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CDTE&lt;BR /&gt;&lt;BR /&gt;-14608&amp;nbsp; &amp;nbsp; 1920-01-03&amp;nbsp; &amp;nbsp; &amp;nbsp;19200103 &amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;above the output we are getting&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;may know what it contains going negative values&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and moreover for the date field has given yymmdd6. format it must come has 200103 insted of that it given date calculation from 1960 to till date&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;kindly give some solution for above problem&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thanks &amp;amp; Regards&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Rohit&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 07:42:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ccyymmdd-format-in-sas-mainframe/m-p/614920#M179809</guid>
      <dc:creator>rohitkrishna</dc:creator>
      <dc:date>2020-01-03T07:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: ccyymmdd format in sas mainframe</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ccyymmdd-format-in-sas-mainframe/m-p/614926#M179812</link>
      <description>&lt;P&gt;The problem is that you are reading 6-character dates, when doing that you should take a look at the YEARCUTOFF option. It seems that it has been set to 1920 on your system, meaning that year values from 20 to 99 will be read as 1920 to 1999.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options yearcutoff=1950;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or something like that, that should correct the problem.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that is not good enough, you will have to read the century by itself, as I do not think that SAS has an informat like YYMMDDCC, e.g.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  infile nsdate;
  input @1 date yymmdd6. century 2.;
  if century&amp;gt;int(year(date)/100) then
    date=intnx('year',date,100,'same');
  edate=put(date,yymmdd10.);
  cudt=compree(translate(edate,' ','-'));
  call symput('busdt',cudt);
run;

%put &amp;amp;busdt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Jan 2020 08:25:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ccyymmdd-format-in-sas-mainframe/m-p/614926#M179812</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2020-01-03T08:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: ccyymmdd format in sas mainframe</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ccyymmdd-format-in-sas-mainframe/m-p/614930#M179814</link>
      <description>Hi Lassen,&lt;BR /&gt;thanks for the quick replay&lt;BR /&gt;now it working fine after changes&lt;BR /&gt;Thanks a lot lassen&lt;BR /&gt;Thanks &amp;amp; regards&lt;BR /&gt;rohit</description>
      <pubDate>Fri, 03 Jan 2020 08:54:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ccyymmdd-format-in-sas-mainframe/m-p/614930#M179814</guid>
      <dc:creator>rohitkrishna</dc:creator>
      <dc:date>2020-01-03T08:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: ccyymmdd format in sas mainframe</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ccyymmdd-format-in-sas-mainframe/m-p/614937#M179815</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/259823"&gt;@rohitkrishna&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another solution would be to read the character string, use prxchange to put&amp;nbsp; CC before YY and store the result in&amp;nbsp;a macro variable. There is no yearcutoff problem because the value is treated as a string and not read as a SAS date.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
	infile nsdate;
	input @1 date $8.;
	call symput('busdt',prxchange('s/(\d{6})(\d{2})/$2$1/',1,date));
run;
%put &amp;amp;busdt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Jan 2020 10:38:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ccyymmdd-format-in-sas-mainframe/m-p/614937#M179815</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2020-01-03T10:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: ccyymmdd format in sas mainframe</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ccyymmdd-format-in-sas-mainframe/m-p/614938#M179816</link>
      <description>&lt;P&gt;It seems you want a date formatted as yymmddn8. in your macro variable, so you only need to move the century to the front:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
infile nsdate;
input @1 date $8.;
call symput('busdt',substr(date,7,2)!!substr(date,1,6));
run;

%put &amp;amp;busdt.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Jan 2020 11:05:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ccyymmdd-format-in-sas-mainframe/m-p/614938#M179816</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-01-03T11:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: ccyymmdd format in sas mainframe</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ccyymmdd-format-in-sas-mainframe/m-p/614982#M179828</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/259823"&gt;@rohitkrishna&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi All&lt;/P&gt;
&lt;P&gt;I'm facing one issue with the current business date&amp;nbsp; in sas mainframe dataset please find the below mention input data and output screen shot&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the input file contains date in a YYMMDDCC format&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your question subject line says that the date is in CCYYMMDD format. But you say the value is YYMMDDCC. So, which is it actually?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I haven't ever seen anything with YYMMDDCC so am wanting to make sure that you are providing the correct information.&lt;/P&gt;
&lt;P&gt;Personally if I ever run into a YYMMDDCC date I am going to beat someone about the head and shoulders and yell "What were you thinking!"&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 15:34:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ccyymmdd-format-in-sas-mainframe/m-p/614982#M179828</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-01-03T15:34:51Z</dc:date>
    </item>
  </channel>
</rss>

