ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Copy command in error

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

  • Copy command in error

    Hello Everyone,

    I have this CL which when submitted runs a job and throws a error CPF2817-COpy command ended in error at the below point:

    Code:
    CPYTOIMPF  FROMFILE(QTEMP/FILE1) TOSTMF(&TOSTMF) +
                 MBROPT(*ADD) STMFCODPAG(*PCASCII) +       
                 RCDDLM(*CRLF) STRDLM('"')
    Here the joblog showed successful creation of FILE1 and @TOSTMF holds values of the path eg:/QDLS/LIB/FileName/A100000.CSV

    On production a retry option is hit for such an error and the job proceeds and completes normally.(What exactly does Retry do?) Also the error is seen only when the job is run for the first time in the day. For all other subsequent runs it ends normally!

    What could be possibly causing this error, please guide.

  • #2
    Re: Copy command in error

    Are there other messages in the job log before the cpf2817? Is the TOSTMF path and file name the same each time/day? What accesses the created file and when? Are you certain that the QTEMP file has been created?
    the smoking gnu

    Comment


    • #3
      Re: Copy command in error

      CPF2817 continues to say "See the messages previously listed." We need to know what the earlier messages are before we can make useful suggestions.

      What was reported as the cause of CPF2817?

      Tom
      Tom

      There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

      Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

      Comment


      • #4
        Re: Copy command in error

        Hi Chris & Tom,

        Firstly thanks for the response. Appreciate the fact that you guys take interest in solving the issue with as much urgency as the question poster.
        Alright now back to the issue,

        As per the joblog following was noted:

        Folder Lib/Filename created.
        (As there was a folder creation statement just prior to the cpy statement in pgm)

        File system error occured.Error number 3524.
        Copy command ended because of error.
        Function check. CPF2817 unmonitored by ABCCL at statement number bla bla
        CPF2817 received by procedure ABCCL ( C D I R)

        This was noted from the log.

        Is the TOSTMF path and file name the same each time/day?
        Yes it remains the same for every box environment with only change in sequence number that gets appende to file name each day.

        What accesses the created file and when?
        Well this CL calls a program thats responsible for populating values in the file and eventually a report is generated.But all of that seems fine. Infact this job runs perfectly everyday except for the first instance it is invoked in the day!Like i mentioned earlier the technical guys take a Retry option to solve the error.

        Are you certain that the QTEMP file has been created?
        Yes it shows the folder created along with file. But on navigating to that particular lib Temp i saw no object residding within it though it mentioned in log that it was created.

        Please guide.Thanks

        Comment


        • #5
          Re: Copy command in error

          Originally posted by techas400 View Post
          File system error occured.Error number 3524.
          There's the indication. Error number 3524 is "Function not allowed." (This can be seen in member ERRNO of source file SYS in library QSYSINC.)

          Error numbers also can generally be found in the QCPFMSG message file in QSYS. You can take the error number and prefix it with "CPE". In this case the message ID be comes CPE3524. If you run DSPMSGD CPE3524 and take option 1, Display message text, you should see this info:
          Code:
           5761SS1 V6R1M0 080215               Message Description
          
           Message file  . . . . . . . . . :   QCPFMSG       Library . . . . . . . . . . . . :   QSYS
           Message IDs:          CPE3524
          
             Message . . . . :   Function not allowed.
             Cause . . . . . :   Function is not allowed in a job that is running with
               multiple threads.
          Can you describe the job that is running the CPYTOIMPF command?

          Also, I just realized that you are copying into the /QDLS file system. That's usually not a good idea unless you fully understand the reasons why someone would do that. Why not use a directory in the /root file system? It performs better and has fewer restrictions.

          Tom
          Tom

          There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

          Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

          Comment


          • #6
            Re: Copy command in error

            The /QDLS file system is not safe for a job that's capable of handling multiple threads. So if you do anything (such as invoke Java) that involves multiple threads in the job, you will get this error.

            I would strongly recommend eliminating the use of /QDLS. After all, the 1980's are over.

            Comment


            • #7
              Re: Copy command in error

              Hi Tom,

              Can you describe the job that is running the CPYTOIMPF command?
              The job thats running is for a Email API that gets triggered inorder to invoke a Java Mail API

              Comment


              • #8
                Re: Copy command in error

                Scott,

                Is there any other alternative to solving this issue other than eliminating the /QDLS usage in code? As source has been robust enough prior to this error being noticed recently.

                Thanks.

                Comment


                • #9
                  Re: Copy command in error

                  You would need to run any code that accesses /QDLS in a separate job from any code that uses threads (such as Java)

                  Comment


                  • #10
                    Re: Copy command in error

                    It'll be much easier to create a directory in the /root file system and use it in the future than it'll be to continue using /QDLS while trying to get Java to access it without future errors. Since /root can be processed faster and is more flexible (without the restrictions of /QDLS), it's hard to think of reasons to keep using /QDLS.

                    There might be some transitional steps that could be taken. For example, much of the preparatory work might be done in /QDLS. Then, just before calling Java, the /QDLS document could be copied into a /root directory. Your Java would be passed the path to the copy rather than the original document. It'd probably take some restructuring of the code, but it's a minimum step in the right direction.

                    Tom
                    Tom

                    There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

                    Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

                    Comment

                    Working...
                    X