ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

CLP program is not working

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

  • #16
    Re: CLP program is not working

    Hi ravikiran032:

    Based on your cpf0001 error above....... Do you have a compiled version of "SLMQTESTD/FTOQ" ?


    On a command line key in:
    "dspobjd SLMQTESTD/FTOQ *pgm"
    You should see something like the following:
    PHP Code:
    Opt  Object      Type      Attribute               Size
         FTOQ        
    *PGM      RPGLE                1978368 
    if you see the following:
    PHP Code:
    Object FTOQ in SLMQTESTD type *PGM not found
    you need to work on the ftoq program or place it in library SLMQTESTD.

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

    Comment


    • #17
      Re: CLP program is not working

      Originally posted by ravikiran032 View Post
      I have changed the calling program and ran the code. I have received a display saying CPF0001 received by MQTEST2 at 200. what does this mean, where can i check the details
      ok so you are calling program FTOQ with a bunch of parameters.

      Check the last parm (1) - should it be ('1') as CL has a tendency to not pass integer/decimal values well as parameters.

      The error message says that it is from MQTEST2, you need to check the source file for that program and see what line 200 is ...
      Greg Craill: "Life's hard - Get a helmet !!"

      Comment


      • #18
        Re: CLP program is not working

        Thanks all for your valuable response. I have researched my old programs in my system and modified the code as below and it worked finally. I have done some browsing in the net to understnd these commands. Do we really need to concat the null character at the end of the string as used in the code? i think MSGMON is necessary, when i remove this code it raises CPL2700 exception. Please express your views.


        Code:
           PGM
        
           DCL        VAR(&FILE) TYPE(*CHAR) LEN(40)
           DCL        VAR(&ID) TYPE(*CHAR) LEN(12)
           DCL        VAR(&ENV) TYPE(*CHAR) LEN(12)
           DCL        VAR(&DEBUG) TYPE(*CHAR) LEN(1)
           DCL        VAR(&RCVAL) TYPE(*DEC) LEN(5 0)
           DCL        VAR(&NULL) TYPE(*CHAR) LEN(1) VALUE(X'00')
           CHGVAR  VAR(&FILE) VALUE('SLMQTESTD/ISASN856' *TCAT &NULL)
           CHGVAR     VAR(&ID) VALUE('USX856I' *TCAT &NULL)
           CHGVAR     VAR(&ENV) VALUE('TESTD' *TCAT &NULL)
           CHGVAR     VAR(&DEBUG) VALUE('1' *TCAT &NULL)
           ADDLIBLE   LIB(SLMQTESTD)
            MONMSG     MSGID(CPF2103)
        
           STRCMTCTL  LCKLVL(*ALL) CMTSCOPE(*JOB)
        
        
             CALL       PGM(*LIBL/SLMQFTOQ) PARM('-f' &FILE '-i' &ID +
                       '-e' &ENV '-debug' &DEBUG)
        
          ENDCMTCTL
        
        
          ENDPGM

        Comment


        • #19
          Re: CLP program is not working

          The ADDLIBLE should be done as follows, I always believe in the program leaving the users *LIBL exactly as it found it ...

          Code:
             PGM
          
             DCL        VAR(&ADDLIB) TYPE(*CHAR) LEN(1) VALUE(Y)
          
             ADDLIBLE   LIB(SLMQTESTD)
              MONMSG     MSGID(CPF2103) DO(CHGVAR VAR(&ADDLIB) VALUE(N))
          
            /*   .... stuff here ....    */
          
            IF COND(&ADDLIB *EQ 'Y') THEN(RMVLIBLE LIB(SLMQTESTD))
          
            ENDPGM
          As your sample code does not remove the library after running it is still there the next time you test it. And without the MONMSG it bombs.
          Greg Craill: "Life's hard - Get a helmet !!"

          Comment

          Working...
          X