Previous Topic: QUIT StatementNext Topic: RESET Statement


REFRESH Statement

The REFRESH statement resets all fields in the named panel to their initial values and attributes as defined in the panel definition. The REFRESH statement ensures that a fresh copy of the panel is available.

The Creating Panel Definitions Guide describes how to define and maintain screen panels. Several statements and built‑in functions provide symbolic high‑level panel processing (see the TRANSMIT, SET ATTRIBUTE and RESET statements).

This statement has the following format:

REFRESH panel_name
panel_name

The one‑ to eight‑character name of the previously defined panel. You must define the panel‑name in the RESOURCE section of the program where the statement appears.

Fields with an initial value set in LAYOUT are refreshed with that value, whether their initial attribute is protected or unprotected.

Fields that do not have an initial value set in LAYOUT (for example, spaces between start‑field and end‑field) are initialized to input‑fill characters. When TRANSMIT occurs, fields still set to input‑fill are reset with output‑fill.

REFRESH often restores a panel for a new set of data after an old set of data completes processing. You can perform restoration of initial values and attributes here in a single operation rather than many RESET and SET ATTRIBUTE statements.

If you only need to reinitialize a few fields, use RESET on individual fields with SET ATTRIBUTE as an alternative to REFRESH. The REFRESH statement refreshes the panel object in memory with the panel object from the file; RESET and SET ATTRIBUTE change the panel object in memory.

Repeated use of REFRESH can increase overhead if performed unnecessarily.

RELEASE Statement

The RELEASE statement releases a panel, report, or subprogram after it is no longer needed as a resource of a program. You can use the RELEASE PROGRAM statement with a CA Ideal subprogram or a non‑ideal subprogram run in batch that is defined not to load a new copy on each call.

If a subprogram is not explicitly released, it remains on call, ready to be called again until the run is completed. In a batch run or in an online run that does not cross transaction boundaries, the subprogram is held on call in virtual memory. In an online run that does cross transaction boundaries, unreleased programs are swapped out to auxiliary storage on TRANSMIT statements. In either case, releasing programs that are no longer needed frees machine resources, especially with batch applications or online runs that do not cross transaction boundaries.

However, releasing programs that one or more programs in an application frequently use can add runtime overhead by forcing them to be continually reloaded. For more information about RELEASE PROGRAM, see the CA Ideal Administration Guide.

This statement has the following format:

        {PANEL panel_name              }
RELEASE {REPORT rpt‑name [[WITH] ABORT }
        {PROGRAM [subprogram]          }
panel_name

The name of the panel to release. You cannot use the abbreviation PNL in this statement.

rpt_name

The name of the report to release or the word RUNLIST. You cannot use the abbreviation RPT in this statement.

WITH ABORT

Prints the data specifications on the lines following the <<ABORT>> group heading on the Heading fill‑in before releasing the report. This is useful for printing messages when a report is terminated abnormally.

subprogram

The name of the subprogram to release. You cannot use the abbreviation PGM in this statement. If you omit the name, the RELEASE applies to the current program.

A maximum of 64 panels can be active simultaneously in all programs and subprograms in a run. In an application that uses large numbers of panels, releasing panels that are no longer needed makes it less likely that this limit is reached. It also reduces the amount of temporary storage each session that uses the panel needs.

There is a limit of 15 reports that can be simultaneously active. When a report of one of many used in an application, it should be released when no longer needed to minimize the likelihood that the limit on simultaneously active reports is reached during the run. (For more information, see the Generating Reports Guide.)

If a released panel is referenced again (such as with a RESET or a TRANSMIT statement), a fresh copy is reloaded from the library. If a panel is not released and the program where the panel is a resource is not released, the panel maintains its values between calls to the program.

When a program that was released is called again, a new copy is loaded with a fresh copy of working data.

All unreleased panels and reports used in a run are released at the end of the run or when the program that transmitted or produced them is released. All unreleased programs used in a run are released at the end of the run.

If a panel is a resource in more than one program of a run unit, the panel is counted separately against the maximum. For this reason, transmit a panel be in only one subprogram of an application.

When a report is released, final control footings and summary lines are produced. If RELEASE REPORT is issued and no data was printed, the data specifications on the lines following the <<EMPTY>> group heading are printed when the report is released.

You can release a report for one of three reasons: