Blog Archive

RPGLE free format Call program example - AS400 (iSeries)

Free-format RPGLE does not support CALL. The only call possible in free-format is the prototype call, CALLP. Prototype call can be dynamic call or a bound call. If the keyword EXTPGM is specified on the prototype, the call will be a dynamic external call; otherwise it will be a bound procedure call.

A prototype for the program or procedure being called must be included in the definition specifications preceding the CALLP. Here is sample program A that calls another program B.

Sample RPGLE program to be called - PROGRAMB

d $name           s             30a                      
d $age            s              3s 0                    
d $message        s             52a                      
                                                         
c     *entry        plist                                
c                   parm                    $name        
c                   parm                    $age         
                                                         
 /free                                                   
                                                         
    $message = 'My name is ' + %trim($name) + ', ' +     
              'age ' + %trim(%editc($age:'Z')) + ' years.';
    dsply $message;                                      
                                                         
    eval *inlr = *on;                                    
    return;                                              
                                                         
 /end-free   

Sample RPGLE calling program - PROGRAMA

d $name           s             30a   inz('as400')     
d $age            s              3s 0 inz(21)          
                                                       
d ProgramB        PR                  Extpgm('PROGRAMB')
d $name_                        30a                    
d $age_                          3s 0                  
                                                       
 /free                                                 
                                                       
    ProgramB($name:$age);                              
                                                       
    eval *inlr = *on;                                  
    return;                                            
                                                       
 /end-free        

Tip: You can omit CALLP, thats implicit!

11 comments :

  1. This astonishing innovation gives individuals an opportunity to stay associated and identify with their friends and family for free. Enchantment Jack phone administration is developing extraordinarily quick as it is being utilized by thousands more individuals consistently. free phonecalls

    ReplyDelete
  2. Excellent and useful post explaining different ways of calling a program in free format!!!!Keep going. More at SEO Package Reviews

    ReplyDelete


  3. More than wonderful article Dear Sir, Please continue what I have invented It is really very special with my greetings
    العاب تلبيس بنات 2018
    العاب طبخ فلاش
    العاب سيارات

    ReplyDelete
  4. may be useful for all, helpful article once and pardon me permission to share also here

    Obat amandel bengkak
    Cara menyembuhkan

    stroke

    Obat aliran darah tersumbat

    ReplyDelete