How can you check the existence of object in a system?

Answer Posted / nitin trivedi

With the help of CHKOBJ clp command, we can find existence of object on the system.
The usage of command in clp is as follows:
CHKOBJ OBJ(JBA001DT) OBJTYPE(*DTAARA)
MONMSG MSGID(CPF9801) EXEC(DO)
CRTDTAARA DTAARA(QGPL/JBA001DT) TYPE(*CHAR) LEN(6) +
VALUE('010196') TEXT('The last day that had job acct.+ data extracted')
ENDDO
RTVDTAARA DTAARA(JBA001DT *ALL) RTNVAR (&FROMDATE)

The execution of above steps is listed below:

steps

1: First it checks the data area object on the system.

2: If the data area object not found, the MONMSG command executes with the help of message identifier, next we can dynamically create the data area.
3. If the data area object found, control transfers to statement below ENDDO.

It is always good CLP programming approach to check the object before you rename, delete the objects on the system.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is compiler directive in as400? Give example of compiler directive.?

572


how can I predict the performance of my cgis?

646


what is procedure prototype and procedure interface.

621


how will you display a particular page in subfile ?

1052


name few ibm supplied libraries?

1214






how many printer files can be defined in f specs ?

961


which cl command is used to trap error messages during program execution?

863


can a join logical file be updated?

589


how would you design the process for a nightly, high volume check producing process that needs to select only records that are flagged to be processed?

930


which are the relational operators in rpg?

669


what would be the effect on the field where reverse image, underline and highlight display attributes are active ?

992


if we tried to move year part of *iso date into a field of length 3, what will happen ?

652


what is the version of os/400 that we have?

956


maximum number of subfiles that can defined in a rpg program for one display file is?

1028


what does the opcode free do?

1123