Midrange News for the IBM i Community


Posted by: Mike Cunningham
CPYTOCSV
has no ratings.
Published: 29 Sep 2011
Revised: 23 Jan 2013 - 1783 days ago
Last viewed on: 11 Dec 2017 (4978 views) 

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.

CPYTOCSV Published by: Mike Cunningham on 29 Sep 2011 view comments(3)

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?

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: CPYTOCSV
Posted: 6 years 2 months 13 days 23 hours 10 minutes ago

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?

Posted by: mcunning
Premium member *
Comment on: CPYTOCSV
Posted: 6 years 2 months 8 days 9 hours 11 minutes ago

   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.                                

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: CPYTOCSV
Posted: 6 years 2 months 8 days 1 hours 57 minutes ago

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.