× 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.


  • Subject: Re: How to best log msg from RPG/IV to job log ?
  • From: Scott Klement <klemscot@xxxxxxxxxxxx>
  • Date: Mon, 3 Jul 2000 10:11:37 -0500 (CDT)


Hi David,

On Mon, 26 Jun 2000, David Keck wrote:

> What is the best method to get information into the job log from RPG/IV ? 
> 

I don't know what the "best" method is, as I imagine it depends on what
you're trying to signal to the system, as well as what logging level your
shop uses.   But, this is the way I do it, if you want to try it:


D DiagMsg         PR
D   Message                    256A   Const

C                   callp     DiagMsg('Write this message to the ' +
c                               'job log')

c                   callp     DiagMsg('Notice that the silly CPF9898' +
c                                ' likes to add a period')

c                   eval      *inlr = *on


P*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
P*  This puts a diagnostic message into the job log
P*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
P DiagMsg         B
D DiagMsg         PI
D   Message                    256A   Const

D*****************************************************
D* API error code data structure
D*****************************************************
D dsEC            DS
D*                                    Bytes Provided (size of struct)
D  dsECBytesP             1      4B 0 INZ(256)
D*                                    Bytes Available (returned by API)
D  dsECBytesA             5      8B 0 INZ(0)
D*                                    Msg ID of Error Msg Returned
D  dsECMsgID              9     15
D*                                    Reserved
D  dsECReserv            16     16
D*                                    Msg Data of Error Msg Returned
D  dsECMsgDta            17    256

D*****************************************************
D* Send program message API
D*****************************************************
D SndPgmMsg       PR                  ExtPgm('QMHSNDPM')
D   MessageID                    7A   Const
D   QualMsgF                    20A   Const
D   MsgData                    256A   Const
D   MsgDtaLen                   10I 0 Const
D   MsgType                     10A   Const
D   CallStkEnt                  10A   Const
D   CallStkCnt                  10I 0 Const
D   MessageKey                   4A
D   ErrorCode                    1A

D MsgLen          S             10I 0
D MsgKey          S              4A

c     ' '           checkr    Message       MsgLen
c                   callp     SndPgmMsg('CPF9898': 'QCPFMSG   *LIBL':
c                               Message: MsgLen: '*DIAG':
c                               '*': 0: MsgKey: dsEC)

P                 E


+---
| 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-Ups:

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.