ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

RPGLE main module + 1 or more CLLE module in one single object *PGM

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

  • RPGLE main module + 1 or more CLLE module in one single object *PGM

    Hi,
    i'd like to have a main RPGLE module and one or more CLLE module all in one single PGM containing all the modules.
    I try to prepare one RPGLE source and 1 CLLE source to test the situation.

    this is the RPGLE Source:


    TEST_01R (RPGLE)
    Code:
    [FONT=courier new]d display         PR                  ExtPgm('TEST_01C')
     d msg1                          10A                     
    
     d msg1            S             10A   inz('Test Msg')   
      /free                                                   
          display(msg1);           // call CLLE TEST_01C     
          *inlr = *on;                                       
      /end-free [/FONT]
    this is the CLLE Source:

    TEST_01C (CLLE)
    Code:
    PGM        PARM(&MSG)                   
    DCL        VAR(&MSG) TYPE(*CHAR) LEN(10)
    SNDPGMMSG  MSG(&MSG)                    
    RETURN                                  
    ENDPGM


    this is the CLP i'm using to create module and binding the 2 modules together:

    TEST_01X (CLP)
    Code:
    [FONT=courier new]/* TEST_01R  Create Module Main Program                        */ 
                 CRTRPGMOD  MODULE(U0I3929_OB/TEST_01R) +             
                              SRCFILE(U0I3929_SR/QTEST2018) +         
                              SRCMBR(*MODULE) DBGVIEW(*SOURCE)        
    /* TEST_01C  Create Module CLLE                                */ 
                 CRTCLMOD   MODULE(U0I3929_OB/TEST_01C) +             
                              SRCFILE(U0I3929_SR/QTEST2018) +         
                              SRCMBR(*MODULE) DBGVIEW(*SOURCE)        
    /* TEST_01R  Create PGM from the 2 Module                       */
                 CRTPGM     PGM(U0I3929_OB/TEST_01R) +                
                              MODULE(U0I3929_OB/TEST_01R +            
                              U0I3929_OB/TEST_01C) ENTMOD(*FIRST)     [/FONT]
    The call to TEST_01X go fine. All goes right, but as soon as i try to call the TEST_01R with:

    CALL TEST_01R

    I receive the following error:

    Code:
    [FONT=courier new]Error occurred while calling program or procedure *LIBL/TEST_01C (C G D F). 
    
    Message ID . . . . . . :   MCH3401       Severity . . . . . . . :   40       
    Message type . . . . . :   Escape                                           
    Date sent  . . . . . . :   20/06/18      Time sent  . . . . . . :   10:05:26
    
    Message . . . . :   Cannot resolve to object TEST_01C. Type and Subtype     
      X'0201' Authority X'0000'.                                                
    Cause . . . . . :   Either a system pointer or a data pointer can not be    
      resolved.                                                                  
        For a system pointer, it can not be resolved to object TEST_01C, type and
      subtype X'0201', authorization X'0000', because either the named object was
      not in any context referred to or the correct object was located but the  
      user profile did not have the required authority.                         
        The object types for some common type or subtype codes follow:          
        -- 0190-Access group, 0201-Program, 0401-Library,                       
        -- 0701-Journal receiver, 0801-User profile, 0901-Journal,              
        -- 0B90-Data space, 0C01-Directory, 0C90-Data space index,     [/FONT]

    Where i'm wrong...?
    thank you for your help..
    Paolo.

  • #2
    The EXTPGM keyword in your "display" prototype defines the call as a program call. Change EXTPGM to EXTPROC, and the prototype will be for a bound call to the procedure in the CL module.
    Code:
    d display         PR                  [B][COLOR=#FF0000]ExtProc[/COLOR][/B]('TEST_01C')
    d  msg1                         10A

    Comment


    • #3
      You are right. Now it works perfectly.
      Thank you for the time you've dedicated in answering to me.
      Last edited by paolonervi; September 4, 2018, 01:02 AM.

      Comment

      Working...
      X