CPF5035 - Data mapping error / An unexpected null field was found

By kimot, 24 December, 2022

When CL program is stopped by this error, there is a simple solution.

Message ID . . . . . . :   CPF5035       Severity . . . . . . . :   10        
Message type . . . . . :   Diagnostic                                         
Date sent  . . . . . . :   09/02/21      Time sent  . . . . . . :   10:16:50  
                                                                              
Message . . . . :   Data mapping error on member TMP_SQL_PF.                  
Cause . . . . . :   A data mapping error occurred on field USER_DATA in record
  number 1, record format TMP_SQL_PF, member number 1, in member TMP_SQL_PF   
  file TMP_SQL_PF in library QTEMP, because of error code 19. The error code  
  meanings follow:                         

  19 -- An unexpected null field was found.                                      

This message means that in file readed by command RCVF are fields with NULL attribute. 

OUTQLIB     OUTQ        SPOOLNAME   USER_NAME   USER_DATA   
QUSRSYS     PRTDFT      XA1001M     USERTOD     -           
QUSRSYS     PRTDFT      PRTFPROMOT  USERTOD     ALDPAGE     
QUSRSYS     PRTDFT      DLTSPLFC    USERTOD     -           
QUSRSYS     PRTDFT      QPEZDISK    USERTOD     PRTDSKINF   

And program doesn't expect null fields.

Solution is to change a CL program to allow null fields in file declaration - ALWNULL(*YES)

DCLF       FILE(*LIBL/TMP_SQL_PF) OPNID(FILE) ALWNULL(*YES)