|
On Apr 24, 2020, at 9:45 AM, Martin Neugebauer via RPG400-L <rpg400-l@xxxxxxxxxxxxxxxxxx> wrote:
*** i uploaded my samples to midrange scratchpad, and pasted the generated link here ... but this seems futile.
*** Therefore i now include sample code here in text form. Sorry, i tried my best.
****** Getting code to list here somewhat readeable is a nuisance.
****** I try once more, making sure i use plain text.
****** I would be thankful for working instructions to show code!
As described in a previous thread (which i do not replicate here) i have a problem with MONITORing for MCH3401 - "can not resolve to object".
I now have 2 sample programs, stripped down to the bone, to demonstrate this.
Sample 1: Monitoring for MCH3401 works
//----------------------------------------------------------------------
dcl-s msg char(50);
dcl-s pgmname char(10) inz('PGMXYZ');
//----------------------------------------------------------------------
// Test for MCH3401 - Can not resolve to object - OK
//----------------------------------------------------------------------
monitor;
c call 'PGMABC'
c*
c eval msg = 'Normal end'
c msg dsply
on-error *PROGRAM;
msg = 'on-error *program. Status= ' + %char(%status());
dsply msg;
endmon;
*inlr = *on;
Sample 2: Monitoring for MCH3401 works NOT
//----------------------------------------------------------------------
dcl-s msg char(50);
dcl-s pgmname char(10) inz('PGMXYZ');
//----------------------------------------------------------------------
// Test for MCH3401 - Can not resolve to object - NOT ok
//----------------------------------------------------------------------
monitor;
exsr srmain;
on-error *PROGRAM;
msg = 'on-error *program. Status= ' + %char(%status());
dsply msg;
endmon;
*inlr = *on;
//----------------------------------------------------------------------
c*
c srmain begsr
c call 'PGMABC'
c*
c eval msg = 'Normal end'
c msg dsply
c*
c endsr
//----------------------------------------------------------------------
Slight difference: Sample2 uses EXSR, Sample1 does not.
Interestingly, other errors, eg. "MCH1210 - Decimal truncation" ARE handled by both samples.
Puzzling, isn't it?
Thanks for your ideas on this, cheers!
Martin Neugebauer
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.