close considerations for Text UI

In the context of Text UI, you use the EGL close statement with print forms. The statement issues a form feed and either disconnects from the printer or (if the print form is spooled to a file) closes the file.

EGL automatically issues a form feed for each printer file whenever a main program ends or when a program called by a non-EGL (and non-VisualAge Generator) program returns to the calling program. No form feed occurs when a program starts or when a called program returns to another EGL (or VisualAge® Generator) program.

For some types of files, dynamic file association allows multiple physical printer files to be open simultaneously. If multiple printer files are supported, previously opened files are not closed when a print form is displayed and converseVar.printerAssociation is modified. Position is maintained for each open file. A close statement is effective only for the file currently named in converseVar.printerAssociation. If multiple printer files are not supported, the previously opened file is closed when a print form is displayed and converseVar.printerAssociation has been modified. For more information, see printerAssociation.

Syntax

For a syntax diagram, see close.

Examples

The following example uses the close statement to close a print form.

	 close myPrintForm;

Compatibility

Remember that each relational database management system (RDBMS) has its own version of SQL. You won't find all SQL commands in every implementation. Check the documentation from your RDBMS before coding any embedded SQL.

Table 1. Compatibility considerations for close and SQL
Platform Issue
CICS® EGL automatically performs close processing at the end of the program, as well as when a segment break occurs at a converse.
IMS™ BMP If you close a print form associated with a VSAM or sequential file, EGL issues an OS CLOSE for the file. If you close a print form associated with a GSAM file, EGL issues a form feed followed by a CLSE call to the GSAM database. If the print form is associated with an output message queue and you close the print form, EGL issues a form feed followed by a PURG call to the message queue.
IMS/VS If the print form is associated with an output message queue and you close the print form, EGL issues a form feed followed by a PURG call to the message queue. EGL automatically performs close processing at the end of the program, as well as when a segment break occurs at a converse.
z/OS® batch If you close a print form associated with a VSAM or sequential file, EGL issues an OS CLOSE for the file. If you close a print form associated with a GSAM file, EGL issues a form feed followed by a CLSE call to the GSAM database.

Feedback