 




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: SQL0181 error when sending PF from iSeries to PC</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/sql0181-error-when-sending-pf-from-iseries-to-pc/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/sql0181-error-when-sending-pf-from-iseries-to-pc/</link>
	<description></description>
	<lastBuildDate>Thu, 23 May 2013 07:54:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: donethat</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sql0181-error-when-sending-pf-from-iseries-to-pc/#comment-72259</link>
		<dc:creator>donethat</dc:creator>
		<pubDate>Wed, 06 Jan 2010 16:15:21 +0000</pubDate>
		<guid isPermaLink="false">#comment-72259</guid>
		<description><![CDATA[Perhaps this SQL routine I use to fix bad dates would help?
The dates in our legacy system are all CC YY MM DD. I use it to set all invalid dates to 1/1/1950.
You can easily adapt.
FYI: I&#039;m not the original author. Lost the proper attribution.
&lt;pre&gt;
UPDATE	r091128pe.cusmas AS UCM

SET	UCM.cm_chg_cn  =  19,
	UCM.cm_chg_yr  =  50,
	UCM.cm_chg_mo  =  01,
	UCM.cm_chg_da  =  01

WHERE	
/*  Any TRUE statement is an INvalid date.  */
	(	UCM.cm_chg_cn  NOT IN  ( 19, 20 )
			OR
		UCM.cm_chg_cn  =  19  AND  UCM.cm_chg_yr  NOT BETWEEN  50 AND 99
			OR
		UCM.cm_chg_cn  =  20  AND  UCM.cm_chg_yr  NOT BETWEEN  00 AND 49
			OR
		UCM.cm_chg_mo  NOT BETWEEN  01 AND 12
			OR
		UCM.cm_chg_mo  IN  ( 1, 3, 5, 7, 8, 10, 12 )  AND  UCM.cm_chg_da
							NOT BETWEEN  01 AND 31
			OR
		UCM.cm_chg_mo  IN  ( 4, 6, 9, 11 )  AND  UCM.cm_chg_da
							NOT BETWEEN  01 AND 30
			OR
		UCM.cm_chg_mo  =  2  AND  UCM.cm_chg_mo  NOT BETWEEN  01 AND 28
			OR
		UCM.cm_chg_mo  =  2  AND  UCM.cm_chg_yr  =  00  AND  UCM.cm_chg_mo
							NOT BETWEEN  01 AND 28
			OR
		UCM.cm_chg_mo  =  2  AND  UCM.cm_chg_yr  IN  ( 4, 12, 16, 20,
				24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64,
				68, 72, 76, 80, 84, 88, 92, 96 )  AND  UCM.cm_chg_mo
							NOT BETWEEN  01 AND 29
	)

WITH	NC;
&lt;/pre&gt;
Gary]]></description>
		<content:encoded><![CDATA[<p>Perhaps this SQL routine I use to fix bad dates would help?<br />
The dates in our legacy system are all CC YY MM DD. I use it to set all invalid dates to 1/1/1950.<br />
You can easily adapt.<br />
FYI: I&#8217;m not the original author. Lost the proper attribution.</p>
<pre>
UPDATE	r091128pe.cusmas AS UCM

SET	UCM.cm_chg_cn  =  19,
	UCM.cm_chg_yr  =  50,
	UCM.cm_chg_mo  =  01,
	UCM.cm_chg_da  =  01

WHERE	
/*  Any TRUE statement is an INvalid date.  */
	(	UCM.cm_chg_cn  NOT IN  ( 19, 20 )
			OR
		UCM.cm_chg_cn  =  19  AND  UCM.cm_chg_yr  NOT BETWEEN  50 AND 99
			OR
		UCM.cm_chg_cn  =  20  AND  UCM.cm_chg_yr  NOT BETWEEN  00 AND 49
			OR
		UCM.cm_chg_mo  NOT BETWEEN  01 AND 12
			OR
		UCM.cm_chg_mo  IN  ( 1, 3, 5, 7, 8, 10, 12 )  AND  UCM.cm_chg_da
							NOT BETWEEN  01 AND 31
			OR
		UCM.cm_chg_mo  IN  ( 4, 6, 9, 11 )  AND  UCM.cm_chg_da
							NOT BETWEEN  01 AND 30
			OR
		UCM.cm_chg_mo  =  2  AND  UCM.cm_chg_mo  NOT BETWEEN  01 AND 28
			OR
		UCM.cm_chg_mo  =  2  AND  UCM.cm_chg_yr  =  00  AND  UCM.cm_chg_mo
							NOT BETWEEN  01 AND 28
			OR
		UCM.cm_chg_mo  =  2  AND  UCM.cm_chg_yr  IN  ( 4, 12, 16, 20,
				24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64,
				68, 72, 76, 80, 84, 88, 92, 96 )  AND  UCM.cm_chg_mo
							NOT BETWEEN  01 AND 29
	)

WITH	NC;
</pre>
<p>Gary</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/10 queries in 0.037 seconds using memcached
Object Caching 267/273 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-23 08:06:37 -->