 




<?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: FNDSTRPDM &#8211; how do i find joblog</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/fndstrpdm-how-do-i-find-joblog/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/fndstrpdm-how-do-i-find-joblog/</link>
	<description></description>
	<lastBuildDate>Sat, 25 May 2013 17:28:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: splat</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/fndstrpdm-how-do-i-find-joblog/#comment-85852</link>
		<dc:creator>splat</dc:creator>
		<pubDate>Tue, 28 Dec 2010 15:14:29 +0000</pubDate>
		<guid isPermaLink="false">#comment-85852</guid>
		<description><![CDATA[Oops, you&#039;re right.  I didn&#039;t look at the message type.  Sorry for any confusion.]]></description>
		<content:encoded><![CDATA[<p>Oops, you&#8217;re right.  I didn&#8217;t look at the message type.  Sorry for any confusion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/fndstrpdm-how-do-i-find-joblog/#comment-85819</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Tue, 28 Dec 2010 01:14:48 +0000</pubDate>
		<guid isPermaLink="false">#comment-85819</guid>
		<description><![CDATA[&lt;i&gt;You can monitor for PDM0575...&lt;/i&gt;

Unfortunately, no, you can&#039;t &#039;monitor&#039; for PDM0575 because it&#039;s sent as a *DIAG message. You can only monitor for messages sent as *ESCAPE, *STATUS or *NOTIFY messages. (Both *STATUS and *NOTIFY messages may cause surprises if any are sent.)

For *DIAG (Diagnostic) messages, you need to &#039;receive&#039; them instead of monitoring for them. And because there are often multiple *DIAG messages available to receive and they can&#039;t be requested by their message identifiers, you usually must receive *DIAG messages in a loop. You often then want to exit the loop after finding the one you&#039;re looking for.

Here&#039;s a sample CLLE that executes a FNDSTRPDM command and sends a &#039;None found.&#039; message to the user who called the program:&lt;pre&gt;
pgm


   dcl   &amp;MsgID       *char    7
   dcl   &amp;KeyVar      *char    4

   dcl   &amp;JobUser     *char   10


   rtvjoba     user( &amp;JobUser )

   fndstrpdm   string( &#039;XyzAbc&#039; ) file( mylib/QRPGLESRC ) mbr( *ALL ) +
                 option( *NONE ) prtmbrlist( *YES) prtrcds( 1 )

   rcvmsg      msgtype( *DIAG ) rmv( *NO ) keyvar( &amp;KeyVar ) msgid( &amp;MsgID )

   dountil ( &amp;MsgID *eq &#039;       &#039; )

      if ( &amp;MsgID *eq &#039;PDM0575&#039; )  do
         sndmsg   &#039;None found.&#039; tousr( &amp;JobUser )
         leave    /* Might as well leave since we found it... */
      enddo
      /* Remove this ELSE after seeing the results once... */
      else  +
         if ( &amp;MsgID *ne &#039;       &#039; )  +
            dmpclpgm

      rcvmsg   msgtype( *NEXT ) msgkey( &amp;KeyVar ) rmv( *NO ) +
                 keyvar( &amp;KeyVar ) msgid( &amp;MsgID )

   enddo

   return

endpgm&lt;/pre&gt;
The first RCVMSG will find the first available *DIAG message. It returns the message identifier and the message key associated with that message.

The message key is used as a marker in the program message. The loop receives the *NEXT message after that message key and updates the key with the *NEXT key value. And that new key becomes the marker in the next iteration of the loop.

I haven&#039;t dug deeply enough to find out why the PDM0575 can&#039;t simply be received in a loop that receives straight *DIAG messages. I had to switch over to message keys after receiving the first one. It is possibly marked as an &quot;old&quot; message somewhere inside of FNDSTRPDM itself.

Regardless, the message key method seems to find it okay.

Tom]]></description>
		<content:encoded><![CDATA[<p><i>You can monitor for PDM0575&#8230;</i></p>
<p>Unfortunately, no, you can&#8217;t &#8216;monitor&#8217; for PDM0575 because it&#8217;s sent as a *DIAG message. You can only monitor for messages sent as *ESCAPE, *STATUS or *NOTIFY messages. (Both *STATUS and *NOTIFY messages may cause surprises if any are sent.)</p>
<p>For *DIAG (Diagnostic) messages, you need to &#8216;receive&#8217; them instead of monitoring for them. And because there are often multiple *DIAG messages available to receive and they can&#8217;t be requested by their message identifiers, you usually must receive *DIAG messages in a loop. You often then want to exit the loop after finding the one you&#8217;re looking for.</p>
<p>Here&#8217;s a sample CLLE that executes a FNDSTRPDM command and sends a &#8216;None found.&#8217; message to the user who called the program:
<pre>
pgm


   dcl   &amp;MsgID       *char    7
   dcl   &amp;KeyVar      *char    4

   dcl   &amp;JobUser     *char   10


   rtvjoba     user( &amp;JobUser )

   fndstrpdm   string( 'XyzAbc' ) file( mylib/QRPGLESRC ) mbr( *ALL ) +
                 option( *NONE ) prtmbrlist( *YES) prtrcds( 1 )

   rcvmsg      msgtype( *DIAG ) rmv( *NO ) keyvar( &amp;KeyVar ) msgid( &amp;MsgID )

   dountil ( &amp;MsgID *eq '       ' )

      if ( &amp;MsgID *eq 'PDM0575' )  do
         sndmsg   'None found.' tousr( &amp;JobUser )
         leave    /* Might as well leave since we found it... */
      enddo
      /* Remove this ELSE after seeing the results once... */
      else  +
         if ( &amp;MsgID *ne '       ' )  +
            dmpclpgm

      rcvmsg   msgtype( *NEXT ) msgkey( &amp;KeyVar ) rmv( *NO ) +
                 keyvar( &amp;KeyVar ) msgid( &amp;MsgID )

   enddo

   return

endpgm</pre>
<p>The first RCVMSG will find the first available *DIAG message. It returns the message identifier and the message key associated with that message.</p>
<p>The message key is used as a marker in the program message. The loop receives the *NEXT message after that message key and updates the key with the *NEXT key value. And that new key becomes the marker in the next iteration of the loop.</p>
<p>I haven&#8217;t dug deeply enough to find out why the PDM0575 can&#8217;t simply be received in a loop that receives straight *DIAG messages. I had to switch over to message keys after receiving the first one. It is possibly marked as an &#8220;old&#8221; message somewhere inside of FNDSTRPDM itself.</p>
<p>Regardless, the message key method seems to find it okay.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: splat</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/fndstrpdm-how-do-i-find-joblog/#comment-85782</link>
		<dc:creator>splat</dc:creator>
		<pubDate>Fri, 24 Dec 2010 15:15:58 +0000</pubDate>
		<guid isPermaLink="false">#comment-85782</guid>
		<description><![CDATA[You can monitor for PDM0575 - it is an error message, albeit having a severity of 00 and not defined in QCPFMSG.]]></description>
		<content:encoded><![CDATA[<p>You can monitor for PDM0575 &#8211; it is an error message, albeit having a severity of 00 and not defined in QCPFMSG.</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.020 seconds using memcached
Object Caching 295/301 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-25 18:14:13 -->