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
In 'o' Specs What Is The Opcode For Write?
What is compiler directive in as400? Give example of compiler directive.?
when would you prefer logical file than opnqryf?
can a single screen format occupy a screen area above and below a subfile format ?
how does union file maintains record formats?
can you specify a display file to be used in the following modes input,output, or combined modes ?
what are the important factors in error message subfile ?
What is a query can be displayed without saving it?
What are the different opcodes used for file operation on a subfile in a rpg pgm?
1. There is a file called Month. Month has 12 members called Jan, Feb, ..., Dec. How to design a rpg code which can access any member and show its content. (User can ask for any member when required)?
how many maximum spaces could be given in o specs?
Can level check error occur if we do chgpf?
when do you use f-spec. Continuation line ?
is it there an easy way to determine if an html section is available to issue a wrtsection upon?
can a join logical file be updated?