Using a show statement with inputForm

You can use the show statement to send a text form to the user and to start a new transaction when the user enters input on the form.

You specify the name of the next transaction and the text form on the show statement; a record name is optional. The generated program displays the form and identifies the next transaction to the CICS® or IMS environment. The new transaction is scheduled when input is received from the program user.

When you use a show statement, you must specify the same form in the inputForm property for the transferred-to program. The inputForm property contains the name of the form that provides input to the program before processing begins. The transferred-to program begins by reading the same form displayed using the show statement in the initial program. You can use the inputForm property and show statement to create an IMS deferred program switch or a RETURN TRANSID for CICS®.

Note:
For IMS/VS, when you use a show statement and the inputForm property, the two programs must share the same FormGroup. For other environments, the form can be in different FormGroups, but it must be the same form.
When you specify the inputForm property for a program, the processing that occurs when that program is started varies:
  • If a form is not received, the generated program automatically displays the form that was specified in the inputForm property.
  • If a form is received, the generated program automatically performs any validation edits that are required before beginning the normal processing logic.
When you transfer program control using a show statement, you control the amount of data saved during user think time and the location where it is saved:
  • You can specify a record when you define the show statement in addition to the form.

    For the CICS® environment, Rational® COBOL Runtime automatically saves the record in the COMMAREA.

    For the IMS/VS environment, Rational® COBOL Runtime automatically saves the record in one of the following places:
    • In the Scratchpad Area (SPA) for conversational processing where the spaSize build descriptor option is set greater than 0 and the spaADF build descriptor option is set to "NO".
    • In the work database for nonconversational processing where the spaSize build descriptor option is set to 0 or for conversational processing when the spaADF build descriptor option is set to "YES".
  • You can put additional data on the form by setting the intensity form field property to invisible. This allows the data to be available to the transferred-to program when it reads the inputForm, but keeps the user from seeing the data when the form is displayed. A copy of the form is saved in the work database so the data can be displayed again if the user requests a help form.
For the IMS/VS environment, if you want to avoid saving a copy of the form in the work database, you must do the following:
  • Set the modified property to YES for all variable fields on the form. You can do this when you define the default attributes for the fields on the form or with the set statement.
  • Ensure that all the other properties are set to their defined values before the show statement.
  • You can save data in a database using EGL add or replace statements and then restore the data in the transferred-to program.
  • You can also use a show statement to transfer to the same program (program A can transfer to program A by using a show statement).