 




<?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: How to easily perform date conversions in RPGLE (Including Substringing!)</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/how-to-easily-perform-date-conversions-in-rpgle-including-substringing/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-easily-perform-date-conversions-in-rpgle-including-substringing/</link>
	<description></description>
	<lastBuildDate>Sat, 18 May 2013 11:56:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: TomLiotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-easily-perform-date-conversions-in-rpgle-including-substringing/#comment-117152</link>
		<dc:creator>TomLiotta</dc:creator>
		<pubDate>Mon, 11 Mar 2013 04:34:48 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/?p=281584#comment-117152</guid>
		<description><![CDATA[I ran across an old TechTarget article, &lt;a href=&quot;http://search400.techtarget.com/tip/RPG-free-format-date-conversion-cheat-sheet&quot; rel=&quot;nofollow&quot;&gt;RPG free-format date-conversion cheat sheet&lt;/A&gt;, that might have one or more conversions you don&#039;t have. I didn&#039;t check them all nor compare against yours.
&#160;
I did find probable&#160;typo bugs between statements 31.00 and 45.00 where many 7-digit conversions should be specified as 8-digits. Also, even though the article contains a source module that can be compiled and run, the statements conflict with other statements. As values are changed, later statements are affected.
&#160;
One technique I don&#039;t see in your examples nor in the linked article is the use of DS subfields. By referencing basic data definitions, operations involving substringing can&#160;sometimes be eliminated.
&#160;
Tom]]></description>
		<content:encoded><![CDATA[<p>I ran across an old TechTarget article, <a href="http://search400.techtarget.com/tip/RPG-free-format-date-conversion-cheat-sheet" rel="nofollow">RPG free-format date-conversion cheat sheet</a>, that might have one or more conversions you don&#8217;t have. I didn&#8217;t check them all nor compare against yours.<br />
&nbsp;<br />
I did find probable&nbsp;typo bugs between statements 31.00 and 45.00 where many 7-digit conversions should be specified as 8-digits. Also, even though the article contains a source module that can be compiled and run, the statements conflict with other statements. As values are changed, later statements are affected.<br />
&nbsp;<br />
One technique I don&#8217;t see in your examples nor in the linked article is the use of DS subfields. By referencing basic data definitions, operations involving substringing can&nbsp;sometimes be eliminated.<br />
&nbsp;<br />
Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aceofdelts</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-easily-perform-date-conversions-in-rpgle-including-substringing/#comment-116844</link>
		<dc:creator>aceofdelts</dc:creator>
		<pubDate>Thu, 28 Feb 2013 17:25:59 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/?p=281584#comment-116844</guid>
		<description><![CDATA[Before IBM came out with the DATE type fields and the Duration op codes, we would convert our dates to Day of Century and simply subtract to get duration. A divide-by-7 with MVR would tell you the day of the week. 
The &#039;50-year convention&#039; for determining century is another one that we did a little differently ... had a stand-alone program to call &amp; pass the 6 digit &amp; get the 8 digit return parm. The advantage was the ability to redo the scheme by changing just 1 program.
Yes, these techniques are mostly useless now, but I&#039;ll run into situations now &amp; then where it&#039;s handy. Mostly useful in decifering other peoples code.]]></description>
		<content:encoded><![CDATA[<p>Before IBM came out with the DATE type fields and the Duration op codes, we would convert our dates to Day of Century and simply subtract to get duration. A divide-by-7 with MVR would tell you the day of the week.<br />
The &#8217;50-year convention&#8217; for determining century is another one that we did a little differently &#8230; had a stand-alone program to call &amp; pass the 6 digit &amp; get the 8 digit return parm. The advantage was the ability to redo the scheme by changing just 1 program.<br />
Yes, these techniques are mostly useless now, but I&#8217;ll run into situations now &amp; then where it&#8217;s handy. Mostly useful in decifering other peoples code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TomLiotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-easily-perform-date-conversions-in-rpgle-including-substringing/#comment-116788</link>
		<dc:creator>TomLiotta</dc:creator>
		<pubDate>Wed, 27 Feb 2013 13:47:09 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/?p=281584#comment-116788</guid>
		<description><![CDATA[A big reason it&#039;s not as common as the knowledge could be is that those who learn solid SQL techniques tend to go on to better jobs. Those who don&#039;t, tend to stay behind. That leads to a shrinking concentration centered around older technologies such as RPGII and S/36 code.
Effort tends to focus on keeping the old file structures going. There&#039;s no time to put redesigned databases in place because time is taken up with code like subtracting 28 days from 6-digit numeric dates.
&#160;
Now, you have definitely recognized that category of problem for developers and you decided to build&#160;library of code. You&#039;ll be able to reference it for many programs to come. And, over time, more and more of your programs will be using recognizeable code fragments.
&#160;
One thing I&#039;ve been sarching for is a code library that was made available some 12 or 15 years ago (more?)&#160;called something like &quot;The Ulimate Date Routines&quot;.&#160; It&#039;s been so long that I can&#039;t remember who put it together. (Bob Cozzi keeps coming to mind, but it only sems partly right for some reason.) I was hoping to track it down to help you out, but I still haven&#039;t hit on it. It&#039;s been update once or twice as new native functions have been released.
&#160;
For that, it&#039;s something you shouldn&#039;t have to do. But you came to a conclusion that spending the time was valuable. It&#039;s something that&#039;s been done more than once, yet somehow it&#039;s worth doing again. Why?
&#160;
Because you didn&#039;t already have the routines and you believed it would save more time in the future than the time you spent putting together. It&#039;s a near certainty that you&#039;re right, too.
&#160;
It does lead to another question, though. If your database didn&#039;t have 6-digit numeric fields or 8-byte character fields or whatever, and instead was converted to use actual DATE fields, and programming was also adapted to expect all DATE (and TIME and TIMESTAMP) fields, how many of the code snippets would be needed?
&#160;
I&#039;ve been searching for a code library that was published 10 or more years ago called something like &quot;The Ultimate Date Routines&quot;. It was a full set of RPG code snippets covering what you posted. It was updated at least once to include new date functions after they were released by IBM. I haven&#039;t been able locate any references, but I&#039;ll keep looking. (I keep thinking Bob Cozzi might have done it, but it doesn&#039;t seem totally right.)
&#160;
Anyway, I recognize the&#160;problems you&#039;re trying to solve with your collection of snippets. SQL in the right places could handle a lot of it, but it&#039;s your choice not to use it. Considering the performance and other advantages of SQL over native, though, I&#039;ll still recommend that it be investigated farther for its appropriate uses.
&#160;
Tom]]></description>
		<content:encoded><![CDATA[<p>A big reason it&#8217;s not as common as the knowledge could be is that those who learn solid SQL techniques tend to go on to better jobs. Those who don&#8217;t, tend to stay behind. That leads to a shrinking concentration centered around older technologies such as RPGII and S/36 code.<br />
Effort tends to focus on keeping the old file structures going. There&#8217;s no time to put redesigned databases in place because time is taken up with code like subtracting 28 days from 6-digit numeric dates.<br />
&nbsp;<br />
Now, you have definitely recognized that category of problem for developers and you decided to build&nbsp;library of code. You&#8217;ll be able to reference it for many programs to come. And, over time, more and more of your programs will be using recognizeable code fragments.<br />
&nbsp;<br />
One thing I&#8217;ve been sarching for is a code library that was made available some 12 or 15 years ago (more?)&nbsp;called something like &#8220;The Ulimate Date Routines&#8221;.&nbsp; It&#8217;s been so long that I can&#8217;t remember who put it together. (Bob Cozzi keeps coming to mind, but it only sems partly right for some reason.) I was hoping to track it down to help you out, but I still haven&#8217;t hit on it. It&#8217;s been update once or twice as new native functions have been released.<br />
&nbsp;<br />
For that, it&#8217;s something you shouldn&#8217;t have to do. But you came to a conclusion that spending the time was valuable. It&#8217;s something that&#8217;s been done more than once, yet somehow it&#8217;s worth doing again. Why?<br />
&nbsp;<br />
Because you didn&#8217;t already have the routines and you believed it would save more time in the future than the time you spent putting together. It&#8217;s a near certainty that you&#8217;re right, too.<br />
&nbsp;<br />
It does lead to another question, though. If your database didn&#8217;t have 6-digit numeric fields or 8-byte character fields or whatever, and instead was converted to use actual DATE fields, and programming was also adapted to expect all DATE (and TIME and TIMESTAMP) fields, how many of the code snippets would be needed?<br />
&nbsp;<br />
I&#8217;ve been searching for a code library that was published 10 or more years ago called something like &#8220;The Ultimate Date Routines&#8221;. It was a full set of RPG code snippets covering what you posted. It was updated at least once to include new date functions after they were released by IBM. I haven&#8217;t been able locate any references, but I&#8217;ll keep looking. (I keep thinking Bob Cozzi might have done it, but it doesn&#8217;t seem totally right.)<br />
&nbsp;<br />
Anyway, I recognize the&nbsp;problems you&#8217;re trying to solve with your collection of snippets. SQL in the right places could handle a lot of it, but it&#8217;s your choice not to use it. Considering the performance and other advantages of SQL over native, though, I&#8217;ll still recommend that it be investigated farther for its appropriate uses.<br />
&nbsp;<br />
Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ShatteredRaven77</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-easily-perform-date-conversions-in-rpgle-including-substringing/#comment-116785</link>
		<dc:creator>ShatteredRaven77</dc:creator>
		<pubDate>Wed, 27 Feb 2013 11:52:06 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/?p=281584#comment-116785</guid>
		<description><![CDATA[I&#039;ve never had a problem getting a programming position with the little SQL knowledge that i have or the lack of experience in embedded SQL. Most companies want their developers to write programs that can easily be maintained by future programmers. At a few places, I&#039;ve been told not to use embedded SQL just because it&#039;s not typically common knowledge with programmers anymore. I don&#039;t think it&#039;s right that you speak with a stigma on those who don&#039;t use SQL and label them as unable to think in terms of you. But thanks for taking this post to a different level. This was really about giving people an easier way to convert dates and use the tools that IBM gives us instead of sticking with the same code that programmers from the S/36 or RPGII days. I thought it would be cool to show people new ways of doing old things.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve never had a problem getting a programming position with the little SQL knowledge that i have or the lack of experience in embedded SQL. Most companies want their developers to write programs that can easily be maintained by future programmers. At a few places, I&#8217;ve been told not to use embedded SQL just because it&#8217;s not typically common knowledge with programmers anymore. I don&#8217;t think it&#8217;s right that you speak with a stigma on those who don&#8217;t use SQL and label them as unable to think in terms of you. But thanks for taking this post to a different level. This was really about giving people an easier way to convert dates and use the tools that IBM gives us instead of sticking with the same code that programmers from the S/36 or RPGII days. I thought it would be cool to show people new ways of doing old things.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TomLiotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-easily-perform-date-conversions-in-rpgle-including-substringing/#comment-116776</link>
		<dc:creator>TomLiotta</dc:creator>
		<pubDate>Wed, 27 Feb 2013 07:34:47 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/?p=281584#comment-116776</guid>
		<description><![CDATA[I&#039;m not sure&#160;I&#039;d hire programmers who weren&#039;t&#160;more comfortable with SQL than with RPG except for specific maintenance tasks, so I wouldn&#039;t run into a problem with future developers. Actually, I can&#039;t recall the last time I worked with one who wasn&#039;t comfortable with both; it was at least 15 years ago.
&#160;
I can understand the reluctance, though. It&#039;s a different mindset to think in terms of sets rather than one-at-a-time. The one-at-a-time design of most legacy programs is what leads to SQL practices that tend to complicate.
&#160;
Tom]]></description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure&nbsp;I&#8217;d hire programmers who weren&#8217;t&nbsp;more comfortable with SQL than with RPG except for specific maintenance tasks, so I wouldn&#8217;t run into a problem with future developers. Actually, I can&#8217;t recall the last time I worked with one who wasn&#8217;t comfortable with both; it was at least 15 years ago.<br />
&nbsp;<br />
I can understand the reluctance, though. It&#8217;s a different mindset to think in terms of sets rather than one-at-a-time. The one-at-a-time design of most legacy programs is what leads to SQL practices that tend to complicate.<br />
&nbsp;<br />
Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ShatteredRaven77</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-easily-perform-date-conversions-in-rpgle-including-substringing/#comment-116767</link>
		<dc:creator>ShatteredRaven77</dc:creator>
		<pubDate>Wed, 27 Feb 2013 00:59:18 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/?p=281584#comment-116767</guid>
		<description><![CDATA[I wouldn&#039;t use SQL for something like this. I actually never use SQL in my programs. It can get way to complicated, hard to follow for future programmers who aren&#039;t as versed in it and I have never had the need to. But that&#039;s only my opinion from past experiences.]]></description>
		<content:encoded><![CDATA[<p>I wouldn&#8217;t use SQL for something like this. I actually never use SQL in my programs. It can get way to complicated, hard to follow for future programmers who aren&#8217;t as versed in it and I have never had the need to. But that&#8217;s only my opinion from past experiences.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TomLiotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-easily-perform-date-conversions-in-rpgle-including-substringing/#comment-116762</link>
		<dc:creator>TomLiotta</dc:creator>
		<pubDate>Wed, 27 Feb 2013 00:05:43 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/?p=281584#comment-116762</guid>
		<description><![CDATA[I&#039;d look at creating a SQL VIEW that presented all of the same columns except that it would convert any &quot;date&quot; values into actual DATE data types. Then these conversions wouldn&#039;t be an issue at all. Often, the more code you can push below the program level into the database level, the better things will run. As time passes and the original file is replaced program-by-program with the VIEW, eventually the file can be converted to a real SQL table; and many future problems don&#039;t happen. Future code then won&#039;t need overhead of conversions. -- Tom]]></description>
		<content:encoded><![CDATA[<p>I&#8217;d look at creating a SQL VIEW that presented all of the same columns except that it would convert any &#8220;date&#8221; values into actual DATE data types. Then these conversions wouldn&#8217;t be an issue at all. Often, the more code you can push below the program level into the database level, the better things will run. As time passes and the original file is replaced program-by-program with the VIEW, eventually the file can be converted to a real SQL table; and many future problems don&#8217;t happen. Future code then won&#8217;t need overhead of conversions. &#8212; Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ShatteredRaven77</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-easily-perform-date-conversions-in-rpgle-including-substringing/#comment-116756</link>
		<dc:creator>ShatteredRaven77</dc:creator>
		<pubDate>Tue, 26 Feb 2013 18:58:38 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/?p=281584#comment-116756</guid>
		<description><![CDATA[BigKat, was really looking for various tips and tricks with date conversions than anything. I was actually only giving examples in the past where I had to do one thing or another. When I said &quot;&lt;i&gt;I&#039;d love to see if I can get the result I need with the least amount of code&quot;&lt;/i&gt;&lt;i&gt;&#160;&lt;/i&gt;I simply meant i normally try to get what i need in the least amount of code lines. I don&#039;t really have a specific question other than if anyone wanted to share some of their tips and tricks.]]></description>
		<content:encoded><![CDATA[<p>BigKat, was really looking for various tips and tricks with date conversions than anything. I was actually only giving examples in the past where I had to do one thing or another. When I said &#8220;<i>I&#8217;d love to see if I can get the result I need with the least amount of code&#8221;</i><i>&nbsp;</i>I simply meant i normally try to get what i need in the least amount of code lines. I don&#8217;t really have a specific question other than if anyone wanted to share some of their tips and tricks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BigKat</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-easily-perform-date-conversions-in-rpgle-including-substringing/#comment-116755</link>
		<dc:creator>BigKat</dc:creator>
		<pubDate>Tue, 26 Feb 2013 18:24:51 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/?p=281584#comment-116755</guid>
		<description><![CDATA[&lt;em&gt;&#160;i&#039;d love to see if I can get the result i need with the least amount of code.&#160;&#160;&#160;&lt;/em&gt;What is the result you need?&#160; At one point you are discussing 6-digit dates and later your code example has an 8-digit date and it seems to do what it should, so I am confused as to what you are looking for.]]></description>
		<content:encoded><![CDATA[<p><em>&nbsp;i&#8217;d love to see if I can get the result i need with the least amount of code.&nbsp;&nbsp;&nbsp;</em>What is the result you need?&nbsp; At one point you are discussing 6-digit dates and later your code example has an 8-digit date and it seems to do what it should, so I am confused as to what you are looking for.</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 6/9 queries in 0.017 seconds using memcached
Object Caching 380/383 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-18 13:45:49 -->