Setting generation options
If
you set the Generate Program? action flag
to Y, the Generation Options panel will be displayed.
Table 12. Generation Options
DB2P / DB2PLOCATION -- Generation Options ---------------------------- 8.1.0
Command ===>
Query : Form :
-----------------------------------------------------------------------------
General Options...
Program/Plan Name ===>
Environment...... ===> (B=Batch, T=TSO, C=CICS)
Program Type..... ===> (P=Print, D=Display, N=No Report, L=Data Layer)
Enter "/" to set options below...
_ DB2 Options _ Data Processing Options
_ Report Options _ Host Variable Options
_ Data Layer Options _ Miscellaneous Options
_ Stored Procedure Options
Write Source Code To...
Data Set ===>
Member.. ===> (blank=Program/Plan Name)
|
If you press Enter, all input fields will
be validated. If any errors are detected during input validation,
the panel will be redisplayed with an error message. If no errors
are detected, and options were selected, the pop-up windows will display
for the selected options, then the panel will be redisplayed. If
no options are selected, then the program will be generated with
the specified options. After generation, the Actions After Generation
pop-up window will display, allowing you to specify subsequent actions
to take. If there is a processing error, you return to the Report
List panel.
If you press PF3, all input fields will
be ignored and you will proceed to the next panel. No generation
will take place.
If you type ABORT and press Enter, all input fields will
be ignored and you return to the Report List panel. No generation
will take place.
The fields on the panel are:
- Program/Plan Name
- Enter the name of the program to generate. The name must conform
to plan and program ID naming rules.
- Environment
- Enter B to generate an MVS(TM) batch
program, T to generate an online TSO program, C to generate an online CICS program, or S to generate a stored procedure program. This option must
be set to B, T, or S for a non-SELECT query.
- Program Type
- Enter P if the generated program should print a report, D if it should display a report online, N if it should do neither, or L to generate a data layer program. This option must be set
to:
- P, N, or L for a batch program
- P, D, or N for a TSO or CICS program
- N for a stored procedure program
Note:
You must set this option to N or L for a non-SELECT query.
- DB2 Options
- Enter / to display the DB2 Options pop-up window on which you can specify
additional options related to how the program should work with DB2.
- Attachment Facility
- Enter T to generate a program that uses the TSO attachment facility, C to generate a program that uses the call attachment facility
(CAF), or R to generate a program that uses the RRS attachment facility
(RRSAF). This option must be T or C for a TSO program. This option must be R for a stored procedure program. This option is ignored for
a CICS program.
- CAF Module Usage
- Enter D to generate a program that uses the DB2 call attachment module
(DSNALI) or H to generate a program that uses the HPO call attachment module
(AACAF). This option is ignored if Attachment Facility is
not C.
- SQL Type
- Enter S to generate a program that uses static SQL, or D to generate a program that uses dynamic SQL. This option
must be S for a data layer program.
- DSNTIAR Calls
- Enter Y to include static calls to the DSNTIAR routine in the generated
program to retrieve SQL error message texts. Enter N to omit those calls, so that the generated program will produce only
SQL return codes (without message text).
- Data Processing Options
- Enter / to display the Data Processing Options pop-up window, on which
you can specify additional options related to how the program should
read or manipulate data.
- Save Data
- Enter Y to generate a program that saves retrieved data to a DB2 table,
mimicking the QMF SAVE DATA command, and specify the
table name in the Table field. You must set
this option to N for a TSO or CICS print program. This option is disabled
for a stored procedure or data layer program and for a non-SELECT query.
- Table
- Enter the name of the table in which to save retrieved data.
The specified table should not be referenced in the input query.
If the name is unqualified, it will be qualified by the package
or plan OWNER or QUALIFIER parameter (if using static SQL) or by the CURRENT SQLID of the user at runtime (if using dynamic SQL). This option
is ignored if the Save Data flag is N.
- Table Space
- Enter the name of the table space in which the SAVE DATA table
should be created. Any text entered in this field will be included
in the IN clause of the CREATE TABLE statement used to create the table. The default value is
the value of your QMF profile SPACE parameter. Alternatively, enter *USERPROF to indicate that the value of the SPACE parameter for the user at runtime should be dynamically retrieved
and used. This option is ignored if the Save Data flag
is N.
- Action
- Enter R to replace any existing data in the SAVE DATA table. Enter A to append to the table. Enter P to make this determination at runtime. For batch programs,
a positional parameter can be passed in the PARM field to specify
the disposition of existing data. For TSO programs, a panel is displayed
on which the user can choose the disposition. This parameter must
be R or A for CICS programs. This option is ignored if the Save Data flag
is N.
- SQL Type
- Enter S to generate a program that performs SAVE DATA processing
using static SQL. Enter D to generate a program that performs SAVE DATA processing
using dynamic SQL. This option must be D if the program uses dynamic SQL for all other SQL or if *USERPROF is specified in the Table space field.
This option is ignored if the Save Data flag
is N.
- Erase Table(s)
- Enter Y to generate a program that drops the specified DB2 table or
tables at the end of its run, mimicking the QMF ERASE TABLE command.
A table name must be specified in the Table(s) field.
This option must be set to N for a TSO or CICS print program. This option is disabled
for a data layer program and for a non-SELECT query.
- Table(s)
- If the input to the generation process was a procedure that contained
more than one ERASE TABLE command for this report,
then this field will contain the value *MULTIPLE, and will be disabled. In this case, the names of the tables
to be dropped cannot be changed. Otherwise, use this field to enter
the name of a table to drop. This option is ignored if the Erase Table(s) flag
is N.
- Read Data from File
- Enter Y to read data from the DD named DATAIN rather than from DB2.
This option must be set to N for a CICS program. This option must be set to Y for a TSO print program. This option is disabled for a stored
procedure or data layer program and for a non-SELECT query.
- LRECL
- Enter the LRECL to use for the DATAIN DD when the Read Data from File flag
is Y. If this field is blank or contains an asterisk (*), the
minimum LRECL dictated by the data will be used. This option is
ignored if the Read Data from File flag is N.
- Write Data to File
- Enter Y to write retrieved data to the DD named DATAOUT. This is
analogous to the SAVE DATA option to write data to a DB2 table.
This option must be set to N for a CICS program. This option must be set to Y for a TSO display program if an online print program is specified.
This option must be set to N for a TSO print program. This option is disabled for a stored
procedure or data layer program and for a non-SELECT query.
- LRECL
- Enter the LRECL to use for the DATAOUT DD when the Write Data to File flag
is Y. If this field is blank or contains an asterisk (*), the
minimum LRECL dictated by the data will be used. This option is
ignored if the Write Data to File flag is N.
- Report Options
- Enter / to display the Report Options pop-up window, on which you can
specify additional options about how the program should produce
a report.
- Report Width
- Enter the page width (from 22 to 999) to use when generating the
report. This field is disabled for a non-print program and for a
non-SELECT query.
- Report Length
- Enter the page length (from 1 to 999, or CONT) to use when generating
the report. This field is disabled for a non-print program and for
a non-SELECT query.
- DATETIME
- Enter Y to include the date and time in a printed report's
page footing. Enter N to omit the date and time. This field is disabled for a non-print
program and for a non-SELECT query.
- PAGENO
- Enter Y to include the page number in a printed report's
page footing. Enter N to omit the page number. This field is disabled for a non-print
program and for a non-SELECT query.
- Print Program Name
- If this program is a TSO or CICS display program, then specify the
name of the program that will be invoked when a user enters the PRINT command
from the display program. The program invoked should be an online
print program for the same query and form, using the same host variables
(if any). Leave this field blank for a batch program or a non-display
program. This field is disabled for a non-SELECT query.
- Host Variable Options
- Enter / to display the Host Variable Options pop-up window to specify additional
options about how the program should use host variables.
- Host Variable File LRECL
- Enter the LRECL that should be used for the HOSTVARS DD at runtime.
The default value is 80. You must set this field to 80 in order to subsequently register the program with the End
User Facility.
- Format
- This option determines how host variable values will be specified
to the generated program. Enter T to specify the values on a single record separated by a specified
delimiter character. Enter C to specify one value per record. You must set this field to C to subsequently register the program with the End User Facility.
- Delimiter
- Enter the character that will be used to separate multiple
host variable values on a single record. This field is only used
when the Format flag is set to T.
- Data Layer Options
- Enter / to display the Data Layer Options pop-up window, on which you
can specify additional options specific to data layer programs.
- SELECT INTO
- Enter Y to generate a program that uses the SQL statement SELECT INTO to
retrieve a single row of data. Enter N to generate a program that uses the SQL statements DECLARE CURSOR, OPEN, FETCH, and CLOSE to retrieve multiple rows of data. This field is disabled
for a non-SELECT query.
- Host Variables Copybook
Data Set
- Enter the data set (which must be a PDS) to which a copybook containing
working storage definitions of the host variables used by the program
should be written. If the data set does not exist, the Allocate
Data Set pop-up window will be displayed, allowing you to allocate
it. If the name is enclosed in single quotes, it is taken to be
a fully qualified TSO data set name. Otherwise, your current TSO
profile prefix is used to qualify the name. You can leave this field
blank to include the host variable definitions in the generated
source code, rather than in a copybook.
- Host Variables Copybook
Member
- Enter the member in the specified Host Variables Copybook Data
Set to which a copybook containing working storage definitions of
the host variables used by the program should be written. You can
leave this field blank to include the host variable definitions
in the generated source code, rather than in a copybook. Leave this
field blank if the Host Variables Copybook Data Set field
is blank.
- Table Declarations Copybook
Data Set
- Enter the data set (which must be a PDS) to which a copybook containing
the declarations of the tables referenced by the program (DCLGENs)
should be written. If the data set does not exist, the Allocate
Data Set pop-up window will be displayed, allowing you to allocate
it. If the name is enclosed in single quotes, it is taken to be
a fully qualified TSO data set name. Otherwise, your current TSO
profile prefix is used to qualify the name. Leave this field blank
to include the table declarations in the generated source code,
rather than in a copybook.
- Table Declarations Copybook
Member
- Enter the member in the specified Table Declarations Copybook Data
Set to which a copybook containing the declarations of the tables
referenced by the program (DCLGENs) should be written. Leave this
field blank to include the table declarations in the generated source
code, rather than in a copybook. Leave this field blank if the Table Declarations Copybook Data Set field
is blank.
- Linkage Section Copybook
Data Set
- Enter the data set (which must be a PDS) to which a copybook containing
the linkage section of the program should be written. If the data
set does not exist, the Allocate Data Set pop-up window will display,
allowing you to allocate it. If the name is enclosed in single quotes,
it is taken to be a fully qualified TSO data set name. Otherwise,
your current TSO profile prefix is used to qualify the name. Leave
this field blank to include the linkage section in the generated
source code, rather than in a copybook.
- Linkage Section Copybook
Member
- Enter the member in the specified Linkage Section Copybook Data
Set to which a copybook containing the linkage section of the program
should be written. Leave this field blank to include the linkage
section in the generated source code, rather than in a copybook.
Leave this field blank if the Linkage Section Copybook Data Set field
is blank.
- Stored Procedure Options
- Enter / to display the Stored Procedure Options pop-up window, on which
you can specify additional miscellaneous options for the program.
Note:
Many of the stored procedure options correspond
directly to options on the DB2 SQL statement CREATE PROCEDURE.
You should consult the SQL Reference manual for the DB2 product you
are using for more information on these options.
- Procedure Name
- Enter the name of the stored procedure to generate. This
is the name that will be specified in the CREATE PROCEDURE statement,
and is the name by which client applications must CALL the generated
program.
- Result Set
- Use this field to specify whether or not the data that the
stored procedure retrieves from DB2 (if any) should be returned
as a result set to the calling application. Enter Y to return the retrieved data or N to not return the data. This option is disabled for a non-SELECT
query.
- Diagnostic Parms
- The generated stored procedure program will automatically include
input parameter definitions for each of the host variables used
by the query. You can optionally add output parameters to return
general error message text or SQL error message text. Enter 1 to add no additional diagnostic parameters, 2 to add a single output parameter for general error message
text, or 3 to add output parameters for both general error message text
and SQL error message text.
- Parameter Style
- Enter D to use the DB2SQL parameter style in the generated program, G to use the GENERAL parameter style, or N to use the GENERAL WITH NULLS parameter style.
- DBINFO
- Enter Y to include parameters in the generated program to receive
environmental information when the procedure is invoked. You must
specify N if the Parameter Style field is G or N.
- WLM Environment
- Enter the WLM environment in which the stored procedure should
execute. This parameter affects the generated CREATE PROCEDURE
statement only.
- Deterministic
- Enter Y to specify that the stored procedure is deterministic or N to specify that it is not. This parameter affects the generated CREATE
PROCEDURE statement only.
- Collection ID
- Enter the collection ID that is to be used when the stored procedure
is executed. This parameter affects the CREATE PROCEDURE statement
only.
- ASU Time Limit
- Enter the total amount of processor time, in CPU service units, that
a single invocation of the stored procedure can run. A value of 0 implies no limit. This parameter affects the CREATE PROCEDURE
statement only.
- Stay Resident
- Enter Y to specify that the stored procedure load module is to remain
resident in memory when the stored procedure ends. This parameter
affects the CREATE PROCEDURE statement only.
- Run-time Options
- Enter the Language Environment run-time options to be used for
the stored procedure. This parameter affects the CREATE PROCEDURE
statement only.
- Program Type
- Enter M to specify that the stored procedure should run as a main routine
or S to specify that it should run as a subroutine. This parameter
affects the CREATE PROCEDURE statement only.
- Security
- Select how the stored procedure should interact with security resources
outside of DB2, D to use the authorization ID of the stored procedure's
address space, U to use the run-time authorization ID, or F to use the definer's (i.e., your) authorization
ID. This parameter affects the CREATE PROCEDURE statement only.
- Commit on Return
- Enter Y to specify that DB2 should commit the transaction immediately
on return from the stored procedure. This parameter affects the
CREATE PROCEDURE statement only.
- Special Registers
- Enter D to have special registers initialized to default values or Ito inherit values from the calling environment. This parameter affects
the CREATE PROCEDURE statement only.
- Call on Null Input
- Enter Y to specify that the stored procedure should be called even
if any of its input parameters is null. This parameter affects the
CREATE PROCEDURE statement only.
- Miscellaneous Options
- Enter / to display the Miscellaneous Options pop-up window, on which you
can specify additional miscellaneous options for the program.
- COBOL Dialect
- Enter 1 to generate an OS/VS COBOL program, 2 to generate a VS COBOL II program, 3 to generate a COBOL for MVS program, or 4 to generate a COBOL for OS/390(R) program.
This option must be 3 or 4 for a stored procedure program. This option must be 2, 3, or 4 for a data layer program.
- HPO/Sort
- Enter Y to replace an ORDER BY clause in the query with a COBOL internal sort. If you enter N, any ORDER BY clause will not be replaced. This option must be set to N for a CICS program or a TSO print program. This option is
not available for a stored procedure program, a data layer program,
or a non-SELECT query.
- HPO/Runtime
- Enter Y to generate a program that requires the HPO runtime modules.
Enter N to generate a program that is fully standalone (that is,
does not require the HPO runtime modules). Set this option to N for a CICS program. Also, set this option to N for a TSO display program if an online print program is specified,
or for a TSO print program. This option is not available with a stored
procedure program, a data layer program, or a non-SELECT query.
- RAACPY Calls
- Enter Y to include static calls to the RAACPY routine in the generated
program to further improve the program's performance. Enter N to omit those calls, so that the generated program will be
fully standalone. This option is disabled for a data layer program
and for a non-SELECT query.
- Skeleton Member
- Enter the name of a member to use as the skeleton for the generated
program. If you leave this field blank, the default member will
be used. Program Generator searches for this member in the following
locations:
- RAASLIB DD (if allocated)
- ISPSUSR DD (if allocated and LIBDEF for ISPSLIB activated)
- LIBDEF for ISPSLIB (if active)
- ISPSLIB DD (if allocated)
- QMFHPO.SRAASKEL data set (if not found in any of the above locations)
- Author
- Enter the value to use as the program author in the generated program.
- Description
- Enter comment text to include as a description in the generated program.
Any text entered is included verbatim in the source code, starting
in column 8.
- Source Code Data Set
- Enter the data set to which the generated program should be
written. If the data set does not exist, the Allocate Data Set pop-up
window will be displayed, allowing you to allocate it. If the name
is enclosed in single quotes, it is taken to be a fully qualified
TSO data set name. Otherwise, your current TSO profile prefix is
used to qualify the name.
- Source Code Member
- If the specified Source Code Data Set is
a PDS, this is the member to which the generated program should
be written. If you leave this field blank, then the value in the Program/Plan Name field
will be used. Leave this field blank if the Source Code Data Set is
not a PDS.
