ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Service Program

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

  • Service Program

    Hi ! guys ..
    i created a service program ,,, code as under

    name SUBMOD1
    Code:
    HNOMAIN                                                  
    dcvtfc            pr            10  2                    
    d  amtrs                        10  2 VALUE              
    c                                                        
    pcvtfc            b                   EXPORT             
    dcvtfc            pi            10  2                    
    d  amtrs                        10  2 VALUE              
    c                   return    amtrs*40                   
    p                 e
    where it take input a value and multiply by 40 and return
    Code:
     CRTRPGMOD MODULE(SUBMOD1) SRCFILE(Qyogrnd)             
     CRTSRVPGM SRVPGM(SUBMOD1) EXPORT(*ALL) ACTGRP(*CALLER)
    and caller program name subpr1 as below
    Code:
    dcvtfc            pr            10  2                                 
    d  amtrs                        10  2 value                           
    d
    damtrs                s        10 2
    c                   eval     amtrs=10
    c                   eval      amtfc=cvtfc(amtrs)                      
    c       amtfc   dsply                                                  
    c                                                                     
    c                   seton                                        lr
    and complied caller by .. bind service program submod1
    Code:
    CRTRPGMOD MODULE(YOGESHLIB/SUBPR1) SRCFILE(YOGESHLIB/Qyogrnd)
    CRTPGM PGM(SUBPR1) BNDSRVPGM(YOGESHLIB/SUBMOD1)
    program is working fine ,,
    but as i changing the code of service program and replace the value 40 to 45
    and again compliing service program
    after that i run program subpr1
    i am getting result 400 again but ist should be 450

    as i understand that when we use service program
    then caller program need not to re- comile and bind .,,

    but in my case again i had to compile caller program ..

    even program is running after deleting the srv program object

    pls guide me ,,
    where i m wrong

    thanks
    regards

  • #2
    Re: Service Program

    Pl help me out ..

    Comment


    • #3
      Re: Service Program

      First check you only have one version of the server program...

      WRKOBJ OBJ(*ALL/SUBMOD1) OBJTYPE(*PGM)

      and also your program...

      WRKOBJ OBJ(*ALL/SUBPR1) OBJTYPE(*PGM)

      To be sure, delete all instances of both and recomile both. Delete all versions of the modules first as well.

      Comment


      • #4
        Re: Service Program

        You are using a bound service program - that is why the program is running without the *SRVPGM object.
        .
        Therefore, you need to update the program with the newest instance of the *SRVPGM.
        If you used a binding directory earlier, use UPDPGM to re-bind the *SRVPGM to the *PGM.
        â??No bird soars too high if he soars with his own wingsâ?? â?? William Blake

        Comment

        Working...
        X