if i have three programs progA,progB and progC .now i call
progB from progA. but the progB does not exist . now i want
to call progC instead of starting dump. how can we achieve
this.
Answers were Sorted based on User's Feedback
Answer / shantanu kumar dutta
Dear,
You can handle like that .check an object existance by
CHKOBJ like, If Object dose not exist than it through
MonMsg CPF9801,CPF9810 by this we can handle the
situations.
Eq->
CHKOBJ OBJ(&FLTLIBNM/PgmB) OBJTYPE(*PGM)
MONMSG MSGID(CPF9801 CPF9810) EXEC(GOTO CMDLBL(Call
PgmC))
| Is This Answer Correct ? | 20 Yes | 0 No |
Answer / sreedhar
We can use Monitor and ON-Error opcodes to do the same.
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / vinod babu
I m not sure about this answer. But my idea is dat we can
use ERROR HANDLING in main program. Suppose if the main pgm
does not exist then error routine will be handled and the
control passed to next statement after that routine.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / raja
By Using *pssr we can handle the error and take dump of
that.
For Example:
call 'Nxtpgm'(if object is not Found it take
Nxt tag dump and call the nxtpgm1)
Call 'Nxtpgm1'
*pssr Begsr
Dump(A)
Goto Nxt
Endsr
seton lr
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / cagatay azkin
In ILE environment, when you call programB, define call with
(E) and set the indicators (position 73 and 74 I guess)
Later on, use some %built-in functions such as $error and
%status to check.
If there is an error, you can take an action in*PSSR error
subroutine or by checking the indicator in calc spec to
whatever you want.(in this case, you need to define it in INFSR)
For more detail, you can refer ibm's ile rpg reference book.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / bhupendra tomar
just use 2 cmds
CHKOBJ and handle error through
MONMSG msg(CPF9801)
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / raja
For Example:
call 'Nxtpgm'(if object is not Found it take
Nxt tag dump and call the nxtpgm1)
Call 'Nxtpgm1'
seton lr
*pssr Begsr
Dump(A)
Goto Nxt
Endsr
| Is This Answer Correct ? | 0 Yes | 0 No |
I know whole thing ab't Arrays related to declaration..can anyone tell me what exactly use of array or anyone faced a situation where he found use of array must....
I have a Physical File name 'File1', which is present in two libraries named 'LIB1' & 'LIB2'. These 2 libraries are listed in the library list. Would like to access data from this file from these two libraries using RPG program. How to do this, any idea?
How can i check the object existance in RPG program without using QCMDEXC command.
In case if I want to know whether a record exists in a file, which one do you prefer CHAIN or a SETLL and why ?
Can an indexed file be accessed in arrival sequence in RPG?
I have two sessions S1 & S2 under this 3 jobs(say j1,j2,j3 under session S1) And 2 jobs(Say j4, j5 Under session S2)is running. How many QTEMP & how many LDA will create for the same.
What is the difference between inner join @ outer join
Suppose I have 3 jobs a b and c. I want to submit b after successful completion of a and want to submit c after successful completion of b. Without using job scheduler or job queue, how can I do that through cl program?
what was the robotech rpg?
Can any body give the code for this quesition? Using the following details write C-Spec code to set Name to"AMMU LABS SYSTEM" D NAME1 S 10 INZ('AMMU') D NAME2 S 10 INZ('LABS') D NAME3 S 10 INZ('SYSTEM') D NAME S 20
what is meant by record lock.how records are locked.what is the purpose of record lock.if records are locked what happens.how to find out which record is locked.
If the last record of a file has been read, and the next operation on that file is a READ operation, what will be the values of the input fields for that file? A. They will be blank and/or zero. B. They will be null. C. They will equal the values of the first record in the file. D. They will equal the values of the last record read.