Premium Content

Get Premium Content and take advantage of the full potential available in Stories, Links and the Download Area.
Register as a regular user, it's free, and become a community member, share your knowledge or start promoting Cobol in open source.

Topics

User Functions

Older Stories


Welcome to myCobol.net Thursday, 20 July 2017, 20:47 @ CEST

Cobol Syntax for CGI

Cobol Salon
  • Tuesday, 19 April 2016, 11:09 @ CEST
  • Contributed by:
  • Views:
    521

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.

The following comments are owned by whomever posted them. This site is not responsible for what they say.