ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

CPYFRMIMPF command error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CPYFRMIMPF command error

    I have a problem regarding CPYFRMIMPF command. When I copy a text file from a folder into a database file it ends in error.

    the text file has records like these:

    0118647140200707052121Briones, J1A FCR FCR006
    0118655340200707052121Briones, J1A FCR FCR006
    0118657840200707052121Briones, J1A FCR FCR006
    0118655640200707052121Briones, J1A FCR FCR006

    The fields from the to-file are the following:

    filename: ZOTUPD

    ZOTORD CHAR 8 PULSE Order#/SDS Invoice#
    ZOTSTS CHAR 2 Order Status
    ZOTDAT NUME 8 0 Date When Order Was Scanned
    ZOTTIM NUME 4 0 Time When Order Was Scanned ON
    ZOTUSR CHAR 10 Person Who Scanned The Orde
    ZOTLOC CHAR 4 Scanned Location
    ZOTCAR CHAR 10 Name Of The Forwarder
    ZOTPLT CHAR 6 License Plate Of The Vehicl

    By inspection, it seems that the data from the text file is correct.

    When I try to execute the cpyfrmimpf command, the message i receive is

    "0 records copied from file ___ to file ___." (something to that effect)

    Here is my partial job log when i executed the command.

    CPYFRMIMPF FROMSTMF('QDLS/TEMP/DELG0601.TXT') TOFILE(QTEMP/ZOTUPD)
    RCDDLM(*CRLF) STRDLM(*NONE)
    Ownership of object QCPIMTEMPS in QTEMP type *USRSPC changed.
    Ownership of object QACPTEMP01 in QTEMP type *USRSPC changed.
    Open of member ZOTUPD was changed to SEQONLY(*NO).
    Ownership of object TOCP933958 in QTEMP type *USRSPC changed.
    Ownership of object QF933958ZQ in QTEMP type *FILE changed.
    Data from file  in  truncated to 8 characters.
    Data from file  in  truncated to 2 characters.
    Data mapping error on member ZOTUPD.
    Data mapping error on member ZOTUPD.
    Data mapping error on member ZOTUPD.
    Data mapping error on member ZOTUPD.
    Null values not allowed in column or variable ZOTDAT.
    Data from file  in  truncated to 8 characters.
    Data from file  in  truncated to 2 characters.
    Data mapping error on member ZOTUPD.
    Data mapping error on member ZOTUPD.
    Data mapping error on member ZOTUPD.
    Data mapping error on member ZOTUPD.

    Hope you could help me out regarding this matter. Thanks in advance.

  • #2
    Re: CPYFRMIMPF command error

    I think CRYFRMIMPF expects a comma to seperate fields. You have only one comma per record, and that is probably not where you want it. I usually prefer to copy this type of file to a "flat file", then CPYF it to the database file with FMTOPT(*NOCHK). Or use a RPG pgm to read / write. Then you can edit the data and/or convert numerics as needed.

    Comment


    • #3
      Re: CPYFRMIMPF command error

      The command doesn't have delimiter.

      Comment


      • #4
        Re: CPYFRMIMPF command error

        Unless you specify DTAFMT(*FIXED), it does, and a comma is the default.

        Record format of import file (DTAFMT)
        Specifies the format of the data in the from-file.

        *DLM
        The data contains delimiter characters. Refer to parameter descriptions for STRDLM, FLDDLM, and RCDDLM for information on string, field, and record delimiter characters.
        *FIXED
        The data format is fixed. The data is in fixed columns in each record. The description of the format of the data is contained in the file member identified by the FLDDFNFILE parameter.

        Comment

        Working...
        X