Marc's Place

 

E$CHKOBJ - Check if object exists

Start Command

call e$chkobj [F4]

Call Parameters

library (a10)
Name of the library where the object is expected. Use *LIBL if you want to check the existance of a library itself.
 
object (a10)
Name of the object.
 
object type (a10)
Same values as used with the OS/400 Commandobject CHKOBJ. Most used values:
 
Value: *FILE
This value instructs the program to check if the object of type FILE exists in library.
Value: *PGM
This value instructs the program to check if the object of type PROGRAM exists in library.
yesno (a1)
Same values as used with the OS/400 Commandobject CHKOBJ. Most used values:
 
Value: *FILE
This value instructs the program to check if the object of type FILE exists in library.
Value: *PGM
This value instructs the program to check if the object of type PROGRAM exists in library.

Return Parameters

yesno (a1)
Returns wheter if the object was found or not:
 
Value: Y
The object of type object type exists in library.
Value: N
The object of type object type does not exist in library.

What it does

Provides an easy means to check for the existance of objects from within other programs. No need for trapping CPF-messages, the program returns a simple Y(es) or N(o).

Examples

Here's an example in RPG III:
 

  C   CALL 'E$CHKOBJ'
C PARM '*LIBL' LIB
C PARM 'QPRINT' OBJ
C PARM '*OUTQ' TYPE
C PARM YN

Go to download page
© 1997- Marc Vos (and others)   -   Privacy Statement   -    Contact Me

On this website, Google Analytics is used to track visitor statistics. These are anonymised data about the number of visitors, which pages they visit on this site, from which regions they visit, which web browsers they use, etc.. You will also see non-personalised ads via Google AdSense. Cookies from Paddle or Paypal are placed when you click on a 'Buy now!' or 'Donate!' button, and possible cookies from Disqus when you use that system to comment on one or more blogposts.
Privacy Statement