<?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: Is it possible to find the job name using job number alone in AS/400?</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/as400-job-details/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-job-details/</link>
	<description></description>
	<lastBuildDate>Wed, 19 Jun 2013 18:11:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-job-details/#comment-78882</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Tue, 06 Jul 2010 06:03:31 +0000</pubDate>
		<guid isPermaLink="false">#comment-78882</guid>
		<description><![CDATA[&lt;i&gt;I would like to know more about API, can you provide additional study material.&lt;/i&gt;

To learn about most APIs, I use CL. Once I know what to expect an API to do, I can use it in RPG (or COBOL or C or whatever) much more easily. Here&#039;s a basic CLP that accepts a job number and sends a message for every job that it finds matching that number:&lt;pre&gt;
pgm    ( +
         &amp;pChkNbr      +
       )


   dcl   &amp;pChkNbr       *char       6


   dcl   &amp;usrspc        *char      10  VALUE( &#039;#$FNDJBNBR&#039; )
   dcl   &amp;usrspclib     *char      10  VALUE( &#039;QTEMP     &#039; )

   dcl   &amp;qusrspc       *char      20

   dcl   &amp;us_hdr        *char     150   /* Space header      */
   dcl   &amp;us_lste       *char      56   /* List entry        */

   dcl   &amp;job           *char      10
   dcl   &amp;jobusr        *char      10
   dcl   &amp;jobnbr        *char       6


/* Number of list entries: Listed jobs...                           */

   dcl   &amp;NbrLstE       *dec      (7)

   dcl   &amp;offsetlst     *int
   dcl   &amp;szLstE        *int


/*  The qualified search job name...                                */
   dcl   &amp;SchJob        *char     26


   chgvar    &amp;qusrspc        ( &amp;usrspc *cat &amp;usrspclib )

/*  Create a usrspc to hold the job list data...                    */

   call  QUSCRTUS         ( +
                            &amp;qusrspc                +
                            &#039;TMPLST    &#039;            +
                            x&#039;00001000&#039;             +
                            X&#039;00&#039;                   +
                            &#039;*ALL      &#039;            +
                            &#039;Temp list by job nbr   &#039; +
                            &#039;*YES      &#039;            +
                            x&#039;0000000000000000&#039;     +
                          )

/*                                                                  */
/*  Populate the usrspc with appropriate job list data...           */
/*                                                                  */

   chgvar    &amp;SchJob         ( +
                               &#039;*ALL      &#039; *cat         +
                               &#039;*ALL      &#039; *cat         +
                               &amp;pChkNbr                  +
                             )

   call  QUSLJOB          ( +
                            &amp;qusrspc                +
                            &#039;JOBL0100&#039;              +
                            &amp;SchJob                 +
                            &#039;*ALL      &#039;            +
                            x&#039;0000000000000000&#039;     +
                            &#039;*&#039;                     +
                            x&#039;00000000&#039;             +
                            x&#039;00000000&#039;             +
                          )


/*  Retrieve the header data...                                     */

   call  QUSRTVUS         ( +
                            &amp;qusrspc                +
                            x&#039;00000001&#039;             +
                            x&#039;00000096&#039;             +
                            &amp;us_hdr                 +
                          )

   chgvar    &amp;NbrLstE        %bin( &amp;us_hdr    133 4 )


   if ( &amp;NbrLstE *eq 0 )  do
      sndpgmmsg  msgid( CPF9898 ) msgf( QCPFMSG ) +
                   msgdta( &#039;No jobs found&#039; )
      goto  Clean_up
   enddo

   chgvar    &amp;offsetlst    ( %bin( &amp;us_hdr    125 4 ) + 1 )
   chgvar    &amp;szLstE         %bin( &amp;us_hdr    137 4 )

/*                                                                  */
/*  Retrieve each list entry and increment offset...                */
/*    Count down number of list entries...                          */
/*                                                                  */

   dowhile  ( &amp;NbrLstE *gt 0 )

      call  QUSRTVUS      ( +
                            &amp;qusrspc                +
                            &amp;offsetlst              +
                            &amp;szLstE                 +
                            &amp;us_lste                +
                          )

      chgvar &amp;job            %sst( &amp;us_lste    1 10 )
      chgvar &amp;jobusr         %sst( &amp;us_lste   11 10 )
      chgvar &amp;jobnbr         %sst( &amp;us_lste   21  6 )

      sndpgmmsg  msgid( CPF9898 ) msgf( QCPFMSG ) +
                   msgdta( +
                           &#039;Job&#039;            *bcat +
                           &amp;jobnbr          *cat  +
                           &#039;/&#039;              *cat  +
                           &amp;jobusr          *tcat +
                           &#039;/&#039;              *cat  +
                           &amp;job             *bcat +
                           &#039;found&#039;                +
                         )

      chgvar &amp;offsetlst          ( &amp;offsetlst + &amp;szLstE )
      chgvar &amp;NbrLstE            ( &amp;NbrLstE - 1 )

   enddo


Clean_up:

   dltusrspc   &amp;usrspclib/&amp;usrspc

   return

endpgm&lt;/pre&gt;
Note that the parm value will be numeric characters, so it must be enclosed in quotes if you call the program from a command line or submit to batch. It sends a message, but you would probably do something else with the values. It only reports the job name -- it doesn&#039;t report the status nor anything else. If there are multiple jobs with the same number (very unlikely but possible), a message should be returned for each one. (The history log would probably only know about the latest one if it found any at all.) Finally, it uses the simpler but less efficient QUSRTVUS API rather than the QUSPTRUS API. That&#039;s because I only have V5R3 at home (and because this coding is easy to adapt to all earlier releases).

Compile the program in batch and note the job number of the compile job. If you call the program using that number, the message should report the full job name of the compile.

If you can understand how the program works, try re-writing it in RPG or try writing it in V5R4 ILE CL and use the QUSPTRUS API. If problems appear, post a new question specific to your programming and the problem.

Tom]]></description>
		<content:encoded><![CDATA[<p><i>I would like to know more about API, can you provide additional study material.</i></p>
<p>To learn about most APIs, I use CL. Once I know what to expect an API to do, I can use it in RPG (or COBOL or C or whatever) much more easily. Here&#8217;s a basic CLP that accepts a job number and sends a message for every job that it finds matching that number:
<pre>
pgm    ( +
         &amp;pChkNbr      +
       )


   dcl   &amp;pChkNbr       *char       6


   dcl   &amp;usrspc        *char      10  VALUE( '#$FNDJBNBR' )
   dcl   &amp;usrspclib     *char      10  VALUE( 'QTEMP     ' )

   dcl   &amp;qusrspc       *char      20

   dcl   &amp;us_hdr        *char     150   /* Space header      */
   dcl   &amp;us_lste       *char      56   /* List entry        */

   dcl   &amp;job           *char      10
   dcl   &amp;jobusr        *char      10
   dcl   &amp;jobnbr        *char       6


/* Number of list entries: Listed jobs...                           */

   dcl   &amp;NbrLstE       *dec      (7)

   dcl   &amp;offsetlst     *int
   dcl   &amp;szLstE        *int


/*  The qualified search job name...                                */
   dcl   &amp;SchJob        *char     26


   chgvar    &amp;qusrspc        ( &amp;usrspc *cat &amp;usrspclib )

/*  Create a usrspc to hold the job list data...                    */

   call  QUSCRTUS         ( +
                            &amp;qusrspc                +
                            'TMPLST    '            +
                            x'00001000'             +
                            X'00'                   +
                            '*ALL      '            +
                            'Temp list by job nbr   ' +
                            '*YES      '            +
                            x'0000000000000000'     +
                          )

/*                                                                  */
/*  Populate the usrspc with appropriate job list data...           */
/*                                                                  */

   chgvar    &amp;SchJob         ( +
                               '*ALL      ' *cat         +
                               '*ALL      ' *cat         +
                               &amp;pChkNbr                  +
                             )

   call  QUSLJOB          ( +
                            &amp;qusrspc                +
                            'JOBL0100'              +
                            &amp;SchJob                 +
                            '*ALL      '            +
                            x'0000000000000000'     +
                            '*'                     +
                            x'00000000'             +
                            x'00000000'             +
                          )


/*  Retrieve the header data...                                     */

   call  QUSRTVUS         ( +
                            &amp;qusrspc                +
                            x'00000001'             +
                            x'00000096'             +
                            &amp;us_hdr                 +
                          )

   chgvar    &amp;NbrLstE        %bin( &amp;us_hdr    133 4 )


   if ( &amp;NbrLstE *eq 0 )  do
      sndpgmmsg  msgid( CPF9898 ) msgf( QCPFMSG ) +
                   msgdta( 'No jobs found' )
      goto  Clean_up
   enddo

   chgvar    &amp;offsetlst    ( %bin( &amp;us_hdr    125 4 ) + 1 )
   chgvar    &amp;szLstE         %bin( &amp;us_hdr    137 4 )

/*                                                                  */
/*  Retrieve each list entry and increment offset...                */
/*    Count down number of list entries...                          */
/*                                                                  */

   dowhile  ( &amp;NbrLstE *gt 0 )

      call  QUSRTVUS      ( +
                            &amp;qusrspc                +
                            &amp;offsetlst              +
                            &amp;szLstE                 +
                            &amp;us_lste                +
                          )

      chgvar &amp;job            %sst( &amp;us_lste    1 10 )
      chgvar &amp;jobusr         %sst( &amp;us_lste   11 10 )
      chgvar &amp;jobnbr         %sst( &amp;us_lste   21  6 )

      sndpgmmsg  msgid( CPF9898 ) msgf( QCPFMSG ) +
                   msgdta( +
                           'Job'            *bcat +
                           &amp;jobnbr          *cat  +
                           '/'              *cat  +
                           &amp;jobusr          *tcat +
                           '/'              *cat  +
                           &amp;job             *bcat +
                           'found'                +
                         )

      chgvar &amp;offsetlst          ( &amp;offsetlst + &amp;szLstE )
      chgvar &amp;NbrLstE            ( &amp;NbrLstE - 1 )

   enddo


Clean_up:

   dltusrspc   &amp;usrspclib/&amp;usrspc

   return

endpgm</pre>
<p>Note that the parm value will be numeric characters, so it must be enclosed in quotes if you call the program from a command line or submit to batch. It sends a message, but you would probably do something else with the values. It only reports the job name &#8212; it doesn&#8217;t report the status nor anything else. If there are multiple jobs with the same number (very unlikely but possible), a message should be returned for each one. (The history log would probably only know about the latest one if it found any at all.) Finally, it uses the simpler but less efficient QUSRTVUS API rather than the QUSPTRUS API. That&#8217;s because I only have V5R3 at home (and because this coding is easy to adapt to all earlier releases).</p>
<p>Compile the program in batch and note the job number of the compile job. If you call the program using that number, the message should report the full job name of the compile.</p>
<p>If you can understand how the program works, try re-writing it in RPG or try writing it in V5R4 ILE CL and use the QUSPTRUS API. If problems appear, post a new question specific to your programming and the problem.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vssagar</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-job-details/#comment-78720</link>
		<dc:creator>vssagar</dc:creator>
		<pubDate>Wed, 30 Jun 2010 07:09:04 +0000</pubDate>
		<guid isPermaLink="false">#comment-78720</guid>
		<description><![CDATA[As I am new to RPG and working with a new client, I was not able to try API.
Sarge - Thanks for a very useful tip, I was able to find most of jobs very easily. 

Tom - I would like to know more about API, can you provide additional study material. 

Thank you both

-Sagar]]></description>
		<content:encoded><![CDATA[<p>As I am new to RPG and working with a new client, I was not able to try API.<br />
Sarge &#8211; Thanks for a very useful tip, I was able to find most of jobs very easily. </p>
<p>Tom &#8211; I would like to know more about API, can you provide additional study material. </p>
<p>Thank you both</p>
<p>-Sagar</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-job-details/#comment-78712</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Wed, 30 Jun 2010 00:50:54 +0000</pubDate>
		<guid isPermaLink="false">#comment-78712</guid>
		<description><![CDATA[&lt;i&gt;you can do DspLog (Display Log) for the timeframe in question, to a printer file. ...{F16 to search...}&lt;/i&gt;

This is a useful tip for basic interactive searches.

It assumes that the timeframe of the job activity fits within the current QHST* range. Also, it assumes that the search is being done by general interactive means rather than by some automated application or operations procedure. (Technically, it also assumes that spooled file size limits won&#039;t be an issue; but that&#039;s not a major obstacle for most sites.)

Tom]]></description>
		<content:encoded><![CDATA[<p><i>you can do DspLog (Display Log) for the timeframe in question, to a printer file. &#8230;{F16 to search&#8230;}</i></p>
<p>This is a useful tip for basic interactive searches.</p>
<p>It assumes that the timeframe of the job activity fits within the current QHST* range. Also, it assumes that the search is being done by general interactive means rather than by some automated application or operations procedure. (Technically, it also assumes that spooled file size limits won&#8217;t be an issue; but that&#8217;s not a major obstacle for most sites.)</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rudedog</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-job-details/#comment-78706</link>
		<dc:creator>rudedog</dc:creator>
		<pubDate>Tue, 29 Jun 2010 23:35:12 +0000</pubDate>
		<guid isPermaLink="false">#comment-78706</guid>
		<description><![CDATA[you can do DspLog (Display Log) for the timeframe in question, to a printer file.

then just use F16 (shift  + F4) after typing the job number in the search line, when looking at the printer file with option 5.

-sarge]]></description>
		<content:encoded><![CDATA[<p>you can do DspLog (Display Log) for the timeframe in question, to a printer file.</p>
<p>then just use F16 (shift  + F4) after typing the job number in the search line, when looking at the printer file with option 5.</p>
<p>-sarge</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-job-details/#comment-78557</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Fri, 25 Jun 2010 06:15:47 +0000</pubDate>
		<guid isPermaLink="false">#comment-78557</guid>
		<description><![CDATA[The user space APIs can used in OPM CL (except the Retrieve Pointer to User Space (QUSPTRUS) API) and even REXX, so they&#039;re not too difficult to work with.

The first time can be confusing in a couple details. But once those are understood, the APIs can be used over and over again with many other APIs and for your own uses. They&#039;re used almost the same every time, so you almost just copy your code for the next usage.

A new thread about user spaces would be good for the site.

Tom]]></description>
		<content:encoded><![CDATA[<p>The user space APIs can used in OPM CL (except the Retrieve Pointer to User Space (QUSPTRUS) API) and even REXX, so they&#8217;re not too difficult to work with.</p>
<p>The first time can be confusing in a couple details. But once those are understood, the APIs can be used over and over again with many other APIs and for your own uses. They&#8217;re used almost the same every time, so you almost just copy your code for the next usage.</p>
<p>A new thread about user spaces would be good for the site.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vssagar</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/as400-job-details/#comment-78501</link>
		<dc:creator>vssagar</dc:creator>
		<pubDate>Thu, 24 Jun 2010 06:39:39 +0000</pubDate>
		<guid isPermaLink="false">#comment-78501</guid>
		<description><![CDATA[I got to do some trail and error method on this.. 

Thanks Tom.]]></description>
		<content:encoded><![CDATA[<p>I got to do some trail and error method on this.. </p>
<p>Thanks Tom.</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.038 seconds using memcached
Object Caching 337/343 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-06-19 18:23:28 -->