10 pts.
 QBNLPGMI api examples
Hello! Can anyone please help me? I didn't work with api's, and try to get information about bounded modules in ILE C programs. And I try to use QBNLPGMI api. Does anyone have some examples of using this api in C or CL programs? Thanks in advance. Dalibor

Software/Hardware used:
ASKED: March 29, 2006  11:16 AM
UPDATED: December 3, 2009  6:47 AM

Answer Wiki:
type QBNLPGMI in google, there are 598 pages on, some are samples.
Last Wiki Answer Submitted:  March 30, 2006  12:55 am  by  JPLamontre   0 pts.
All Answer Wiki Contributors:  JPLamontre   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Allready do that (before I ask question here).
90% of scores are links to IBM description of that API and the rest is in RPG. It’s not usefully for me. I need axamples in C (or ILE C)how to get list ILE programs in spool file with modules bonded to that programs.

 10 pts.

 

Ok, i’m RPG man. Can read C, not write (I’ve no C compiler installed).
I have not checked (I’m not in front of my 400) if the DSPPGM command can extract the requested information to spool.
If yes, you just have to copy the spool to a file (CPYFRMSPLF command) then work it “simply” (ie after removing heading & spacing)
If no, the API is using an user space. If you find sample in C how to uses user space, you’ve win : you only need the api parameters from the RPG sample.

for example, I’ve read recently that QSORT can sort a user space. I don’t know how it is possible to retrieve a pointer to a user space (if you know, send me the information). But a user space is only a structure exported to disk. And with the unique-space-address principle of the 400, it’s also a memory address.

If necessary, I have sample of using user space in CLP programs.

 0 pts.

 

You call it in C pretty much the same way you call it in ILE RPG. Use the includes in the H source file in library QSYSINC as a start for the prototypes and structs. Related source members are QBNLMODI, QBNLPGMI, QBNLSPGM, QBNPREPR, QBNRMODI and QBNRSPGM.

But it’s not an API to start with because it requires using other APIs before it will work. In particular, it requires the Create User Space (QUSCRTUS) and either the Retrieve User Space (QUSRTVUS) or Retrieve Pointer to User Space (QUSPTRUS) APIs.

Until you understand user spaces and the ways that “list” APIs interact with user spaces, specific list APIs such as QBNLPGMI won’t do you any good.

How about trying some user space manipulation and asking a question about them?

Tom

 107,695 pts.