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 |
RETRIVING DELETED RECORDS :- I'm frequently asked how to retrieve deleted records from an unjournaled physical file when the deleted records have not yet been removed from the file. Utility UNDEL lets you undelete records in a physical file. This public domain program is available in CISC and RISC versions, and the complete source code is available for download at: UNDEL for AS/400 Save File (RISC): http://www.as400network.com/sharewarefiles/undelris.zip UNDEL for AS/400 Save File (CISC): http://www.as400network.com/sharewarefiles/undel.zip UNDEL for AS/400 Save File (Source code): http://www.as400network.com/sharewarefiles/undelsrc.zip The utility takes advantage of the fact that deleted records in physical files are only flagged as deleted, and the record data still exists until it is overwritten or the file is reorganized with a utility such as RGZPFM. UNDEL simply reads the deleted record, then reuses the record by writing over it with the new record (thus eliminating the flag for the deleted record). Some homegrown and commercial utilities copy the file containing undeleted records to a save file, then use a program to read the save file, which contains live and undeleted records, to a file to undelete the records. The UNDEL utility is superior to the SAVF technique because there's no need to copy the file to a save file, which is especially important for really large files. When run, UNDEL displays the physical file records in their unformatted, raw text form. You can either position the display to a given relative record number or use F19 or F20 to find the previous and next deleted record, respectively. The utility also includes online help, which is almost unheard of for free utilities. Other utilities include the ability to undelete records. You can use the RTVDLTRCD command in the old QUSRTOOL (no longer supported by IBM). QUSRTOOL is now a commercial product called TAA Productivity Tools ( http://www.taatool.com ). The free file editor WRKDBF has a built-in undelete capability ( http://www.wrkdbf.com ), and several commercial file editors can undelete records. For a complete list of file editors, go to http://www.sourcebook400.com, select "Programmer Tools" under "Product Category," then select "File Editors."
Hi friends, I am using a load all subfile , and currently i am in in the third page of the subfile , from third page i have selected a record and called some other program .on returning, subfile is being loaded from the frist page. so can any one kindly suggest me in retaining my third page after returning. i.e loading from third page.
how can i retrieve the field name from display file at run time? Devendra Singh Tomar
WHAT IS MENT BY RECORD LEVEL IDENTIFIER ? WHAT IS THE PURPOSE OF THIS?
Is it possible to call a subfile using CL. IF yes.. kindly help me out with explanation...?
1. What is bound-by-call and bound-by-reference? 2. Where and why is *Nomain used? 3. What are the difficulties faced by programmers when using service programs? 4. Explain the different ways of parsing and compiling XML in iSeries.
how to retrieve RRN value in RPGLE program
1.Coding in cl to send an message? 2..What is turnover and use? What are the different levels?
How can we read a particular record from the database file which is not having DDS (Flat File). For example, there are 100 records in the flat file. How can we retrive 15th record in RPG/400 program (Without using CL)
1.Can any body share me about thease opcodes with example please.Im new for AS/400.Could u please tell me in real senario? 1.TESTN, 2.EVAL 3.EVALR, TIME, 4.MONITOR 5. ENDMON 6.ON-ERROR 7.COMMIT ROLLBACK?
what is post opcode do
What is Multi Occurrence Data Structure(MODS)?