Ask the Expert

Why is my RPGLE program blowing up?

We are on V4R4 and I am using the following command to copy a file that was FTP'd onto the iSeries 400 and I want to place the data into a physical file on the iSeries: cpyfrmimpf fromfile(inlib/infile) tofile(outlib/outfile) mbropt(*replace) strdlm(*none) flddlm('~') datfmt(*jul) datsep(*none).

The command runs fine and breaks apart the fields into the proper fields in the output file. I have an RPGLE program written to edit check some of the fields in the outfile. The program blows up when I try to read the file with a CPF5029 error that actually relates to a CPF5035 error reason code #19, which says an unexpected null field was found. The dds for the outfile has AWLNULL on all of the character fields and the RPGLE program is compiled with allow null values = *yes. Do you have any ideas or suggestions on what else I could do to be able to read this file? Any help would be greatly appreciated.

Drop the datfmt parameter and make sure the field is defined as character or zoned. Compile your RPG with FIXNBR(*ZONED *INPUTPACKED).


The Best Web Links: tips, tutorials and more.

Ask your systems management questions--or help out your peers by answering them--in our live discussion forums.

This was first published in January 2002

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: