Welcome to myCobol.net Wednesday, 21 August 2019, 02:28 @ CEST

Cobol Syntax for CGI

  • Contributed by:
  • Views: 1,067
Cobol Salon

General Format Data Description

[ IS EXTERNAL-FORM [ IDENTIFIED BY template-file-name ] ]  
[ IS IDENTIFIED BY external-name ]  

IS EXTERNAL-FORM Clause

The IS EXTERNAL-FORM clause associates a group item with HyperText Markup Language (HTML) data using the Common Gateway Interface (CGI) specification. It allows you to define input and output records for HTML forms and is useful when your COBOL code is part of an Internet-based application.

Syntax Rule

1. template-file-name and external-name are alphanumeric literals or unqualified data names. If a data name is used, it must refer to an unambiguous data item.


ACCEPT Statement
The ACCEPT statement makes low-volume data available to the program.

Format

ACCEPT external-form-item

Syntax Rules  

  1. external-form-item is an input record for an HTML form when used in a Common Gateway Interface (CGI) program. It is a group data item (declared with the IS EXTERNAL-FORM clause) that has one or more elementary items associated with CGI variables. The association is made with the IS IDENTIFIED BY clause in the description of the elementary item(s).  
  2. external-form-item may also be an output record for an HTML form. In this case, the group item is declared with both the IS EXTERNAL-FORM and the IDENTIFIED BY clauses.   

DISPLAY Statement
The DISPLAY statement provides for low-volume output from the program.  
DISPLAY external-form-item merges data into an HTML template file and sends the result to standard output.

Format

DISPLAY external-form-item

Syntax Rules

  1. external-form-item is an output record for an HTML form when used in a Common Gateway Interface (CGI) program. It is a group data item, declared with the IS EXTERNAL-FORM and IDENTIFIED BY clauses. It may have one or more elementary items associated with HTML template fields. The association is made with the IS IDENTIFIED BY clause.  
  2. external-form-item may also be an input record for an HTML form. In this case, the group item is declared with only the IS EXTERNAL-FORM clause.