× 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.



Hi Tim,

> I have a CL, that submits a job, is there any way, to retrieve the job
> number of the submitted job?

When you submit a job it puts a message in your program queue that
contains the submitted job's name/user/number.  So, it's relatively easy
to retrieve that message and get the job id from the msgdta.  Here's a
sample:

     DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(26)
     DCL VAR(&JOBNAME) TYPE(*CHAR) LEN(10)
     DCL VAR(&JOBUSER) TYPE(*CHAR) LEN(10)
     DCL VAR(&JOBNBR) TYPE(*CHAR) LEN(6)

     SBMJOB CMD(CALL MYPGM)

     RCVMSG MSGTYPE(*LAST) MSGDTA(&MSGDTA)
     CHGVAR VAR(&JOBNAME) VALUE(%SST(&MSGDTA 1  10))
     CHGVAR VAR(&JOBUSER) VALUE(%SST(&MSGDTA 11 10))
     CHGVAR VAR(&JOBNBR)  VALUE(%SST(&MSGDTA 21 6))


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.