× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



midrange-l-request@xxxxxxxxxxxx wrote:

>  11. jobnumber in a cl (Hatzenbeler, Tim)
>
>I doubt this is possible, but I have seen you guys come up with some great
>ideas in the past...
>
>I have a CL, that submits a job, is there any way, to retrieve the job
>number of the submitted job?
>
>With out modify the submitted job to pass back the job number via
>parameters, or data area or file...  I would like to avoid customizing the
>called job...

Tim:

Test the following program:

--------------- Begin pgm -------
pgm

   dcl        &JobUser        *char    10     value( ' ' )
   dcl        &MsgId          *char     7     value( ' ' )
   dcl        &MsgDta         *char   128     value( ' ' )
   dcl        &MsgDtaLen      *dec  (   5 0 ) value( 0 )

   rtvjoba    user( &JobUser )

   sbmjob     cmd( SNDMSG MSG(HI) TOMSGQ( &JobUser ) )  +
                job( TSTSBMJOB )

   rcvmsg     msgtype( *COMP ) rmv( *NO )  +
                msgdta( &MsgDta )          +
                msgdtalen( &MsgDtaLen )    +
                msgid( &MsgId )

dmpclpgm

   if ( &MsgId *eq 'CPC1221' )    do
      sndpgmmsg  msg( 'Got it.' ) topgmq( *EXT )
   enddo

   call       QCMD

return
endpgm
--------------- End pgm ---------

Note that submitted job number should be found in positions 21-26 of the 
&MsgDta variable after the *COMP message is received from the program message 
queue. Compare the dumped contents of &MsgDta against the message description 
of CPC1221 for more detail.

There are numerous variations on this. This is a fairly simple one, but perhaps 
instructive enough.

Tom Liotta

-- 
Tom Liotta
The PowerTech Group, Inc.
19426 68th Avenue South
Kent, WA 98032
Phone  253-872-7788 x313
Fax    253-872-7904
http://www.powertech.com


__________________________________________________________________
Introducing the New Netscape Internet Service. 
Only $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need. 

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.