<?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: correct DATETIME20. with wrong century? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/correct-DATETIME20-with-wrong-century/m-p/309450#M66565</link>
    <description>&lt;P&gt;long story&lt;/P&gt;
&lt;P&gt;Just a hard coded year for information only per record.&amp;nbsp; I work at a School and it's easer to read than a term number.&amp;nbsp;&amp;nbsp; We can dump it when we are done since each record has the term indicator.&amp;nbsp;&amp;nbsp; We are stacking all the records from 50+ files once the data types are all in line and 5-10 differnt staff mebers doing this processing over the years.&amp;nbsp; Thank you for your help and attention to my coding.&amp;nbsp; -KJ&lt;/P&gt;</description>
    <pubDate>Sat, 05 Nov 2016 00:01:03 GMT</pubDate>
    <dc:creator>kjohnsonm</dc:creator>
    <dc:date>2016-11-05T00:01:03Z</dc:date>
    <item>
      <title>correct DATETIME20. with wrong century?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/correct-DATETIME20-with-wrong-century/m-p/309431#M66551</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;I just discovered that I have a relatively large data set that was incorrectly converted from yymmdd to&lt;/P&gt;
&lt;P&gt;DATETIME20.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dates still kick my hinny after a year of working with sas but in any case any date that matches this needs to have the century changed from 19 to 20&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data data.COMBOx;
set combo2;

if (year(orig_hire) &amp;lt; year(birth_date)) and (year &amp;gt; 1999) then orig_hire=

/* year(orig_hire)+100 month(orig_hire) date(orig_hire) etc*/

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know how to parse it, I&amp;nbsp;get mixed up when puting it bad together.&amp;nbsp; help please. TIA.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2016 21:44:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/correct-DATETIME20-with-wrong-century/m-p/309431#M66551</guid>
      <dc:creator>kjohnsonm</dc:creator>
      <dc:date>2016-11-04T21:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: correct DATETIME20. with wrong century?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/correct-DATETIME20-with-wrong-century/m-p/309434#M66553</link>
      <description>&lt;P&gt;Can you post some sample data please.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In general you could just use INTNX and increment it 100 years.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2016 21:56:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/correct-DATETIME20-with-wrong-century/m-p/309434#M66553</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-04T21:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: correct DATETIME20. with wrong century?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/correct-DATETIME20-with-wrong-century/m-p/309438#M66555</link>
      <description>&lt;P&gt;Oh I had not see that function before, cool.&amp;nbsp; Let me try it before going down the sample data path.&amp;nbsp;&amp;nbsp; Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2016 22:02:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/correct-DATETIME20-with-wrong-century/m-p/309438#M66555</guid>
      <dc:creator>kjohnsonm</dc:creator>
      <dc:date>2016-11-04T22:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: correct DATETIME20. with wrong century?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/correct-DATETIME20-with-wrong-century/m-p/309444#M66560</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;print&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=combo2 (&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;obs&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;10&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;noobs&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; n;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;var&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; orig_hire birth_date year; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;/*where year(orig_hire) &amp;lt; year(birth_date) and year &amp;gt; '1999';*/&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;where&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; orig_hire &amp;lt; birth_date and year &amp;gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'1999'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;orig_hire birth_date year&lt;/P&gt;
&lt;P&gt;05SEP1900:00:00:00 05JAN1957:00:00:00 2000&lt;/P&gt;
&lt;P&gt;10JUL1900:00:00:00 05MAY1970:00:00:00 2000&lt;/P&gt;
&lt;P&gt;16AUG1900:00:00:00 28JUN1969:00:00:00 2000&lt;/P&gt;
&lt;P&gt;01JAN1900:00:00:00 01APR1960:00:00:00 2000&lt;/P&gt;
&lt;P&gt;16AUG1900:00:00:00 11FEB1957:00:00:00 2000&lt;/P&gt;
&lt;P&gt;01MAY1900:00:00:00 19AUG1967:00:00:00 2000&lt;/P&gt;
&lt;P&gt;01SEP1900:00:00:00 27AUG1954:00:00:00 2000&lt;/P&gt;
&lt;P&gt;01SEP1900:00:00:00 27AUG1954:00:00:00 2000&lt;/P&gt;
&lt;P&gt;01MAR1900:00:00:00 25FEB1951:00:00:00 2000&lt;/P&gt;
&lt;P&gt;16AUG1900:00:00:00 04MAR1971:00:00:00 2000&lt;/P&gt;
&lt;P&gt;N = 10&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT size="1"&gt;my code:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT size="1"&gt;&lt;CODE class=" language-sas"&gt;data data.COMBOx;
set combo2;

/* example x=intnx('week', '17oct03'd, 6);*/
if (year(orig_hire) &amp;lt; year(birth_date)) and (year &amp;gt; 1999) then orig_hire=intnx('year', orig_hire, 100, 'S');
run;&lt;/CODE&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT size="1"&gt;Should this work?&amp;nbsp; It is bombing out.&amp;nbsp; The date is already stored as DATETIME20.&amp;nbsp; TIA.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2016 22:27:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/correct-DATETIME20-with-wrong-century/m-p/309444#M66560</guid>
      <dc:creator>kjohnsonm</dc:creator>
      <dc:date>2016-11-04T22:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: correct DATETIME20. with wrong century?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/correct-DATETIME20-with-wrong-century/m-p/309445#M66561</link>
      <description>&lt;P&gt;Rather than year, try DTYEAR to specify you're working with a date time.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2016 22:40:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/correct-DATETIME20-with-wrong-century/m-p/309445#M66561</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-04T22:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: correct DATETIME20. with wrong century?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/correct-DATETIME20-with-wrong-century/m-p/309446#M66562</link>
      <description>&lt;P&gt;I am getting hudreds of these notes then it dies. "this is the internal date"? I am giving it the field name 'orig_hire'. I tried adding datetime20. no go...:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;NOTE: Invalid argument to function INTNX('year'&lt;STRONG&gt;,-1873756800&lt;/STRONG&gt;,100,'S') at line 1599 column 60.&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;WARNING: Limit set by ERRORS= option reached.&lt;/U&gt; Further errors of this type will not be printed.&lt;/P&gt;
&lt;P&gt;AGE_0815=32 WSU_ID_Mfix= PSN_NO_Mfix= AREA_NAME=PROVOST, OFFICE OF EEO=2 SFILE=ALL_00.DBF STRM=2007 TITLE=INSTRUCTOR WORK_LOCN=PUL WSUID=09993982 TITLE_SHRT= year=2000 WSU_ID=9993982 EMPSTATRSN=00 PRIMEMPTYP=F FULL_PART=P PERM_TEMP=T SEX=M OFF_CAMPUS=&lt;/P&gt;
&lt;P&gt;HOME_DEPT=8324 WORK_COUTY=0038 RET_PLAN= SEIB_ELIG= ETHNIC=50 TENURE_IND=N CITIZENSHP=US MILITARY=K HANDICAP= TENURE_STA=N TENURE_YR=0000 HIGHDEG_CD=08 HIGHDEG_YR=93 PSN_NO=077281 ACTIVE_IND=Y PAY_AFFT=Y LEAVE_IND=N PAYRATE_CD=M HEPB_STAT=7 TIMERPT_CD=E&lt;/P&gt;
&lt;P&gt;TERM=9.0000 PAYRATE=833.330 FTE=25.00000 FULLTM_RTE=3333.33 JOB_CLASS=000260 STEP= PID_MO=00 APPT_DEPT=8324 LEAVE_RSN= SAL_VAR= RANGE= SAL_REV_AR= CLASS_TYPE=F APPT_WK_PD= NAME=SMITH,WILLIAM LELAND EMPL_STAT=A JOBGROUP=21 ANNUAL_9B=29999.97&lt;/P&gt;
&lt;P&gt;ANNUAL_12B=. ANNUAL=29999.97 AREA=01 OFMGROUP=03 DEPT_NAME=GENERAL EDUCATION HOME_AREA=01 OFM_GROUP= OFM_CLASS= TOTALIFFTE=. AREANAMEN= orig_hireC6= home_deptnum=. job_classnum=. apptdeptname_off= areaname= home_deptname_off= PSN_NO_ORIG=.&lt;/P&gt;
&lt;P&gt;SAL_RANGE= OFM= campus=Pullman WSUID_F= WSUID_Mfix= record_nbr=1 HOME_AREA_DESCR=PROVOST, OFFICE OF HOME_DEPT_DESCR=GENERAL EDUCATION annual_new=29999.97 annual_12b_new=39999.96 annual_9b_new=29999.97 emp_pri_ind=0 emp_nex_ind=1 C_emp_pri_ind=0&lt;/P&gt;
&lt;P&gt;C_emp_nex_ind=0 E_emp_pri_ind=0 E_emp_nex_ind=0 F_emp_pri_ind=0 F_emp_nex_ind=1 G_emp_pri_ind=0 G_emp_nex_ind=0 end_date=15MAY1901:00:00:00 enddate=15MAY2001:00:00:00 end_datec6=. birth_date=27SEP1967:00:00:00 statdate=16AUG1994:00:00:00 retn_date=.&lt;/P&gt;
&lt;P&gt;prob_date=. cont_empl=16AUG1900:00:00:00 orig_hire=. prob_datec6=. retn_datec6=. retdate_c8=. statdatec6=. snapshot_date=. begin_date=16AUG2000:00:00:00 cont_emplC6=. totalfte=25 sum_allfte=25 _ERROR_=1 _N_=58713&lt;/P&gt;
&lt;P&gt;NOTE: Missing values were generated as a result of performing an operation on missing values.&lt;/P&gt;
&lt;P&gt;Each place is given by: (Number of times) at (Line):(Column).&lt;/P&gt;
&lt;P&gt;22 at 1599:60&lt;/P&gt;
&lt;P&gt;NOTE: Mathematical operations could not be performed at the following places. The results of the operations have been set to missing values.&lt;/P&gt;
&lt;P&gt;Each place is given by: (Number of times) at (Line):(Column).&lt;/P&gt;
&lt;P&gt;126773 at 1599:60&lt;/P&gt;
&lt;P&gt;NOTE: There were 298416 observations read from the data set WORK.COMBO2.&lt;/P&gt;
&lt;P&gt;NOTE: The data set DATA.COMBOX has 298416 observations and 107 variables.&lt;/P&gt;
&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;
&lt;P&gt;real time 28.65 seconds&lt;/P&gt;
&lt;P&gt;cpu time 0.79 seconds&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2016 22:52:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/correct-DATETIME20-with-wrong-century/m-p/309446#M66562</guid>
      <dc:creator>kjohnsonm</dc:creator>
      <dc:date>2016-11-04T22:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: correct DATETIME20. with wrong century?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/correct-DATETIME20-with-wrong-century/m-p/309447#M66563</link>
      <description>okay the "if line" fix is:&lt;BR /&gt;if  orig_hire &amp;lt;  birth_date and year &amp;gt; '1999' and orig_hire &amp;lt;&amp;gt; . then orig_hire=intnx('dtyear', orig_hire, 100, 'S');</description>
      <pubDate>Fri, 04 Nov 2016 23:02:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/correct-DATETIME20-with-wrong-century/m-p/309447#M66563</guid>
      <dc:creator>kjohnsonm</dc:creator>
      <dc:date>2016-11-04T23:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: correct DATETIME20. with wrong century?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/correct-DATETIME20-with-wrong-century/m-p/309448#M66564</link>
      <description>&lt;P&gt;Is the year portion of that correct? Why are you storing it as a character...that could cause you issues.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2016 23:45:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/correct-DATETIME20-with-wrong-century/m-p/309448#M66564</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-04T23:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: correct DATETIME20. with wrong century?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/correct-DATETIME20-with-wrong-century/m-p/309450#M66565</link>
      <description>&lt;P&gt;long story&lt;/P&gt;
&lt;P&gt;Just a hard coded year for information only per record.&amp;nbsp; I work at a School and it's easer to read than a term number.&amp;nbsp;&amp;nbsp; We can dump it when we are done since each record has the term indicator.&amp;nbsp;&amp;nbsp; We are stacking all the records from 50+ files once the data types are all in line and 5-10 differnt staff mebers doing this processing over the years.&amp;nbsp; Thank you for your help and attention to my coding.&amp;nbsp; -KJ&lt;/P&gt;</description>
      <pubDate>Sat, 05 Nov 2016 00:01:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/correct-DATETIME20-with-wrong-century/m-p/309450#M66565</guid>
      <dc:creator>kjohnsonm</dc:creator>
      <dc:date>2016-11-05T00:01:03Z</dc:date>
    </item>
  </channel>
</rss>

