ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Cl program compile time error cpf0001

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

  • Cl program compile time error cpf0001

    Hi all,

    I was trying this code to see the working of tfrctl ,
    but this code isn't running, as soon as it displays the output of first file it crashes

    op is

    Job 233188/GURU88/QPADEV008Q changed by JOBMANAGER.
    Job 233188/GURU88/QPADEV008Q changed by JOBMANAGER.
    Job 233188/GURU88/QPADEV008Q changed by JOBMANAGER.
    Job 233188/GURU88/QPADEV008Q changed by JOBMANAGER.
    Job 233188/GURU88/QPADEV008Q changed by JOBMANAGER.
    Job 233188/GURU88/QPADEV008Q changed by JOBMANAGER.
    010
    CPF0001 received by CL#21A at 600. (C D I R)



    code is based on 3 files
    Code:
    CL#21A --- CALLS CL#21B
    CL#21B --- TFRCTL TO CL#21C
    CL#21C
    ----------------------------------------CODE----------------------------------------------------

    CL#21A
    Code:
    0001.00 PGM
    0002.00              DCL        VAR(&A) TYPE(*DEC) LEN(3) VALUE(10)
    0003.00              DCL        VAR(&B) TYPE(*CHAR) LEN(3)
    0004.00              CHGVAR     VAR(&B) VALUE(&A)
    0005.00              SNDPGMMSG  MSG(&B) TOPGMQ(*EXT)
    0006.00              CALL       PGM(GURU881/CL#21B)
    0007.00              CHGVAR     VAR(&A) VALUE(&A + 10)
    0008.00              CHGVAR     VAR(&B) VALUE(&A)
    0009.00              SNDPGMMSG  MSG(&B) TOPGMQ(*EXT)
    0009.01              SNDPGMMSG  MSG('IN PGM CL#21A') TOPGMQ(*EXT)
    0010.00 ENDPGM
    CL#21B
    Code:
    0001.00              PGM        PARM(&X)
    0002.00              DCL        VAR(&X) TYPE(*DEC) LEN(3)
    0003.00              DCL        VAR(&Y) TYPE(*CHAR) LEN(3)
    0004.00              CHGVAR     VAR(&X) VALUE(&X+1)
    0005.00              CHGVAR     VAR(&Y) VALUE(&X)
    0006.00              SNDPGMMSG  MSG(&Y) TOPGMQ(*EXT)
    0007.00              SNDPGMMSG  MSG('IN CL#21B') TOPGMQ(*EXT)
    0008.00              TFRCTL     PGM(GURU881/CL#21C)
    0009.00              CHGVAR     VAR(&X) VALUE(&X+1)
    0010.00              CHGVAR     VAR(&Y) VALUE(&X)
    0011.00              SNDPGMMSG  MSG(&Y) TOPGMQ(*EXT)
    0012.00              SNDPGMMSG  MSG('IN CL#21B') TOPGMQ(*EXT)
    0013.00              ENDPGM
    CL#21C
    Code:
    0001.00              PGM        PARM(&P)
    0002.00              DCL        VAR(&P) TYPE(*DEC) LEN(3)
    0003.00              DCL        VAR(&Q) TYPE(*CHAR) LEN(3)
    0004.00              CHGVAR     VAR(&P) VALUE(&P+1)
    0005.00              CHGVAR     VAR(&Q) VALUE(&P)
    0006.00              SNDPGMMSG  MSG(&Q) TOPGMQ(*EXT)
    0006.01              SNDPGMMSG  MSG('IN CL#21C') TOPGMQ(*EXT)
    0007.00              ENDPGM

  • #2
    Re: Cl program compile time error cpf0001

    Hi BhargavSushant:

    A couple of things here:
    1. you are calling cl#21b as " CALL PGM(GURU881/CL#21B)"
    however in CL#21B you are expecting a parm PGM PARM(&X)
    2. Don't use special characters in your naming conventions......It only adds confusion
    3. &p &q &x &y &a &b are all meaningless.....Use names that make sense
    4. Use the library list for instead of hard coding the library name.
    5. "Job 233188/GURU88/QPADEV008Q changed by JOBMANAGER.".....Are you in GURU88 or GURU881?
    6. Most of the time CPF0001 means "Called Program Not Found"....are you sure cl#21b was compiled and residing in GURU881?

    Best of luck
    GLS
    The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

    Comment


    • #3
      Re: Cl program compile time error cpf0001

      @ GLS 400
      THANKS, It worked ,
      I named them simple because I wanted to see how tfrctl works

      Comment


      • #4
        Re: Cl program compile time error cpf0001

        How did you test this scenario? by putting CL#21B in debug.

        I did the same but I can still see CL#21A in call stack
        Please advise

        Comment


        • #5
          Re: Cl program compile time error cpf0001

          it only removes the program that executed the TFRCTL, not the programs higher in the call stack
          I'm not anti-social, I just don't like people -Tommy Holden

          Comment


          • #6
            Re: Cl program compile time error cpf0001

            I have PGM A written in RPG where I am using QCMDEXC to TFRCTL to PGM B and want to exit program A where it says TFRCTL is not allowed in this setting?

            Any Idea?

            Comment


            • #7
              Re: Cl program compile time error cpf0001

              TFRCTL does not work with CLLE. (2 cents added)

              Comment


              • #8
                Re: Cl program compile time error cpf0001

                Any solution??

                Comment


                • #9
                  Re: Cl program compile time error cpf0001

                  Recompile both programs as CLP.

                  Comment


                  • #10
                    Re: Cl program compile time error cpf0001

                    But my parent program is RPG from where I want to exit

                    Please advise?

                    Comment


                    • #11
                      Re: Cl program compile time error cpf0001

                      I do not believe you can execute TRFCTL from RPG using QCMDEXEC.

                      I believe TRFCTL must be in a CL program.

                      You could always wrap your Program A in a CL and after the execution of Program A, then TFRCTL to Program B.

                      Comment


                      • #12
                        Re: Cl program compile time error cpf0001



                        This command is valid only within CL programs.

                        Comment

                        Working...
                        X