Cheers Mark,

I have created a very basic little program and service program that
illustrate the problem. They can be found at:



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Mark S. Waterbury
Sent: Monday, 20 July 2009 10:56 AM
To: RPG programming on the IBM i / System i
Subject: Re: CPF5192 error message with RPG program.

Hi, Steven:

Create a small, "cut-down" version of the display files and the RPG
program, that reproduces the problem, and then post the source code at -- and then post a reply to this list with a
link to the code you posted there.

That way, people on this list who want to help can look at the source
code and perhaps reproduce your problem, and perhaps then offer various

All the best,

Mark S. Waterbury

Steven Harrison wrote:
Hi All,

I have been receiving the following error in the job log when my

Message ID . . . . . . : CPF5192 Severity . . . . . . . : 50

Message type . . . . . : Escape

Date sent . . . . . . : 17/07/09 Time sent . . . . . . :

Message . . . . : Data sent to device AFXIT02A not valid. Negative

code is 10050112.

Cause . . . . . : The condition was caused by the program output

containing below hex 40 or too many input fields. More information

negative response code can be found in either the IBM 5494 Remote

Unit Functions Reference (under negative responses) or the SNA

Manual (under SENSE or LUSTAT codes). Invalid data (below hex 40)

occurred in one of the following ways:
etc etc...

followed by:

Message ID . . . . . . : RNX1251 Severity . . . . . . . : 99

Message type . . . . . : Escape

Date sent . . . . . . : 17/07/09 Time sent . . . . . . :

Message . . . . : Permanent I/O error occurred in file STATUSD.
Etc etc...

The following is happening:

Program 1 displays a subfile containing the discount rates for a price
code. The DDS for this program contains the subfile.

Program 2 is a service program that is responsible for displaying a
window that reports any status events that might take place (ie. Could
not find price code, discount rate invalid etc...). The DDS for the
window is in a separate display file. I have never had a problem with
this program and it is used by a number of other programs to display
status events.

The error is occurring when Program 2 is called to display the Window.
While trying to figure out what was causing the error I started
stripping out code bit by bit to identify where the problem was
occurring. I ended up removing the subfiles from Program 1's DDS
altogether and ended up with just a Header record displaying a single
text field and a Footer record that contains indicators for the F12
F03 keys. It seems that the error is occurring when 'ExFmt' is called
Program 2 before a read or ExFmt in Program 1.

So with the following code the error would occur:

Program 1:

Write Header;

DoesPriceCodeExist() <- Procedure to determine if the price code
If it doesn't it sets a status event that can be displayed by Program

Call Program 2 <- Calls ExFmt on the Window to display the status
The program will fall over at this point.

ExFmt Footer;

But with the following code the error won't occur:

Write Header;

ExFmt Footer;


Call Program 2 <- Display the window reporting that the Price Code
doesn't exist.

ExFmt Footer;

I'm wondering if anyone can shed some light on why this is happening?
Why will the ExFmt on the Window cause the program to crash if the DDS
it is overlaying has only had Writes to it but it will be fine if the
there has been a previous Read/ExFmt.

Both DDS files are compiled with RSTDSP *YES. Also for some strange
reason the error will not occur if I'm running the program in the
Debugger?!?!? Which I find very strange.

Any help would be greatly appreciated.


This thread ...


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

This mailing list archive is Copyright 1997-2019 by 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].