 




<?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: WRKJOBSCDE every *other* week</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/wrkjobscde-every-other-week/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/wrkjobscde-every-other-week/</link>
	<description></description>
	<lastBuildDate>Sat, 25 May 2013 05:16:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: karenl</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/wrkjobscde-every-other-week/#comment-40436</link>
		<dc:creator>karenl</dc:creator>
		<pubDate>Tue, 08 Aug 2006 04:02:40 +0000</pubDate>
		<guid isPermaLink="false">#comment-40436</guid>
		<description><![CDATA[Another possibilty is to write a program which will resubmit the job each time it runs. The advantage to this is that you can submit the job to whatever time interval you want]]></description>
		<content:encoded><![CDATA[<p>Another possibilty is to write a program which will resubmit the job each time it runs. The advantage to this is that you can submit the job to whatever time interval you want</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: astradyne</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/wrkjobscde-every-other-week/#comment-40437</link>
		<dc:creator>astradyne</dc:creator>
		<pubDate>Thu, 03 Aug 2006 16:01:25 +0000</pubDate>
		<guid isPermaLink="false">#comment-40437</guid>
		<description><![CDATA[In the past when I&#039;ve had to do similar, I&#039;ve scheduled the job to run weekly and then used a data area to keep track of which week of the run cycle I&#039;m in.

The following code snippet should give you an idea of how you would have a job check itself for running every three weeks, i.e. weeks 1, 4, 7, 10, etc...

             PGM                                                       
                                                                       
             DCL        VAR(&amp;WEEKNO)    TYPE(*DEC)  LEN(1 0)           
             DCL        VAR(&amp;DTAARA)    TYPE(*CHAR) LEN(10)  VALUE(&#039;MYWEEKNO&#039;)
             DCL        VAR(&amp;DTAARALIB) TYPE(*CHAR) LEN(10)  VALUE(&#039;QGPL&#039;)
             DCL        VAR(&amp;NOWEEKS)   TYPE(*DEC)  LEN(1 0) VALUE(3)  
                                                                       
/* Retrieve the current &quot;week number&quot; from the data area.  If the    */
/* data area doesn&#039;t exist then create it...                         */
                                                                       
             RTVDTAARA  DTAARA(&amp;DTAARALIB/&amp;DTAARA) RTNVAR(&amp;WEEKNO)     
             MONMSG     CPF1015 EXEC(DO)                               
             CRTDTAARA  DTAARA(&amp;DTAARALIB/&amp;DTAARA) TYPE(*DEC) LEN(1 +  
                          0) VALUE(0)                                  
               CHGVAR     VAR(&amp;WEEKNO) VALUE(0)                        
             ENDDO                                                     
                                                                       
/* Increase the &quot;week number&quot; by 1 and then compare it to the run    */
/* frequency.  If the Week Number is greater than the frequency then */
/* reset it to &quot;1&quot; and update the data area...                       */
                                                                       
             CHGVAR     VAR(&amp;WEEKNO) VALUE(&amp;WEEKNO + 1)                
             IF         COND(&amp;WEEKNO *GT &amp;NOWEEKS) THEN(CHGVAR +       
                          VAR(&amp;WEEKNO) VALUE(1))                       
                                                                       
             CHGDTAARA  DTAARA(&amp;DTAARALIB/&amp;DTAARA) VALUE(&amp;WEEKNO)      
                                                                       
/* If this is not the 1st week of the run cycle then exit the CL...  */
                                                                       
             IF         COND(&amp;WEEKNO *NE 1) THEN(RETURN)               
                                                                       
/* ...otherwise continue with the job...                             */
                                                                       
                                                                       
                    
                    
             ENDPGM 

The data area name and library and the run frequency are coded in variables to allow for easier maintenance and portability.  With a little modification the program can be adapted to accept these variables as parameters and return a flag identifying whether the calling CL should continue or not.

All the best

Jonathan]]></description>
		<content:encoded><![CDATA[<p>In the past when I&#8217;ve had to do similar, I&#8217;ve scheduled the job to run weekly and then used a data area to keep track of which week of the run cycle I&#8217;m in.</p>
<p>The following code snippet should give you an idea of how you would have a job check itself for running every three weeks, i.e. weeks 1, 4, 7, 10, etc&#8230;</p>
<p>             PGM                                                       </p>
<p>             DCL        VAR(&amp;WEEKNO)    TYPE(*DEC)  LEN(1 0)<br />
             DCL        VAR(&amp;DTAARA)    TYPE(*CHAR) LEN(10)  VALUE(&#8216;MYWEEKNO&#8217;)<br />
             DCL        VAR(&amp;DTAARALIB) TYPE(*CHAR) LEN(10)  VALUE(&#8216;QGPL&#8217;)<br />
             DCL        VAR(&amp;NOWEEKS)   TYPE(*DEC)  LEN(1 0) VALUE(3)  </p>
<p>/* Retrieve the current &#8220;week number&#8221; from the data area.  If the    */<br />
/* data area doesn&#8217;t exist then create it&#8230;                         */</p>
<p>             RTVDTAARA  DTAARA(&amp;DTAARALIB/&amp;DTAARA) RTNVAR(&amp;WEEKNO)<br />
             MONMSG     CPF1015 EXEC(DO)<br />
             CRTDTAARA  DTAARA(&amp;DTAARALIB/&amp;DTAARA) TYPE(*DEC) LEN(1 +<br />
                          0) VALUE(0)<br />
               CHGVAR     VAR(&amp;WEEKNO) VALUE(0)<br />
             ENDDO                                                     </p>
<p>/* Increase the &#8220;week number&#8221; by 1 and then compare it to the run    */<br />
/* frequency.  If the Week Number is greater than the frequency then */<br />
/* reset it to &#8220;1&#8243; and update the data area&#8230;                       */</p>
<p>             CHGVAR     VAR(&amp;WEEKNO) VALUE(&amp;WEEKNO + 1)<br />
             IF         COND(&amp;WEEKNO *GT &amp;NOWEEKS) THEN(CHGVAR +<br />
                          VAR(&amp;WEEKNO) VALUE(1))                       </p>
<p>             CHGDTAARA  DTAARA(&amp;DTAARALIB/&amp;DTAARA) VALUE(&amp;WEEKNO)      </p>
<p>/* If this is not the 1st week of the run cycle then exit the CL&#8230;  */</p>
<p>             IF         COND(&amp;WEEKNO *NE 1) THEN(RETURN)               </p>
<p>/* &#8230;otherwise continue with the job&#8230;                             */</p>
<p>             ENDPGM </p>
<p>The data area name and library and the run frequency are coded in variables to allow for easier maintenance and portability.  With a little modification the program can be adapted to accept these variables as parameters and return a flag identifying whether the calling CL should continue or not.</p>
<p>All the best</p>
<p>Jonathan</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/8 queries in 0.014 seconds using memcached
Object Caching 283/284 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-25 07:49:41 -->