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

which are control break logic indicators?

727


some special characters I key in my html source members show different on my web pages. Why? How can I solve this?

716


any one have give AS400 study material? pls pass it to gopalsai789@gmail.com

1334


Explain this error: "all record formats for externally-described file abcd ignored or dropped due to error; file ignored."?

934


define a output queue?

1061






In AS/400 projects in Companies whats the meaning of production support team.what production support involves.also what work does development,maintenance involve what are the other teams or processes that are available for as400 project.

8663


http default port 80 is used by some other production http service. How can I create an http instance on another port to run cgidev2 and my future cgi developments?

708


what is the favicon.ico request that my site receives now and then?

739


explain the purpose of keep and assume keywords?

1238


what are indicators?

712


. How to know why the OPM job is in MSGWAIT state?..WHAT COULD BE THE REASON FOR it?

7237


how you get the relative record in a subfile in which cursor is located?

724


what keyword must be used with protect keyword ?

1276


can you display a empty subfile?

886


how can you execute a command from within an rpg program without calling a clp program?

1358