ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

CPF4326 while using SBMJOB

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

  • CPF4326 while using SBMJOB

    Hi all,
    I am reading data from a file PF1 using LF1 sequencially, and writing to other file PF2 using using LF2 using RPG Program R1. when i run it using CALL R1, working absolutely fine. But when use SBMJOB to submit it as batch job, it is going to MSGW. the error is: " CPF4326 occured for the file LF2 while trying to Open ( C D S F) ".

    Even i changed the commitment control using STRCMTCTL *CHG, still same error.
    Again i tried with a CL program C1, which have a call statement CALL R1, and this time i submitted CL program C1. Still i am getting the same error.

    Please suggest me fix this error.

  • #2
    Re: CPF4326 while using SBMJOB

    Most likely, file PF2 is not journaled. Start journaling PF2, and the problem should go away. Alternatively, don't run R1 under commitment control.

    What did the CPF4326 message say? When you tried to apply the suggested recoveries from the CPF4326 message, what happened? What does R1 do to affect commitment control? How was it compiled? Is R1 OPM or ILE? Is it a SQL RPG program? If it is, what was the COMMIT() parameter value at compile-time?

    Calling R1 in an interactive job would allow it to run within a commitment definition that was active at the time it was called. But calling R1 via SBMJOB would mean that R1 would have to create the commitment definition.
    Even i changed the commitment control using STRCMTCTL *CHG, still same error.
    The problem is probably showing up because the program is already running under *CHG. If you run STRCMTCTL *CHG, you are only setting the attribute to a value that is already causing the problem.

    How did you run STRCMTCTL? Was it only in your interactive job?
    Again i tried with a CL program C1, which have a call statement CALL R1, and this time i submitted CL program C1.
    That wouldn't have any effect at all on the problem unless C1 changed the commitment definition.
    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


    • #3
      Re: CPF4326 while using SBMJOB

      Hi Tom,
      PF2 is already journaled, My R1 is a RPGLE Program, it is not a SQL RPG Program.My code is like this..

      FL1 IF K DISK /*L1 IS LOGICAL FILE ON PF1*/
      FL2 UF A K DISK COMMIT /*L2 IS LOGICAL FILE ON PF2*/
      Error: CPF4326 occured for the file L1 while open.

      Comment


      • #4
        Re: CPF4326 while using SBMJOB

        If it's really against L1, then it seems likely that you haven't committed changes to PF1 before running SBMJOB. Program R1 couldn't reliably read L1 if PF1 still has uncommitted changes.
        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


        • #5
          Re: CPF4326 while using SBMJOB

          Hi Tom,

          Please answer me that error is for L2 not for L1, since L1 is already commited. Thanks!

          Comment


          • #6
            Re: CPF4326 while using SBMJOB

            There is too much guesswork. We need the actual full message text for CPF4326. The failing program code should also be shown. Run DSPJOB OUTPUT(*PRINT) for your both interactive job and for your failing job, and upload the spooled files. Without actual correct detail, guesses could go on for a long time.
            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


            • #7
              Re: CPF4326 while using SBMJOB

              Tom, i can't send them because the moment i send from our system to any other outside system, the files get encrypted...Sorry to say but i don't have this option in our Office. Please note that, the error is for the file L2, through which we are writing data to File PF2. The error message is : CPF4326 occured for the file L2 while trying to Open ( C D S F). Once again i am sharing my code. Please go through and help me fix the error.
              My code :
              FL1 IF K DISK /*L1 IS LOGICAL FILE ON PF1*/
              FL2 UF A K DISK COMMIT /*L2 IS LOGICAL FILE ON PF2*/

              Comment


              • #8
                Re: CPF4326 while using SBMJOB

                The error message is : CPF4326 occured for the file L2 while trying to Open...
                That is not the error message. That is the RNQ1216 inquiry message. And it doesn’t look like it’s even the actual RNQ1216 message text. It looks like you are trying to type what the message says. You need to copy/paste the real text.

                The error message is CPF4326.

                However, the important part is what file the message references; and it seems to be L2 (if the message text is provided to us correctly). If the F-specs you showed us are correct, it makes sense that L2 is causing an error. It was confusing when you earlier said the file was L1. You need to be sure to copy/paste rather than trying to type when showing messages or other text. It's necessary to be precise about details.

                You need to run STRCMTCTL in the submitted job before R1 opens L2. That can be done by creating a CL wrapper for R1 or by changing L2 to be USROPN and calling one of the command execution APIs. (Alternatively, remove the COMMIT keyword from the F-spec.)
                ...the moment i send from our system to any other outside system, the files get encrypted...
                The files don't need to be "sent" anywhere. Just attach them to your comments here.

                You could use iSeries Navigator to drag/drop spooled files to your PC. Or you might use the QShell catsplf utility to copy the spooled files to a streamfile in an IFS directory. Then copy them to your PC and attach them here. Don't "send" them anywhere.

                Or are you required to use a direct-attach terminal instead of a PC?
                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


                • #9
                  Re: CPF4326 while using SBMJOB

                  Do i need to use OVRDBF on the file PF2 in CL in this case ?
                  else can i directly use
                  STRCMTCTL LCKVELEL(*CHG) OPNSCOPE(*JOB)
                  CALL PGM(R1)
                  COMMIT
                  ENDCMTCTL

                  please let me know..

                  Comment


                  • #10
                    Re: CPF4326 while using SBMJOB

                    No need for OVRDBF. A CL wrapper similar to what you show should work (though it can depend on details of R1 that we haven't seen). Submit a CALL to your new CL wrapper rather than for R1.
                    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


                    • #11
                      Re: CPF4326 while using SBMJOB

                      Hi Tom, Is there any way to get the data into the Output file even though there is CPF4326 is existing on the Output file PF2? i.e is there any Reply by using/issueing which we can neglect this error and proceed, so that we can get data into the output file PF2....

                      Comment


                      • #12
                        Re: CPF4326 while using SBMJOB

                        Do you perform a STRCMTCTL command within your submitted job or is it only started in the caller job?
                        If so you need to run the STRCMTCTL command before opening your files that are specified with COMMIT in your F-Specs.

                        Birgitta

                        Comment


                        • #13
                          Re: CPF4326 while using SBMJOB

                          Originally posted by KrishnaAS400 View Post
                          Hi Tom, Is there any way to get the data into the Output file even though there is CPF4326 is existing on the Output file PF2? i.e is there any Reply by using/issueing which we can neglect this error and proceed, so that we can get data into the output file PF2....
                          No.

                          That is, unless the submitted job starts commitment control (before the program attempts to open the file under commitment control), the error is going to continue.

                          I can think of three general directions. You can (1) remove COMMIT from the F-spec and recompile the program, (2) issue a request to start commitment control in the submitted job before the program attempts to open the file, or (3) change the keyword to COMMIT( {somevariable} ) and set the value of {somevariable} to *OFF or '0' before the program attempts to open the file.
                          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