|
Jon,
Sorry I can't give you a complete program but here is a snippet that might
answer your questions. Basically, you have to create a user space (QUSCRTUS)
for QBNLPGMI to write its output into and then delete it (QUSDLTUS) when you
are done.
-Marty
/********************************************************************/
/* Generic header returned in userspaces following a call to */
/* a "LIST" module. */
/********************************************************************/
typedef _Packed struct header_struct_bn {
char user_data[64];
int generic_header_size;
char header_version[4];
char format_name[8];
char srvpgm_name[10];
char time_generated[13];
char information_status;
int usrspc_used;
int parm_section_offset;
int parm_section_size;
int header_section_offset;
int header_section_size;
int list_section_offset;
int list_section_size;
int number_of_entries;
int size_of_entry;
int CCSID_of_entry;
char country_id[2];
char language_id[2];
char subsetted_list_indicator;
char reserved[42];
} header_struct_bn_t;
/****** Error Code structure ******/
struct errcode {
int bytes_provided ;
int bytes_available ;
char exception_id[7] ;
char reserved ;
char *exception_data ;
} ErrCode ;
/****** qualified program name ******/
char Pgm_and_lib[21] ;
void get_ILE_info( void ) {
char uspace_name[21] = {"USPBNLINFOQTEMP "};
char description[50];
int count;
header_struct_bn_t *header;
char *list_section;
Qbn_LPGMI_PGML0100_t *mod_info;
char dt1[20];
char dt2[20];
memset(description, ' ', sizeof(description));
ErrCode.bytes_provided = 0 ;
QUSCRTUS( uspace_name, /* user space name */
" ", /* extended attribute */
10240, /* user space size */
" ", /* initial value */
"*USE ", /* public authority */
description, /* text description */
"*YES ", /* replace */
(char*)&ErrCode ) ; /* exception output */
ErrCode.bytes_provided = 0 ;
/* call AS/400 program information API */
QBNLPGMI( uspace_name, /* response area */
"PGML0100", /* response format */
Pgm_and_lib, /* input parms */
(char*)&ErrCode ) ; /* exception output */
ErrCode.bytes_provided = 0 ;
QUSPTRUS( uspace_name, /* user space name */
&header, /* ptr to user space */
(char*)&ErrCode ) ; /* exception output */
list_section = (char *)header;
list_section = list_section + header->list_section_offset;
mod_info = (Qbn_LPGMI_PGML0100_t *) list_section;
dspmsg("This is an ILE program bound from %d modules:",
header->number_of_entries );
count = 0;
while (count < header->number_of_entries) {
memcpy(dt1,fixup(mod_info->Module_Creation_Timestamp),sizeof(dt1) );
memcpy(dt2,fixup(mod_info->Source_File_Updated_Timestamp),sizeof(dt2) );
dspmsg("Module %.10s/%.10s ----------- Created %s from "
"Source %.10s/%.10s(%.10s) Updated %s.",
mod_info->Bound_Module_Library_Name,
mod_info->Bound_Module_Name,
dt1,
mod_info->Source_File_Library_Name,
mod_info->Source_File_Name,
mod_info->Source_File_Member,
dt2 );
count++;
mod_info++;
}
ErrCode.bytes_provided = 0 ;
QUSDLTUS( uspace_name, /* user space name */
(char*)&ErrCode ) ; /* exception output */
return;
}
------------------------------
date: Tue, 25 Jul 2006 16:42:25 -0500
from: "Jon Sinner" <JSinner@xxxxxxxx>
subject: QBNLPGMI API
Does anybody have a working example of the QBNLPGMI API they would be
willing to post.
I have searched the archives and have not found an example.
I am somewhat confused about the user space requirement in the Required
Parameter Group
Thanks
Jon
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.