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

how does union file maintains record formats?

632


what key word is used when screen is re-display?

653


how do you read changed records backward in subfile?

617


what is a spool file?

679


what are dds required for subfile?

587






How do you check object lock

373


how to pick up the changed records every time in a subfile after the first change made ?

1023


What is %CHECK?

848


what are the different methods to access seu?

628


during input operation which indicator position is seton if there is a record lock?

937


how do you read data area in an rpg program?

1116


what are the uses of factor1, factor2 and result field for the rpg operation code parm?

588


Difference Between Skip Before & Space Before?

674


all i need to know about cmpseqdat parameter in cmppfm, how it works and can we retrieve line sequence and date from the output?

2415


What are the different opcodes used for file operation on a subfile in a rpg pgm?

1103