简体   繁体   中英

IBM i RPG Code to procedure

I am looking at an RPG program. there are some subroutines like this: are there any tools which would create this as a procedure, that could be used in separate process?

C                   Eval      FinQty# = 0                           
C                   Eval      OdCom# = OhCom#                       
C                   Eval      OdOrd# = OhOrd#                       
C     OdKey         Setll     OeOrd1                                
C     OdKey         Reade     OeOrd1                                
C                   Dow       %eof = *off                           
 *                                                                  
C                   If        OdPrt# = OdAls# and                   
c                             %subst(odprt#:1:3) <> 'FRT'           
C                   Eval      FinQty# += OdQty#                     
C                   Endif                                           
 *                                                                  
C     OdKey         Reade     OeOrd1                                
C                   Enddo                                           
 *                                                      

Yes, there are tools. I would not use them.

Arguably, the key benefit to subprocedures are local variables and a parameterised interface. No automated tool is going to be able to tease out the interface, and figuring out which global variables should be made into local variables is a daunting task.

For my money then, all an automated tool will do is to convert the syntax from EXSR to CALLP. The 'subprocedure' is still using global variables and the interface is still hidden from the programmer. What's the point?

Yes

I'm particularly fond of Linoma's RPG Wizard http://www.linomasoftware.com/products/rpgtoolbox/rpgwizard

Arcad has another tool, but it has more functionality and is more $$$. http://www.arcadsoftware.com/products/arcad-transformer-ibm-i-refactoring-tools/

Note that Linoma will convert the syntax from internal subroutine to internal procedure; but it'd be a manual process to move the procedure externally.

Whereas I believe Arcard's toolset can build an external procedure.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM