ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Help with calling external ILE RPG procedure from COBOL pgm

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

  • Help with calling external ILE RPG procedure from COBOL pgm

    Obviously, I have never done this before...
    What am i doing wrong?

    Compile Error...

    * 1390 MSGID: LNC1604 SEVERITY: 30 SEQNBR: 091000
    Message . . . . : Program-name in CALL or CANCEL statement is not
    valid. Statement ignored.

    Call statement...

    0908.00 JHV01 CALL "DELQ0000M_OPTOUTCODESERROR"
    0909.00 JHV01 USING BY CONTENT WS-OPTOUT-CODES
    0910.00 JHV01 BY VALUE WS-OPTOUT-CODE-NUMBER
    0911.00 JHV01 GIVING WS-OPTOUT-ERROR-CODE
    0912.00 JHV01 STOP RUN.

    CREATE command...

    1 CRTBNDCBL PGM(LSAMSD3X/NLS008C) SRCFILE(LSAMSSD3X/QCBLSRC) SRCMBR(NLS008C) OP
    TION(*NOEVENTF *BLK) DBGVIEW(*ALL) OPTIMIZE(*NONE) LINKLIT(*PRC) TGTRLS(V7R2M0)
    BNDDIR(LSAMS)


    BNDDIR(LSAMS) contains the *MODULE with the RPG procedure to be exported

  • #2
    Add LINKAGE IS PROCEDURE to the CALL statement:
    Code:
    CALL LINKAGE TYPE IS PROCEDURE "DELQ0000M_OPTOUTCODESERROR"
    Or

    In the SPECIAL-NAMES section, add a "LINKAGE PROCEDURE" statement.

    Code:
    SPECIAL-NAMES.                   
        LINKAGE PROCEDURE FOR "DELQ0000M_OPTOUTCODESERROR".
    You can use "PRC" instead of "PROCEDURE".

    Comment


    • #3
      Ok - got it to to compile... I was also missing PROCESS NOMONOPRC.

      However now when I call it, it from another pgm i get

      Message MCH0802 in NLS901C in LSAMST3X (C D F G).
      Total parameters passed does not match number required.

      Cause . . . . . : Program NLS901C attempted to call program NLS008C with 5
      parameters. Program NLS008C expects a minimum of 0 and a maximum of 0
      parameters.

      HOWEVER, neither program (caller or callee) linkage section changed. both reflect 5 to be sent and 5 to be recieved. What got knocked out of alignment by converting to CBLLE and using the binding directory and calling the procedure?



      Last edited by jayvaughn; April 7, 2017, 07:50 AM.

      Comment


      • #4
        Originally posted by jayvaughn View Post
        What got knocked out of alignment by converting to CBLLE and using the binding directory and calling the procedure?
        It seems unrelated to any "procedure". Still, we need to see at least the CALL statement from NLS901C with the PROCEDURE DIVISION statement from NLS008C. The NLS008C LINKAGE SECTION would possibly also be useful.
        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