× 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: TLE 3.2.01 IDK MSG CL education
  • From: MacWheel99@xxxxxxx
  • Date: Tue, 22 Jun 1999 02:07:22 EDT

I> Subj:         TLE 3.2.01  IDK Error Message ID variables
>  From:        AprAlexa@aol.com
>  
>  Hi,  
>  Does anyone know how to map for an error message id with multiple 
variables 
>  within a converter.  Example. (Validating customer and shipto #'s)  
> Defined a new message in a message file as EDX9004 
> with message that reads Msg# &1 - Ship to # &2 for 
> customer &3 does not exist.  Cannot figure out how to code 
>  with the converter for more than one variable within *ERROR values. 
> There is nothing in the manuals or help screens  that even talks of error 
checking, 
>  tried everything I could think of.  Can anyone help?   Tks. 

After my usual BS, I give a specific example of how to code this, but my 
usual BS is so you know where the manuals explain this so you can code other 
scenarios.

You might also pose this question on one of the pure 400 programming forums.

Check AS/400 Work Manual SC41-4306 index for messages ... it has examples all 
over of capturing error messages & communicating them various places within 
CL & Message Queues, however, I found most of this stuff as clear as mud 
until I went to the relevant IBM classes.  Chapter 5 (Jobs) has some examples 
of "IF a particular Msg ID" then GOTO ERROR which receives the message you 
entered to your file & sends the whole thing to the appropriate message queue.

Check your CL manuals under MONMSG (SC41-3721 is the most valuable in my 
collection) then scan BPCS CL program source code for hits to see how SSA 
does it

Chapter 8 (working with messages) of OS/400 CL programming manual gives 
examples of how to program the handshake between message about "Ship to # &1 
for cust # & 2 does not exist (Message id is NOT &#)

Example, if you have previously setup your IDKMSG message file in say QEDI 
library with message id EDX9004 for this scenario (you substitute according 
to library & other names you really used), the CL needed to fill in the &1 &2 
blanks is as follows:

1. DCL declare all your variables, using naming convention of & then name 
starting with an alpha character, such as &CUST and &SHIP which will get the 
values that your hypothetical user tried to enter incorrectly.  You may also 
want variables for message file & library identification, although as much as 
possible you should rely on *LIBL library list & *JOBD job description 
standards.

2. CHGVAR VAR(&X) VALUE(&SHIP||&CUST)
This plugs into variable &X the concatenation of &SHIP immediately followed 
by the value of &CUST

3. RTVMSG MSGID(EDX9004) MSGF(QEDI/IDKMSG) MSGDTA(&X) MSG(&MSG)
At this point the variable &MSG contains your error text that "Ship-to # &1 
(whatever that value was in &SHIP) for Customer # &2 (whatever the value was 
in the second ingredient in your concatenation) does not exist"

4. You can send &MSG any number of places, such as a PARM back to an RPG 
program that called this CL program.  The AS/400 manuals I have mentioned so 
far generally have illustrations relating to pure CL & message queues.  In 
practice, where you send stuff depends on, to put it delicately - our 
programming skills (e.g. subfile messages are still somewhat beyond me).  The 
whole architecture ought to be within some corporate programming standards 
which include some how-to examples, because the lengths of these variables 
have to be precise & if you have multiple programmers you don't want to be 
tripping over each other.

The example I just gave was CL - can we do this kind of thing in RPG or some 
other programming language?  I do not think so.  RPG gets the values, like 
SHIP-TO # & CUST #, then calls some CL program to get the message text then 
sends it to the user via DDS.  There are several IBM manuals on both RPG and 
DDS.  What you want to be studying is the CALL operation and how Parameters 
work when you are passing them between different programming languages.

BPCS has standards for processing this kind of scenario, which you can use, 
if you adhere to SSA's naming conventions, and avoid adding something which 
might conflict with a later PTF or BMR.

Typically the user enters something on a DDS screen which filters out a bunch 
of possible input errors, then RPG validates the numbers & if they are no 
good, call CL program to get the relevant error message text, then send it 
back to the user DDS screen.  To make this work, you either have to be 
conversant in CL RPG DDS Message Files, or real good at reverse engineer 
cloning, in which we find some BPCS code that is doing what we want & we just 
substitute the values & message-id involved, in our copy of the BPCS source 
code - be sure to get the copyright statement right in our cloned source code 
& you might start with some of the simpler RPG programs like a 100 series 
maintenance to see how SSA does this.

If it works, use it, don't reinvent the wheel.

Al Macintyre = Mac Wheel 99
+---
| This is the BPCS Users Mailing List!
| To submit a new message, send your mail to BPCS-L@midrange.com.
| To subscribe to this list send email to BPCS-L-SUB@midrange.com.
| To unsubscribe from this list send email to BPCS-L-UNSUB@midrange.com.
| Questions should be directed to the list owner: dasmussen@aol.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.