 




<?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: Data selection criteria to pull last months information</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/data-selection-criteria-to-pull-last-months-information/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/data-selection-criteria-to-pull-last-months-information/</link>
	<description></description>
	<lastBuildDate>Wed, 22 May 2013 05:05:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/data-selection-criteria-to-pull-last-months-information/#comment-70935</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Fri, 27 Nov 2009 10:26:05 +0000</pubDate>
		<guid isPermaLink="false">#comment-70935</guid>
		<description><![CDATA[I apologize for late response. I must have gotten pulled into too many work issues around that time and neglected this.

&lt;i&gt;I access Query utilities and Work with Queries to submit each query individually.

I go into each query that require the date to be reset to the previous month and change the julian date range before running the queries.&lt;/i&gt;

It&#039;s unfortunate this is a Query/400 issue. It would be far easier if these had been converted to Query Manager queries a decade or so ago when Query/400 became obsolete. But changes can still be made, even if the QM commands need to execute the modified Query/400 queries.

Before going into any details, you should review the &lt;a href=&quot;http://publib.boulder.ibm.com/iseries/v5r1/ic2924/info/q400/rbaf9mst.pdf&quot;&gt;Selecting records for an OfficeVision dependent column list in Query/400&lt;/a&gt; topic in Chapter 7, Selecting records in Query/400, of the Query/400 Use manual. Although the topic goes back to the (obsolete) OfficeVision product, the technique still works and can be of good use in a case such as yours. It provides a way to embed a reference in the query to a parameter value that you supply when you run the query. The parameter will be the date that you are changing every month.

The Query/400 product can&#039;t actually handle running this way, but Query Manager can. Also, QM can be used to both handle the date parameter and run the Query/400 query. The STRQMQRY command will be used to do the work.

Look through the topic to see the kinds of steps that will be done. Be aware that references to any &quot;query or file&quot; that your query will become dependent upon won&#039;t ever actually exist. Don&#039;t get sidetracked into thinking the topic is inappropriate. Your query won&#039;t actually receive the date value from any file. You simply need to make changes &lt;b&gt;&lt;i&gt;as if&lt;/i&gt;&lt;/b&gt; a file will supply the date value. It will be handled without a file ever actually existing.

A similar QM query would do this directly. A Query/400 query needs some help. (You might consider converting them now.)

I&#039;ll add this item to my WatchList to try to get back much quicker next time.

Tom]]></description>
		<content:encoded><![CDATA[<p>I apologize for late response. I must have gotten pulled into too many work issues around that time and neglected this.</p>
<p><i>I access Query utilities and Work with Queries to submit each query individually.</p>
<p>I go into each query that require the date to be reset to the previous month and change the julian date range before running the queries.</i></p>
<p>It&#8217;s unfortunate this is a Query/400 issue. It would be far easier if these had been converted to Query Manager queries a decade or so ago when Query/400 became obsolete. But changes can still be made, even if the QM commands need to execute the modified Query/400 queries.</p>
<p>Before going into any details, you should review the <a href="http://publib.boulder.ibm.com/iseries/v5r1/ic2924/info/q400/rbaf9mst.pdf">Selecting records for an OfficeVision dependent column list in Query/400</a> topic in Chapter 7, Selecting records in Query/400, of the Query/400 Use manual. Although the topic goes back to the (obsolete) OfficeVision product, the technique still works and can be of good use in a case such as yours. It provides a way to embed a reference in the query to a parameter value that you supply when you run the query. The parameter will be the date that you are changing every month.</p>
<p>The Query/400 product can&#8217;t actually handle running this way, but Query Manager can. Also, QM can be used to both handle the date parameter and run the Query/400 query. The STRQMQRY command will be used to do the work.</p>
<p>Look through the topic to see the kinds of steps that will be done. Be aware that references to any &#8220;query or file&#8221; that your query will become dependent upon won&#8217;t ever actually exist. Don&#8217;t get sidetracked into thinking the topic is inappropriate. Your query won&#8217;t actually receive the date value from any file. You simply need to make changes <b><i>as if</i></b> a file will supply the date value. It will be handled without a file ever actually existing.</p>
<p>A similar QM query would do this directly. A Query/400 query needs some help. (You might consider converting them now.)</p>
<p>I&#8217;ll add this item to my WatchList to try to get back much quicker next time.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: teandy</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/data-selection-criteria-to-pull-last-months-information/#comment-70151</link>
		<dc:creator>teandy</dc:creator>
		<pubDate>Mon, 09 Nov 2009 21:28:08 +0000</pubDate>
		<guid isPermaLink="false">#comment-70151</guid>
		<description><![CDATA[I just realized that you said you were using julian dates.  If you change the date format in the D specs to be *JUL instead of *MDY, the code will work the same.

Also it should be pseudo code not psudo code.]]></description>
		<content:encoded><![CDATA[<p>I just realized that you said you were using julian dates.  If you change the date format in the D specs to be *JUL instead of *MDY, the code will work the same.</p>
<p>Also it should be pseudo code not psudo code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: teandy</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/data-selection-criteria-to-pull-last-months-information/#comment-70139</link>
		<dc:creator>teandy</dc:creator>
		<pubDate>Mon, 09 Nov 2009 17:47:06 +0000</pubDate>
		<guid isPermaLink="false">#comment-70139</guid>
		<description><![CDATA[Here is a little bit of psudo code to get you started.

Run your program on the first day of the month.

&lt;pre&gt;

d  monthend       s               d   datfmt(*mdy)    
d  monthstart     s               d   datfmt(*mdy)    
d  lastdayofmon   s              2  0 inz(0)          

/free

   monthend = %date() - %days(1);       // get the end of the previous month.             
   lastdayofmon = %subdt(monthend : *days);    // extract month number of days          
   monthstart = monthend - %days(lastdayofmon - 1);   // get the beginning of the month

/end-free

&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>Here is a little bit of psudo code to get you started.</p>
<p>Run your program on the first day of the month.</p>
<pre>

d  monthend       s               d   datfmt(*mdy)    
d  monthstart     s               d   datfmt(*mdy)    
d  lastdayofmon   s              2  0 inz(0)          

/free

   monthend = %date() - %days(1);       // get the end of the previous month.             
   lastdayofmon = %subdt(monthend : *days);    // extract month number of days          
   monthstart = monthend - %days(lastdayofmon - 1);   // get the beginning of the month

/end-free

</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: clhalfa</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/data-selection-criteria-to-pull-last-months-information/#comment-70065</link>
		<dc:creator>clhalfa</dc:creator>
		<pubDate>Fri, 06 Nov 2009 14:25:11 +0000</pubDate>
		<guid isPermaLink="false">#comment-70065</guid>
		<description><![CDATA[I access Query utilities and Work with Queries to submit each query individually.

I go into each query that require the date to be reset to the previous month and change the julian date range before running the queries.

The first query that I run is a history pull to extract the previous months data.  From there the series of queries have different formats, data selections and sort sequences.  

I would like a program to automatically change the dates or be able to pull the previous month&#039;s history to a file and from there have a robot that runs the series of queries in sequence to build the various files and import them into excel.  

The problem I need to overcome is how to set the data selection so that it knows to select the previous months history without having to go into the query and reset the data selection criteria for the julian date each month.]]></description>
		<content:encoded><![CDATA[<p>I access Query utilities and Work with Queries to submit each query individually.</p>
<p>I go into each query that require the date to be reset to the previous month and change the julian date range before running the queries.</p>
<p>The first query that I run is a history pull to extract the previous months data.  From there the series of queries have different formats, data selections and sort sequences.  </p>
<p>I would like a program to automatically change the dates or be able to pull the previous month&#8217;s history to a file and from there have a robot that runs the series of queries in sequence to build the various files and import them into excel.  </p>
<p>The problem I need to overcome is how to set the data selection so that it knows to select the previous months history without having to go into the query and reset the data selection criteria for the julian date each month.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/data-selection-criteria-to-pull-last-months-information/#comment-70053</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Fri, 06 Nov 2009 02:25:17 +0000</pubDate>
		<guid isPermaLink="false">#comment-70053</guid>
		<description><![CDATA[&lt;i&gt;I run a series of queries...&lt;/i&gt;

How? By typing an option on a menu? or Submitting a job that calls a program? or Calling programs from a command line? Executing a series of STRQMQRY (or RUNQRY) commands...? Are multiple queries run because of multiple files or just for multiple reports from a single file?

&lt;i&gt;Currently I am setting the date range for the julian dates.&lt;/i&gt;

How? By changing each query before running? (QM query? Query/400? STRSQL? Web query? OPNQRYF? Other?) Do you type Julian dates or are the files defined with Julian dates and your input dates are converted to Julian? Other...?

&lt;i&gt;I would like to automate this series of queries and need a way to automate the data selection criteria so it will automatically pull the previous months information.&lt;/i&gt;

One general interpretation is maybe --

You have a file(s) that you run monthly reports from, generally using the prior month&#039;s data. The reports have different formats and possibly different sort sequencings.

You&#039;d like this series of reports to happen automatically at (or very soon after) the start of every month. The series should know what month&#039;s data to use because the system already knows the current date and, therefore, knows the current month, and should figure out the prior month&#039;s records.

Close?

Tom]]></description>
		<content:encoded><![CDATA[<p><i>I run a series of queries&#8230;</i></p>
<p>How? By typing an option on a menu? or Submitting a job that calls a program? or Calling programs from a command line? Executing a series of STRQMQRY (or RUNQRY) commands&#8230;? Are multiple queries run because of multiple files or just for multiple reports from a single file?</p>
<p><i>Currently I am setting the date range for the julian dates.</i></p>
<p>How? By changing each query before running? (QM query? Query/400? STRSQL? Web query? OPNQRYF? Other?) Do you type Julian dates or are the files defined with Julian dates and your input dates are converted to Julian? Other&#8230;?</p>
<p><i>I would like to automate this series of queries and need a way to automate the data selection criteria so it will automatically pull the previous months information.</i></p>
<p>One general interpretation is maybe &#8211;</p>
<p>You have a file(s) that you run monthly reports from, generally using the prior month&#8217;s data. The reports have different formats and possibly different sort sequencings.</p>
<p>You&#8217;d like this series of reports to happen automatically at (or very soon after) the start of every month. The series should know what month&#8217;s data to use because the system already knows the current date and, therefore, knows the current month, and should figure out the prior month&#8217;s records.</p>
<p>Close?</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: teandy</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/data-selection-criteria-to-pull-last-months-information/#comment-70041</link>
		<dc:creator>teandy</dc:creator>
		<pubDate>Thu, 05 Nov 2009 21:09:28 +0000</pubDate>
		<guid isPermaLink="false">#comment-70041</guid>
		<description><![CDATA[Would it not be cleaner and more efficient to consolidate your &quot;series of queries&quot; down to maybe one or two programs?  Say one CL and one RPGLE?  That would afford you far more flexibility for date manipulation, data extraction and delivery.

You could set up the job on the job scheduler to run at the first of each month and not have to “remember” to run the option. Also, can convert the report  to excel, PDF, or even plain text and have the program email the report to a predefined distribution list.]]></description>
		<content:encoded><![CDATA[<p>Would it not be cleaner and more efficient to consolidate your &#8220;series of queries&#8221; down to maybe one or two programs?  Say one CL and one RPGLE?  That would afford you far more flexibility for date manipulation, data extraction and delivery.</p>
<p>You could set up the job on the job scheduler to run at the first of each month and not have to “remember” to run the option. Also, can convert the report  to excel, PDF, or even plain text and have the program email the report to a predefined distribution list.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aceofdelts</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/data-selection-criteria-to-pull-last-months-information/#comment-70032</link>
		<dc:creator>aceofdelts</dc:creator>
		<pubDate>Thu, 05 Nov 2009 20:01:06 +0000</pubDate>
		<guid isPermaLink="false">#comment-70032</guid>
		<description><![CDATA[A non-query approach is to copy your transactions into work file(s) and run the queries from there (selecting all records). Easy enough to automate the date used for work file creation (e.g. RPG gets date (CCYYJJJ or whatever format fits your data) and passes it to CL who does CPYF (or equivalent).
Downside is a large transaction file gives you performance and disk space issues.
Upside is you could expand this into a way to rerun prior months, view current month, etc.]]></description>
		<content:encoded><![CDATA[<p>A non-query approach is to copy your transactions into work file(s) and run the queries from there (selecting all records). Easy enough to automate the date used for work file creation (e.g. RPG gets date (CCYYJJJ or whatever format fits your data) and passes it to CL who does CPYF (or equivalent).<br />
Downside is a large transaction file gives you performance and disk space issues.<br />
Upside is you could expand this into a way to rerun prior months, view current month, etc.</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.040 seconds using memcached
Object Caching 351/357 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-22 10:23:31 -->