I need to add headings to CSV file but I'm getting an error. Please assist me, thanks.
I'm trying to follow this code: http://www.code400.com/forum/showthr...CPYTOIMPF-Help
My code and error:
QSH CMD('echo ''"CUST REGION","CUSTN","CUST +
NAME","INVOICE DATE","BALANCE DUE","SALES +
PERSON"'' > /INACTIVATE/SM035W.CSV')
QSH CMD('chmod u=rwx /INACTIVATE/SM035W.CSV')
CPYTOIMPF FROMFILE(QTEMP/SM035W) TOSTMF(&OBJLNK) +
MBROPT(*ADD) STMFCODPAG(*PCASCII) +
=======================
Message ID . . . . . . : CPF2845 Severity . . . . . . . : 40
Message type . . . . . : Diagnostic
Date sent . . . . . . : 05/11/10 Time sent . . . . . . : 14:45:55
Message . . . . : The copy did not complete for reason code 1.
Cause . . . . . : The Copy From Import File (CPYFRMIMPF) command, or Copy To
Import File (CPYTOIMPF) command could not be completed for reason 1. The
reason codes are:
1 - The CCSID or code page value is not valid.
2 - The field *N in the Field Definition File is not a field in the
TOFILE.
3 - The data for field *N of the TOFILE has a wrong decimal seperator.
4 - The data for field *N of the TOFILE does not allow nulls, or the from
file does not have enough fields for the TOFILE. The TOFILE does not support
nulls.
5 - The delimiters for the DTAFMT(*DLM) are not valid.
I'm trying to follow this code: http://www.code400.com/forum/showthr...CPYTOIMPF-Help
My code and error:
QSH CMD('echo ''"CUST REGION","CUSTN","CUST +
NAME","INVOICE DATE","BALANCE DUE","SALES +
PERSON"'' > /INACTIVATE/SM035W.CSV')
QSH CMD('chmod u=rwx /INACTIVATE/SM035W.CSV')
CPYTOIMPF FROMFILE(QTEMP/SM035W) TOSTMF(&OBJLNK) +
MBROPT(*ADD) STMFCODPAG(*PCASCII) +
=======================
Message ID . . . . . . : CPF2845 Severity . . . . . . . : 40
Message type . . . . . : Diagnostic
Date sent . . . . . . : 05/11/10 Time sent . . . . . . : 14:45:55
Message . . . . : The copy did not complete for reason code 1.
Cause . . . . . : The Copy From Import File (CPYFRMIMPF) command, or Copy To
Import File (CPYTOIMPF) command could not be completed for reason 1. The
reason codes are:
1 - The CCSID or code page value is not valid.
2 - The field *N in the Field Definition File is not a field in the
TOFILE.
3 - The data for field *N of the TOFILE has a wrong decimal seperator.
4 - The data for field *N of the TOFILE does not allow nulls, or the from
file does not have enough fields for the TOFILE. The TOFILE does not support
nulls.
5 - The delimiters for the DTAFMT(*DLM) are not valid.





Comment