Skip to main content development
   toolset
 
  Easy400   |       iSeries home
Public-Source
 
Introduction
Tutorial
Examples
FAQ
Index
Download
 
 

 
2 - Service program procedures


Service program cgicbldev2/cgicbldev2 contains a number of procedures. These procedures provide services that enable ILE-COBOL programs to perform WEB duties.

 SPECIAL-NAMES. 

cgicbldev2/cgicbldev2 procedures must be called passing parameters along with their "operational descriptors".

Operational descriptors provide descriptive information to the called ILE procedure in cases where the called ILE procedure cannot precisely anticipate the form of the data items being passed.
You use operational descriptors when they are expected by a called ILE procedure written in a different ILE language (see Passing Data Using CALL...BY REFERENCE, BY VALUE, or BY CONTENT in "ILE COBOL for AS/400 Programmer's Guide").

To obtain this, one should specify the LINKAGE TYPE IS PRC...USING ALL DESCRIBED clause in the SPECIAL-NAMES paragraph.

To make that easy, we have prepared a separate source member that you must include through a COPY statement (see the next figure) in all your ILE-COBOL sources:
SPECIAL-NAMES.
      copy CPYSPCNAME of CGICBLDEV2-QCBLLESRC.

If you have prepared your CGI source library (mysrclib) with command cgicbldev2/setcgilib, you may include this source member from your source library:
SPECIAL-NAMES.
      copy CPYSPCNAME of mysrclib-QCBLLESRC.

 Error message LNC2756 

In compiling your ILE-COBOL CGI modules / programs, you may sometime have to face a compilation error with severity 30:
    MSGID: LNC2756  SEVERITY: 30  SEQNBR:  xxxxxx
    Message . . . . :   The CALL GIVING/RETURNING item does not match the
      specified returned item.

As a matter of fact, several procedures do use the clause RETURNING.
The fact here - however - is that sometimes the ILE-COBOL compiler does not accept that the same procedure, in two or more different cases, returns a value into different variables.
To bypass such an annoying situation, we recommend to mention the same variable on all the instances of that procedure, and to move the returned value to the appropriate variable afterwards.
We have examples of such cases in our sample CGI. To find such cases, use PDM option 3 over source file CGICBLDEV2/QCBLLESRC and scan (option 25) for returnString.

 CGICBLDEV2 procedure categories 

2.1 -  Receiving the input from the client browser
2.2 -  Working with an external HTML
 2.2.1 -  Creating an external HTML
 2.2.2 -  Loading the external HTML
 2.2.3 -  Substituting output variables
 2.2.4 -  Writing sections
2.3 -  Special output procedures
2.4 -  Execute a command
2.5 -  Message handling
2.6 -  Maintain & retrieve page counts
2.7 -  Environment variables
2.8 -  Data handling functions
2.9 -  Random numbers and strings
2.10 -  Working with cookies
2.11 -  Date functions



    Contact