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

Free-Form Procedure Statement Print E-mail
User Rating: / 0
PoorBest 
Written by Chamara   

A free-form procedure-beginning statement begins with DCL-PROC, followed by the procedure name, followed by keywords, and finally a semicolon. If there is no prototype for the procedure, and *DCLCASE is specified for the procedure-name parameter of the EXTPROC keyword, then the external name of the procedure is the same as the name specified for the DCL-PROC statement, in the same case.


A free-form procedure-ending statement begins with END-PROC, optionally followed by the procedure name, and finally a semicolon. If the name is specified, it must be the same as the name specified on the procedure-beginning statement.


The only directives that are allowed within a free-form procedure statement are /IF, /ELSEIF, /ELSE, and /ENDIF.


 DCL-PROC getCustName
   /IF DEFINED(EXPORT_ALL_PROCEDURES)
       EXPORT
   /ENDIF

 DCL-PROC cleanup;
    CLOSE *ALL;
    UNLOCK *ALL;
    deleteTempUsrspc();
 END-PROC;
   DCL-PROC getNextOrder; 
   DCL-PI *N IND
           EXTPROC(*DCLCASE);
       order LIKEDS(order_t);
   END-PI;

   DCL-F orders STATIC;
      READ orders order;
      RETURN %EOF(orders);
   END-PROC getNextOrder;

Note : The procedure interface specifies EXTPROC(*DCLCASE), so the external name of the procedure is "getNextOrder", exactly as specified for the DCL-PROC statement

<Previous   Next>