RPGIV @ Work

A unique site for RPG and System i Lovers

Welcome!

Hi, this site will provide all what you need in System i and RPG developments.

My Name is Chamara Withanachchi, System i Expert and RPG Developer. And in the field for last 11 years.

I hope you will find lot of valuable information from this site

QLIRNMO - rename and/or move object. Print E-mail
User Rating: / 0
PoorBest 
Written by Chamara Withanachchi   

Author : Jamie Flanary of www.code400.com


      * Entry Plist                                                                                 
      *                                                                                             
     d @RENAME         pr                                                                           
     d  OldFile                      10                                                             
     d  OldLib                       10                                                             
     d  NewFile                      10                                                             
     d  NewLib                       10                                                             
     d  inType                       10                                                             
      *                                                                                             
     d @RENAME         pi                                                                           
     d  OldFile                      10                                                             
     d  OldLib                       10                                                             
     d  NewFile                      10                                                             
     d  NewLib                       10                                                             
     d  inType                       10                                                             
      *                                                                                             
      * Variable Definition                                                                         
      *                                                                                             
     d Error           s             34                                                             
     d FromObject      s             20                                                             
     d ObjectType      s             10                                                             
     d ToObject        s             20                                                             
     d Replace         s              1                                                             
      *                                                                                             
      * Program Info                                                                                
      *                                                                                             
     d                SDS                                                                           
     d  @PGM                 001    010                                                             
     d  @PARMS               037    039  0                                                          
     d  @MSGDTA               91    170                                                             
     d  @MSGID               171    174                                                             
     d  @JOB                 244    253                                                             
     d  @USER                254    263                                                             
     d  @JOB#                264    269  0                                                          
       //                                                                                           
       //  external calls                                                                           
       //                                                                                           
     d $Rename         pr                  extpgm('QLIRNMO')                                        
     d   fromObject                  20                                                             
     d   ObjectType                  10                                                             
     d   ToObject                    20                                                             
     d   Replace                      1                                                             
     d   Error                       34                                                             
                                                                                                    
      /Free                                                                                         
                                                                                                    
        //--------------------------------------------------------                                  
        // MAIN LINE                                                                                
        //--------------------------------------------------------                                  
                                                                                                    
                                                                                                    
                   // take parms and rename --and/or-- move object                                  
                                                                                                    
                FromObject = OldFile + OldLib;                                                      
                ToObject = NewFile + NewLib;                                                        
                ObjectType = InType;                                                                
                replace = '1';                                                                      
                                                                                                    
                $rename(FromObject      :                                                           
                        ObjectType      :                                                           
                        ToObject        :                                                           
                        Replace         :                                                           
                        Error                                                                       
                                        );                                                          
                                                                                                    
                                                                                                    
               *inlr = *on;                                                                         
                                                                                                    
                                                                                                    
        //--------------------------------------------------------                                  
        // *Inzsr -  one time run subroutine                                                        
        //--------------------------------------------------------                                  
                                                                                                    
             begsr *inzsr;                                                                          
                                                                                                    
                                                                                                    
             endsr;                                                                                 
      /End-Free                        


User Comments

Please login or register to add comments

<Previous   Next>