RPGLE monitor on- error example code. How to use CL program MONMSG for RPGLE to check for errors? The monitor group performs conditional error handling based on the status code. It consists of: A MONITOR statement. One or more ON- ERROR groups. An ENDMON statement. After the MONITOR statement, control passes to the next statement. How to use CL program MONMSG for RPGLE to check for errors? The monitor group performs conditional error handling based on the status code. It consists of. Helps you manage your applications. It allows the user to control which printer the reports will be printed on and how many copies will be printed. Printer File keywords are:SPACEA:This keyword is used for spacing.SPACEB example,SKIPA example,SKIPB example,COLOR example,DATE keyword example,DATSEP keyword example. 1 ® IBM Software Group © 2007 IBM Corporation Rational Developer for IBM i (RDi) Working offline using i Projects Featuring: Using i Projects for: working offline. This document contains a complete listing of releases, refreshes, fix packs and interim fixes sorted by version for IBM Rational Developer for i. Click here to read from first Chapter Before writing the Parsing program or the XML Cross-Ref generator I would like to create the copy source needed in both programs. You will need to create a Flat File ( PF with no DDS and a record length of 132). Use the CPYSPLF command to copy the spool file into this PF. The monitor block consists of all the statements from the MONITOR statement to the first ON- ERROR statement. If an error occurs when the monitor block is processed, control is passed to the appropriate ON- ERROR group. If all the statements in the MONITOR block are processed without errors, control passes to the statement following the ENDMON statement. The monitor group can be specified anywhere in calculations. It can be nested within IF, DO, SELECT, or other monitor groups. GOTO (Go To) takes the control to a specified Tag-label or End sob-routine label.GOTO opcode example is given below. The IF, DO, and SELECT groups can be nested within monitor groups. If a monitor group is nested within another monitor group, the innermost group is considered first when an error occurs. If that monitor group does not handle the error condition, the next group is considered. The following RPGLE sample code for monitor on- error submits a job to create a file in the IFS and then tries to use that file. At first it checks whether the file exists or not. After it finds the file, its possible that the program creating the file may still be writing data to it so it may be in use causing the copy object command to fail. If the copy object fails due to object in use error (CPFA0. E) then the program waits for more time and tries again. Cmd. Str s 5. Apostr s 1a inz(X'7. D'). . * Program Information. ID 4. 0 4. Exc. Cmd PR Ext. Pgm('QCMDEXC'). d Cmd_Str 5. Options(*VARSIZE). Const. d Cmd_Len 1. Const. . c *entry plist. PDF'. . c eval dtaq_data = $cmp +. Sending request to Data Queue to generate my PDF file. QSNDDTAQ'. c parm '@INVOICE' dtaq_name. LIBL' dtaq_lib. Cmd. Str = 'DLYJOB DLY(5)'. Exc. Cmd(%Trim(@Cmd. Str) . c %Len(%Trim(@Cmd. Str))). . c dou $count > 2. CHKIFS'. c parm $path. Y'. c leave. Cmd. Str = 'DLYJOB DLY(3)'. Exc. Cmd(%Trim(@Cmd. Str) . c %Len(%Trim(@Cmd. Str))). c eval $count = $count + 1. Y'. . c eval $web_path = '/My. Site/Invoice. Pdf/' +. Cmd. Str = 'CPY OBJ(' + @Apostr +. Apostr + ') TOOBJ(' +. Apostr +. c %trim($web_path) +. Apostr + ') REPLACE(*YES)'. Exc. Cmd(%Trim(@Cmd. Str) . %Len(%Trim(@Cmd. Str))). on- error. ID = 'CPFA0. 9E'. Exc. Cmd('DLYJOB DLY(3)': 1. Y'. leave. enddo.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
November 2016
Categories |