Problem solve Get help with specific problems with your technologies, process and projects.

Simple check for IFS object –- revisited

Learn a simple way to check for the existence of an IFS object --without having to dig into IFS APIs.

Another simple way to check for the existence of an IFS object --without having to dig into IFS APIs -- is to use the DSPLNK command with the printer output option. The command will generate CPFA0A9 if the object(s) do not exist.

The only drawback to this method is that it will create a spool file listing the object(s) -- if they actually exist. But you could encapsulate it in a CL where you could override and hold the spool file before issuing the DSPLNK command, then delete it when done.

OVRPRTF FILE(QSYSPRT) HOLD(*YES)

DSPLNK OBJ('/path/objectname') OUTPUT(*PRINT) OBJTYPE(*ALL)
DETAIL(*BASIC)
DSPOPT(*USER)

DLTSPLF FILE(QSYSPRT) SPLNBR(*LAST)

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Ask your programming questions--or help out your peers by answering them--in our live discussion forums.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.


Dig Deeper on iSeries CL programming

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close