Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
We use the CPYTOCSV command from RPG xTools library and found that it does not like null fields in the database. We have not been able to find any way around the problem other than to replace the null data in the columns that have them with blanks. Is there a work around for this or possibly a new version that deals with null data?
I will have to loo to see if the underlying program is compiled with ALWNULL. Is that what's happening? Can you expand on what "does not like null fields" means?
4800 - CPYTOCSV FILE(MIKE/QQRYOUT)
CSVFILE('/tmp/CSPGMR1_VOUCHERS.csv_utjtoh') HEADERS('*COLHDG')
Ownership of object XTL_CSVFIL in QTEMP type *USRSPC changed.
Ownership of object XTL_F421 in QTEMP type *USRSPC changed.
Data mapping error on member QQRYOUT.
Message ID . . . . . . : CPF5035 Severity . . . . . . . : 10
Message type . . . . . : Diagnostic
Date sent . . . . . . : 10/06/11 Time sent . . . . . . : 12:35:47
Message . . . . : Data mapping error on member QQRYOUT.
Cause . . . . . : A data mapping error occurred on field VOU_V00001 in
record number 1, record format QQRYOUT, member number 1, in member QQRYOUT
file QQRYOUT in library MIKE, because of error code 19. The error code
meanings follow:
Message ID . . . . . . : RNX1299 Severity . . . . . . . : 99
Message type . . . . . : Escape
Date sent . . . . . . : 10/06/11 Time sent . . . . . . : 12:35:
Details of what occurs below. a recompile with ALUNULL might fix it
Message . . . . : I/O error CPF5029 was detected in file FWRKIN.
Cause . . . . . : The RPG procedure CPYTOCSVIF in program XTOOLS/RPGLIB
received the message CPF5029 while performing I/O operation READ on file
FWRKIN. The actual file is MIKE/QQRYOUT(QQRYOUT).
19 -- An unexpected null field was found.
That means the RPGLIB module that does CPYTOCSVIFS was not compiled with allow null.
I can look at that and post a refresh. I'm heading out of town tomorrow, so if I don't do something about it tonight, it'll probably have to wait until next Friday.