 




<?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: AS400 Query: Date Concatenation</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/as400-query-date-concatenation/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-query-date-concatenation/</link>
	<description></description>
	<lastBuildDate>Thu, 23 May 2013 13:24:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: woodengineer</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-query-date-concatenation/#comment-94999</link>
		<dc:creator>woodengineer</dc:creator>
		<pubDate>Thu, 04 Aug 2011 15:44:33 +0000</pubDate>
		<guid isPermaLink="false">#comment-94999</guid>
		<description><![CDATA[If the file is not too large, it might be worth writing a program to duplicate the records to a new file for query purposes and add a field for a single date in the format you need.]]></description>
		<content:encoded><![CDATA[<p>If the file is not too large, it might be worth writing a program to duplicate the records to a new file for query purposes and add a field for a single date in the format you need.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-query-date-concatenation/#comment-94979</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Thu, 04 Aug 2011 01:51:05 +0000</pubDate>
		<guid isPermaLink="false">#comment-94979</guid>
		<description><![CDATA[Phil&#039;s suggestion might be about as good as it gets, given the questionable design of the file records. It might be modified a little:&lt;pre&gt;
Create View Myview as
Select Year &#124;&#124; Month &#124;&#124; ‘01′ , LGRA01 ... &lt;i&gt;where LGRA01 &lt;&gt; 0&lt;/i&gt;&lt;/pre&gt;
That is, each sub-SELECT might only contribute rows for day numbers when the corresponding LGRAn field has a non-zero value. But that would be a decision you&#039;d have to make. By selecting only non-zero values, the result table could definitely be much smaller, especialy if early in a month when no days had had values set yet.

Whether it can be done with WRKQRY will have to be answered by someone very familiar with the product. I haven&#039;t used that product much since it went nearly obsolete many years ago. Nothing simple in WRKQRY comes to mind. If Query Manager is available as well, though, it&#039;s easy to do.

Tom]]></description>
		<content:encoded><![CDATA[<p>Phil&#8217;s suggestion might be about as good as it gets, given the questionable design of the file records. It might be modified a little:
<pre>
Create View Myview as
Select Year || Month || ‘01′ , LGRA01 ... <i>where LGRA01 &lt;&gt; 0</i></pre>
<p>That is, each sub-SELECT might only contribute rows for day numbers when the corresponding LGRAn field has a non-zero value. But that would be a decision you&#8217;d have to make. By selecting only non-zero values, the result table could definitely be much smaller, especialy if early in a month when no days had had values set yet.</p>
<p>Whether it can be done with WRKQRY will have to be answered by someone very familiar with the product. I haven&#8217;t used that product much since it went nearly obsolete many years ago. Nothing simple in WRKQRY comes to mind. If Query Manager is available as well, though, it&#8217;s easy to do.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sblackshaw</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-query-date-concatenation/#comment-94973</link>
		<dc:creator>sblackshaw</dc:creator>
		<pubDate>Wed, 03 Aug 2011 21:24:24 +0000</pubDate>
		<guid isPermaLink="false">#comment-94973</guid>
		<description><![CDATA[Thanks for the answers. Is there a way of doing this in Define Results Fields of AS400 query? I don&#039;t have access to a command line unfortunately.]]></description>
		<content:encoded><![CDATA[<p>Thanks for the answers. Is there a way of doing this in Define Results Fields of AS400 query? I don&#8217;t have access to a command line unfortunately.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philpl1jb</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-query-date-concatenation/#comment-94958</link>
		<dc:creator>philpl1jb</dc:creator>
		<pubDate>Wed, 03 Aug 2011 15:06:43 +0000</pubDate>
		<guid isPermaLink="false">#comment-94958</guid>
		<description><![CDATA[I would guess that a view could be made. Assuming that Year and Month are character then someting like this????  

Create View Myview as
Select Year &#124;&#124; Month &#124;&#124; &#039;01&#039; , LGRA01
union
Select Year &#124;&#124; Month &#124;&#124; &#039;02&#039; , LGRA02
union
Select Year &#124;&#124; Month &#124;&#124; &#039;03&#039; , LGRA03

etc.
You could also make a multi-format logical this way.

Phil]]></description>
		<content:encoded><![CDATA[<p>I would guess that a view could be made. Assuming that Year and Month are character then someting like this????  </p>
<p>Create View Myview as<br />
Select Year || Month || &#8217;01&#8242; , LGRA01<br />
union<br />
Select Year || Month || &#8217;02&#8242; , LGRA02<br />
union<br />
Select Year || Month || &#8217;03&#8242; , LGRA03</p>
<p>etc.<br />
You could also make a multi-format logical this way.</p>
<p>Phil</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sblackshaw</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-query-date-concatenation/#comment-94932</link>
		<dc:creator>sblackshaw</dc:creator>
		<pubDate>Wed, 03 Aug 2011 03:39:39 +0000</pubDate>
		<guid isPermaLink="false">#comment-94932</guid>
		<description><![CDATA[That&#039;s correct, any row of results will have at least 30 columns to sift through.]]></description>
		<content:encoded><![CDATA[<p>That&#8217;s correct, any row of results will have at least 30 columns to sift through.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-query-date-concatenation/#comment-94930</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Wed, 03 Aug 2011 02:42:15 +0000</pubDate>
		<guid isPermaLink="false">#comment-94930</guid>
		<description><![CDATA[&lt;i&gt;...e.g. LGRA1 is the first, LGRA2 is the second etc.&lt;/i&gt;

Is that meaning that there is no DAY field? I.e., you only know a value for &#039;day&#039; by looking to see which of the LGRAn columns have values?

Tom]]></description>
		<content:encoded><![CDATA[<p><i>&#8230;e.g. LGRA1 is the first, LGRA2 is the second etc.</i></p>
<p>Is that meaning that there is no DAY field? I.e., you only know a value for &#8216;day&#8217; by looking to see which of the LGRAn columns have values?</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wilsonalano</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-query-date-concatenation/#comment-94922</link>
		<dc:creator>wilsonalano</dc:creator>
		<pubDate>Tue, 02 Aug 2011 23:08:13 +0000</pubDate>
		<guid isPermaLink="false">#comment-94922</guid>
		<description><![CDATA[Hi,

You can try creating a LF with CONCAT.

From DDS manual :

Example 1

MTH, DAY, and YEAR are fields in the physical file that are concatenated into one field DATE in the logical file, as shown in the following example.

&#124;...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A          R RECORD1                   PFILE(PF1)
00020A            DATE                      CONCAT(MTH DAY YEAR)
     A

Regards,
Wilson]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>You can try creating a LF with CONCAT.</p>
<p>From DDS manual :</p>
<p>Example 1</p>
<p>MTH, DAY, and YEAR are fields in the physical file that are concatenated into one field DATE in the logical file, as shown in the following example.</p>
<p>|&#8230;+&#8230;.1&#8230;.+&#8230;.2&#8230;.+&#8230;.3&#8230;.+&#8230;.4&#8230;.+&#8230;.5&#8230;.+&#8230;.6&#8230;.+&#8230;.7&#8230;.+&#8230;.8<br />
00010A          R RECORD1                   PFILE(PF1)<br />
00020A            DATE                      CONCAT(MTH DAY YEAR)<br />
     A</p>
<p>Regards,<br />
Wilson</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/8 queries in 0.042 seconds using memcached
Object Caching 353/354 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-23 15:04:07 -->