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



Welcome, Walt, to the wonderful world of APIs! They're actually not that big a deal - just a well-defined (sometimes) program call.

BTW, there is a list here devoted to C, and the folks there are probably the best to go to.

Have you found the API Finder at v5r2 InfoCenter? It's a must. Go to www.iseries.ibm.com/infocenter and look under the Programming topic for APIs, then for the Finder. --- If you've not done so already, that is. ;-)

The headers will often declare char * where the doc has a char[] - the ILE Concepts section of InfoCenter will tell you more about why. Basically, the 400 was never built around null-termination, but with fixed-length buffers.

Qp0wGetJobID uses this job_id_structure struct, which, according to the doc, has 4 elements. The first 3 together make up the "qualified job name" that QUSRJOBI wants in that 4th argument, and they are in the right order. You could use the first element

(char *)QP0W_Job_ID_T.jobname       (yeah, I know, use a real variable name  )

where you have "<some job name>". And have 16 blanks in the last string. You need all of the spaces, because the 400 expects fixed length strings, not null-terminated.

The 4th element is a 16-character internal job ID that you can use instead of -- NOTE, instead of -- the qualified job name. In this case, put this element

(char *)QP0W_Job_ID_T.jobid

in the last parameter of QUSRJOBI. Then you need to put "*INT " into the 4th argument, padded out to 26 characters with blanks.

HTH
Vern

At 02:13 PM 6/4/2004, you wrote:
Ok I found the API call and have NO idea how to use it. The documentation and the header file seem to conflict.

I call it as follows:
QUSRJOBI( &(JOBI300 type structure ), sizeof(JOBI0300), "JOBI0300", "<some job name>", "16 spaces" );


I assertained the "some job name" and the "16 spaces" from what I did find out this API call from inside some
RPG code.


This does not work at all, and I get a "Job name specified not valid" before I get a CPF code ( Im assuming something
like a core dump in UNIX ).


I was assuming that I would put into the last 2 parameters for this API ( Qualified job name and Internal Job Identifier ) that
values returned from Qp0wGetJobID( pid, job_id_structure ), but I guess that is not the case.


Any idea how to fill in the paramters for QUSRJOBI, and maybe a snipet of C code of how to go to a pid returned by
spawn(), to getting a launched job's information?


TIA!

Walt Fles



Tom Daly wrote:

You can use them in C, the headers are in QSYSINC/H.


| -----Original Message-----
| From: Walt Fles [mailto:wfles@xxxxxxxxxxx]
| Sent: Friday, June 04, 2004 09:38
| To: Midrange Systems Technical Discussion
| Subject: Re: C access to a job's spooled files
|
|
| It looked like to me those are CL API calls, not C level, | am I right?
|
|
| Tom Daly wrote:
|
| >You can use QUSRJOBI to retrieve info abou tthe job and | QUSLSPL can be used
| >to return a list of spoolfiles for a job. The Work | Management API book and
| >the Print API book will help with these.
| >
| >
| >Tom D.
| >
| > | -----Original Message-----
| > | From: Walt Fles [mailto:wfles@xxxxxxxxxxx]
| > | Sent: Thursday, June 03, 2004 17:14
| > | To: Midrange Systems Technical Discussion
| > | Subject: C access to a job's spooled files
| > |
| > |
| > | All,
| > | I know if I spawn a job I can do a "Qp0wGetJobID" from | within C,
| > | but can I use that information to find a job's information | > | and also the | > | spooled files of the job,
| > | once I detect that the job has completed ( ie, via a | waitpid() ).
| > |
| > | I would like to have access to a spawned job's spooled | > | files from within | > | C, not CL, COBOL or RPG.
| > |
| > |
| > |
| > | TIA!
| > |
| > |
| > |
| > | --
| > | This is the Midrange Systems Technical Discussion | > | (MIDRANGE-L) mailing list
| > | To post a message email: MIDRANGE-L@xxxxxxxxxxxx
| > | To subscribe, unsubscribe, or change list options,
| > | visit: http://lists.midrange.com/mailman/listinfo/midrange-l
| > | or email: MIDRANGE-L-request@xxxxxxxxxxxx
| > | Before posting, please take a moment to review the archives
| > | at http://archive.midrange.com/midrange-l.
| > |
| > |
| >
| >--
| >This is the Midrange Systems Technical Discussion | (MIDRANGE-L) mailing list
| >To post a message email: MIDRANGE-L@xxxxxxxxxxxx
| >To subscribe, unsubscribe, or change list options,
| >visit: http://lists.midrange.com/mailman/listinfo/midrange-l
| >or email: MIDRANGE-L-request@xxxxxxxxxxxx
| >Before posting, please take a moment to review the archives
| >at http://archive.midrange.com/midrange-l.
| >
| >
| >
|
| --
| This is the Midrange Systems Technical Discussion | (MIDRANGE-L) mailing list
| To post a message email: MIDRANGE-L@xxxxxxxxxxxx
| To subscribe, unsubscribe, or change list options,
| visit: http://lists.midrange.com/mailman/listinfo/midrange-l
| or email: MIDRANGE-L-request@xxxxxxxxxxxx
| Before posting, please take a moment to review the archives
| at http://archive.midrange.com/midrange-l.
|
|


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



-- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.