× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



My recommendation would be to use CLLE and have a function in a Service
Program to log and/or report errors. Then if you have an error condition in
RPG ILE or CLLE, just call the function passing the message id, message file
and message data. That way all your error reporting is one place. For
example, you might create something like:

        LogErrors
                In          Function Name                               Char
(30)
                            Program Name                                Char
(10)        
                                Message Id                              Char
(7)
                                Message File + Message Library  Char (20)
                                Message Data                            Char
(256 - Varying)
                                Log to Qsysopr? (Y/N)                   Char
(1)
                Return  Standard Result (0 = ok or 1 Err)   Indicator
Variable.                       


        ehResult =
LogErrors('UFX0001':cMessageFilePlusLibrary:'SomeMessageData':Yes)

 or a CALLPROC in a CLLE.

There might be other functionality in your parameters like other logging
options but the basic idea is to centralize all your error logging in one
place and just call a function to handle. 

In this example, you might write the data to a standard file to log error
and then have standard program that runs daily to list all the error for the
day to make sure you do not miss anything. 

I know it easier to just do what you need for this problem but this kind of
solution can be applied to every error in a system. 

I do something like this with our service libraries. I have created a
function in my system library that receives an error code, message file and
message data and put it into a linked list.

If an error occurs, the functions call the logging function which writes its
error to a linked list and returns to the next level which call the function
to reports it error until you reach the top where it is reported. All the
error handling is in one place. 

Although as I think about this function would be perfect compliment. May
write myself.

Hope this helps. 

-----Original Message-----
From: Hartman Richard [mailto:richard.hartman@brctsg.com]
Sent: Friday, January 21, 2000 5:13 PM
To: 'RPG400-L@midrange.com'
Subject: Printing a report in CL


I have a CL program that applies constraints to files used in our
application. Right now my only options of displaying errors are sending
messages and the job log. I was thinking of creating a printer file and
writing the error messages to it, but I do not know if its even possible to
accomplish. Otherwise I was thinking of creating an RPG program that would
use QCMDEXC to apply the constraint and the RPG program to retrieve errors
and write them to a printer file. 

Is there a better way to do this? Or is the best way to end the program and
display the message, rather then running through the whole program and
retrieving a list of the errors?

Thanks in advance
Richard 


+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator:
david@midrange.com
+---
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.