if (((argc - 1) < 2) ((argc - 1 > 2))) /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\

We did not receive all of the required parameters so exit￿ the

\/

/\

program.

\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

{

exit(1);

}

else /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\ Copy parameters into local variables.\/ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

{

memcpy(usr_prf, argv[1], 1ð); memcpy(obj_type, argv[2], 1ð);

}

init();

proces();

done();

} /\ main \/

List Object API—ILE COBOL Example

Refer to “List Object API—OPM RPG Example” on page 5-4 for the origin example. The following program also works for OPM COBOL.

IDENTIFICATION DIVISION.

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\

 

 

\

Program:

List objects that adopt owner authority

\

 

 

\

Language:

COBOL

\

 

 

\Description: This program prints a report showing all objects

\

that adopt owner authority. The two parameters

\

passed to the program are the profile to be

\

checked and the type of objects to be listed.

\

The parameter values are the same as those

\

accepted by the QSYLOBJP API.

\

 

\APIs Used: QSYLOBJP - List Objects that Adopt Owner Authority

\

QUSCRTUS -

Create User Space

\

QUSPTRUS

-

Retrieve

Pointer to User Space

\

QUSROBJD

-

Retrieve

Object Description

\

 

 

 

 

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\

PROGRAM-ID. LISTADOPT.

ENVIRONMENT DIVISION.

CONFIGURATION SECTION. SOURCE-COMPUTER. IBM-AS4ðð. OBJECT-COMPUTER. IBM-AS4ðð.

INPUT-OUTPUT SECTION.

Appendix B. Original Examples in Additional BLanguages-101

Page 379
Image 379
IBM Version 4 manual List Object API-ILE Cobol Example, PROGRAM-ID. Listadopt Environment Division, INPUT-OUTPUT Section