Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

API - Retrieve Job Description 1

Status
Not open for further replies.

Skittle

ISP
Sep 10, 2002
1,528
US
I am new to using API's and have a problem regarding the data structure associated with the rerceiver value for the Retrieve Job Description API ( 'QWDRJOBD' ).

The API definition in the ISeries Information Center lists the fields returned as offsets in a single data structure.
The first five are:-

Binary (4) Bytes Returned
Binary (4) Bytes Available
Char (10) Job Description Name
Char (10) Job Description Library Name
Char (10) User Name

Funny thing is that when I call the API the results are offset by a further four bytes that do not appear in the definition. My data structure looks like this:-

DRETURN_VALUE DS
D D1B1 4B 0
D D1B2 4B 0
D D1JOBD 10
D D1JOBDL 10
D D1USER 10

The D1JOBD, D1JOBDL and D1USER are all offset by four bytes
and so I have had to change my data structure to look like this:-

DRETURN_VALUE DS
D D1B1 4B 0
D D1B2 4B 0
D D1B3 6B 0
D D1JOBD 10
D D1JOBDL 10
D D1USER 10

Why is this?
Am I misunderstanding the lengths og Binary fields?
 
Change the binary 4 fields in the all your data structures to 10 byte integer (10I 0). You could instead just change the length to 9B 0, but using integers is more efficient (so I'm given to understand).

RPG 4 does define integers differently than in RPG 3.

In the QSYSINC library, there are templates you can copy (or use in your programs with [tt]/COPY[/tt]). The templates define a from and to position, and it does look like 4 bytes, but for binary (sort of like a packed field) it works out to 9 bytes.

For this API, see QSYSINC/QRPGLESRC(QWDRJOBD). If your system doesn't have QSYSINC, let me know and I'll post the member for QWDRJOBD.



"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci

 
It would be really helpful if you could post QSYSINC.
I don't have it on my system and its a real pain because the API manuals assume for the most part that we do have it.

QRPGSRC copy files such as QUSGEN, QUSEC and QUSLSPL for example are used in the examples but not show in thier entirity.
 
Skittle:
Here is a link on how to install the QSYSINC library.


It's included with OS/400, but is optionally installable. I hesitate to post the member verbatim on this site because, after all, it is copyrighted by IBM. You should have QSYSINC on your installation CD/tape.

If you click on:


it will take you to a link which explains (in IBM-ese) how to declare binary subfields for the API data structures in RPG IV.



"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top