ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

CPYFRMIMPF - The copy did not complete for reason code 13

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

  • CPYFRMIMPF - The copy did not complete for reason code 13

    hi,

    m using below command to copy data from IFS CSV file to PF, but getting error "The copy did not complete for reason code 13". could someone please guide how to resolve this.

    CPYFRMIMPF FROMSTMF('/myIFS/empDetails.csv') TOFILE(EMPDETAILS) MBROPT(*REPLACE) RCDDLM(*CRLF) RMVBLANK(*NONE) FLDDLM(',') FROMRCD(2) ERRLVL(0)
    ERRRCDOPT(*REPLACE) RPLNULLVAL(*FLDDFT)

    Thanks

  • #2
    Re: CPYFRMIMPF - The copy did not complete for reason code 13

    You have a problem with the record delimiters in your CSV file. I would take a look at it with a text editor and verify that you should be using *CRLF for the record delimiter.

    Comment


    • #3
      Re: CPYFRMIMPF - The copy did not complete for reason code 13

      Please post a couple lines of the ascii table.

      thanks
      Jamie
      All my answers were extracted from the "Big Dummy's Guide to the As400"
      and I take no responsibility for any of them.

      www.code400.com

      Comment


      • #4
        Re: CPYFRMIMPF - The copy did not complete for reason code 13

        thanks for help guys, its been resolved.

        actually some char fields are having ','(comma) in them, as my assumption while converting from CSV to PF no of commas should be equal to no of fields. we repalced ',' with '/' & it worked. it may not be good solution but atleast we got the reason of prob.

        please explain if you know more about this thing will help.

        thanks

        Comment


        • #5
          Re: CPYFRMIMPF - The copy did not complete for reason code 13

          Kishor,

          Commas are probably the worst type of delimiters to use. I highly recommend using a tab or pipe (|) as your delimiter. You will save yourself a lot of problems.

          Comment


          • #6
            Re: CPYFRMIMPF - The copy did not complete for reason code 13

            Originally posted by DAG0000 View Post
            Commas are probably the worst type of delimiters to use. I highly recommend using a tab or pipe (|) as your delimiter. You will save yourself a lot of problems.
            LOL, not the worst, but perhaps the worst that people use frequently.

            Blanks, for example, are a really bad delimiter. (Yes, I've seen that used!)

            Periods, too... terrible delimter.

            Comment


            • #7
              Re: CPYFRMIMPF - The copy did not complete for reason code 13

              Originally posted by DAG0000 View Post
              Kishor,

              Commas are probably the worst type of delimiters to use. I highly recommend using a tab or pipe (|) as your delimiter. You will save yourself a lot of problems.
              From what I know about CSVs, commas were never bad delimiters. Unfortunately, the CSV format is highly misunderstood. Standard CSV format has the following specifications:
              1. All fields to be separated by commas.
              2. All text fields to be double quoted so as to ignore any commas inside the text. For example, a row containing - 1 | Smith, John| Project Manager must show up as 1,"Smith, John","Project Manager" in a CSV file.
              3. All string delimiter characters (i.e. double quotes) in text to be escaped with another string delimiter. For example, a row containing - 1 | Express Delivery Box| 20"x20"x20" must show up as 1,"Express Delivery Box","20""x20""x20""" in a CSV file.

              With the above specifications any CSV handling API (including CPYFRMIMPF or MS Excel) should be able to import the files without any issues.

              I have seen many cases where people assume CSV format to be just commas and struggle with it only to replace it with some fancy delimiter while still naming the files as CSV but I've never had to look beyond proper CSV with these rules in place.

              Hope this is useful and I am more than happy to be corrected if I am wrong.

              Comment

              Working...
              X