Professional Documents
Culture Documents
Devoloping DB2 QMF Applications
Devoloping DB2 QMF Applications
SC18-9687-00
DB2 Query Management Facility
SC18-9687-00
Note!
Before using this information and the product it supports, be sure to read the general information under Appendix D,
“Notices,” on page 213.
Contents v
DSQCOMM for FORTRAN . . . . . . . . . . . . . . . . . . . 171
Running your FORTRAN programs . . . . . . . . . . . . . . . . 173
PL/I language interface . . . . . . . . . . . . . . . . . . . . . 176
Interface communications area mapping for PL/I (DSQCOMML) . . . . . 177
Function calls for PL/I . . . . . . . . . . . . . . . . . . . . . 178
PL/I programming example . . . . . . . . . . . . . . . . . . . 179
DSQCOMM for PL/I . . . . . . . . . . . . . . . . . . . . . 182
Running your programs under CICS . . . . . . . . . . . . . . . 184
Running your programs under TSO . . . . . . . . . . . . . . . . 185
REXX language interface . . . . . . . . . . . . . . . . . . . . 189
Interface communications variables for REXX . . . . . . . . . . . . 189
Function call for REXX . . . . . . . . . . . . . . . . . . . . 190
REXX programming example . . . . . . . . . . . . . . . . . . 191
Running your REXX programs . . . . . . . . . . . . . . . . . . 192
A REXX example of using an INTERACT loop . . . . . . . . . . . . 193
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
NLFs let users enter QMF commands, view help, and perform QMF tasks in
languages other than English; they are installed as separate features of DB2 QMF.
For more information about installing an NLF, see Installing and Managing DB2
QMF for TSO/CICS.
All tasks described here can be performed for the base QMF product (English
language) and for any NLF. The procedures for both the base and NLF sessions
are the same; however, any special considerations for NLF users are preceded by
the following phrase: “If you are using an NLF”.
Some names of programs or data sets shown in this information have an "n" in
them, indicating that this character of the name can vary. If you are using an NLF,
replace any "n" symbols you see with the one-character national language identifier
(NLID) from Table 1 that matches the language feature that you are using. The table
also shows the names by which QMF recognizes each language.
Table 1. QMF NLFs and their identifying information
Name that QMF
National Language Feature Identifier (NLID) uses for this NLF
English E ENGLISH
Uppercase English U UPPERCASE
Canadian French C FRANCAIS CANADIEN
Danish Q DANSK
French F FRANCAIS
German D DEUTSCH
Italian I ITALIANO
Japanese Kanji K NIHONGO
Korean Hangeul H HANGEUL
The Uppercase English feature uses the English language, but converts all text to
uppercase characters. The uppercase characters allow users working with
Katakana display devices to use the product and get English online help and
messages.
Prerequisite knowledge
You should be familiar with the components that make up your specific
environment, as well as some concepts and terms, before you begin application
programming for QMF.
Products
To develop applications for QMF, you may need to be familiar with some or all of
the following products, depending on your environment and your business needs:
v The z/OS® operating system.
v DB2®, the database manager for QMF.
v Time Sharing Option (TSO), which is an environment that supports DB2 QMF
and its related products.
v Interactive System Productivity Facility (ISPF), a dialog manager for DB2 QMF.
v Customer Information Control System (CICS®), a general-purpose data
communication and online transaction processing system. CICS provides the
interface between DB2 QMF and z/OS.
v The base Graphical Data Display Manager (GDDM®) product, which is required
to display panels and create charts. You can also use GDDM to provide printing
services from QMF.
v Assembler, C, COBOL, FORTRAN, PL/I or REXX, which you might use to create
callable interface applications for QMF.
v Any language that runs under ISPF, which you will use to create applications that
make use of the QMF command interface.
Publications that explain these products can be found in the IBM Publications
Center at www.ibm.com/shop/publications/order.
Concepts
QMF applications let you work with QMF objects and perform QMF functions from
within an application program written in one of the languages QMF supports. This
information assumes you already know how to write queries and procedures, format
reports, and modify the database.
Support information
To find service updates and support information (including PTFs, Frequently Asked
Questions (FAQs), technical notes, troubleshooting information, and downloads)
refer to the following Web page:
www.ibm.com/software/data/qmf/support.html
Accessibility features
Accessibility features help a user who has a physical disability, such as restricted
mobility or limited vision, to use a software product successfully. The major
accessibility features in QMF enable users to:
v Use assistive technologies such as screen readers and screen magnifier
software. Consult the assistive technology documentation for specific information
when using it to access z/OS interfaces.
v Customize display attributes such as color, contrast, and font size.
v Operate specific or equivalent features by using only the keyboard. Refer to the
following publications for information about accessing ISPF interfaces:
– z/OS ISPF User’s Guide, Volume 1, SC34-4822
– z/OS TSO/E Primer, SA22-7787
– z/OS TSO/E User’s Guide, SA22-7794
These guides describe how to use ISPF, including the use of keyboard shortcuts
or function keys (PF keys), include the default settings for the PF keys, and
explain how to modify their functions.
This topic describes the two major types of QMF applications and the application
development tools QMF provides to help you implement your application.
Given these definitions, you can begin making the design decisions that affect how
your end users use your application and what QMF application tools you use to
enable your application to interact with QMF.
====> 1
If the user selects option 1, the application executes a QMF procedure that runs a
query and prints the resulting report.
In the example in Figure 1, your application controls QMF. Your user interacts only
with your user interface and is not aware that QMF is active.
You expect your users to run your application from within the QMF environment.
The users can use the command line to issue a QMF command synonym called
SEND_TO (which you create) or you can assign the application to a function key
that automatically runs your application.
After generating a report, the user can send the report to Smith by entering SEND_TO
SMITH on the QMF command line, as shown in Figure 2 on page 3.
QMF procedures
QMF procedures are QMF objects that run within QMF and issue QMF commands.
QMF procedures can execute any QMF commands available at your site. QMF
provides two types of procedures: linear procedures and procedures with logic.
v Linear procedures contain only QMF commands and comments. You can use
linear procedures in all environments supported in QMF.
v Procedures with logic combine QMF commands with REXX logic to enable you
to create more powerful programs. You can use procedures with logic in all
environments supported in QMF, except CICS. Procedures with logic can contain
QMF commands and any statement that is valid in a REXX program, including
system commands.
For general information about writing linear procedures or procedures with logic,
see Using DB2 QMF. For specific information about using QMF procedures to write
applications, see Chapter 2, “Using procedures as applications,” on page 7.
QMF provides a system initialization procedure that allows you to run commands
and set global variables before the user sees the QMF home panel.
Callable interface
You can use the QMF callable interface to create an application invoked outside of
QMF, which starts a QMF session and sends commands to QMF for execution.
QMF supports all versions of these programming languages that are supported by
DB2 for z/OS. For details on supported versions, see your DB2 information.
For more information about the callable interface, see Chapter 3, “Using the callable
interface for applications,” on page 17.
Command interface
The QMF command interface allows you to create applications that submit
commands to QMF from an ISPF dialog. QMF communicates with the ISPF dialog
through the ISPF variable pool using this command interface.
The command interface is available only where ISPF is available; it is not available
in CICS.
For more information about the QMF command interface, see Chapter 4, “Using the
command interface for applications,” on page 25.
Callable interface:
v Is available for all QMF-supported environments
v Does not require ISPF
v Does not require QMF to be started before you run your application
Command interface:
v Is available in all environments supported in QMF and ISPF
For more information about the externalized formats of QMF objects, see Chapter 9,
“Exporting and importing objects,” on page 61.
Command synonyms
QMF allows you to specify command synonyms for programs or procedures that
you code. These command synonyms allow end users to use your programs and
procedures just as they would use any QMF command.
For more information about command synonyms, see “Using command synonyms”
on page 56.
If you are using QMF in the CICS environment, you can use QMF linear
procedures. If you are using QMF in the TSO environment, you can also use REXX
statements and functions in your QMF procedures. REXX functions and procedures
with logic are not available in the CICS environment.
This topic focuses on information you need to know to use QMF procedures to
implement your application. For information about how to create, build, and run a
procedure, see Using DB2 QMF.
Using ISPF services in a QMF procedure requires a few extra steps. For
information about running ISPF commands from a QMF procedure with logic
running under ISPF, see “Using ISPF services from a procedure with logic” on page
32.
For example, if you write your application as a procedure and code your application
to save the current procedure in QMF temporary storage, the application saves
itself; it is the current procedure in QMF temporary storage while it is running.
Initial procedures
An initial procedure is a procedure that runs immediately after your QMF session
starts. Use the DSQSRUN parameter to specify the name of this procedure. You
can use DSQSRUN:
v With the DSQQMFn command when QMF is started interactively (where n is a
one-character identifier from Table 1 on page vii that reflects the NLF you are
using)
v With the QMF START command when QMF is started through the callable
interface
In TSO, ISPF, and native z/OS batch, applications can also set program parameters
using a REXX program as described by the DSQSCMD parameter of the QMF
START command. Because QMF for CICS does not support REXX, you must
specify all program parameters on the START command using DSQSMODE=I,
which specifies interactive operation, in CICS. The default mode from the callable
interface is B (for batch operation).
For more information about the DSQSRUN parameter, see Installing and Managing
DB2 QMF for TSO/CICS.
The number of ampersands that you need to specify with VAR1 depends on
whether QMF is running under CICS, TSO, or native z/OS batch, if ISPF is
present, and if the program starting QMF is written in REXX.
If you use the QMF CONNECT command from either your initial procedure or the
command line during an interactive session set up by an initial procedure, you must
code the application to reconnect to your original location before you can code an
END command to invoke your initial procedure again.
If you are still connected to the remote location, you will receive an error.
When you write procedures that use the QMF CONNECT command to access
remote databases, be aware of the following:
v If you are connected to a remote database and issue a RUN PROC command,
that procedure and all the objects used in that procedure must be stored at the
remote database.
v All QMF commands in the procedure are run in QMF temporary storage at the
system where QMF is running (the local system). However, all objects used by
these QMF commands (such as queries, procedures, or forms) must be defined
in the database at the current location (the remote system).
For more information about using the QMF CONNECT command and
remote-unit-of-work support, see DB2 QMF Reference.
v Commands that affect the database (SQL statements, QMF queries, or EDIT
TABLE updates) run at the current location.
v If the procedure contains system-specific commands (CICS or TSO), these
commands run at the system where QMF is running (the local system).
If your procedures contain system-specific commands that do not run on the
system where QMF is running, your procedure will not run successfully.
v Any data sets or data queues used in a system-specific command must exist on
the system where QMF is running (the local system).
| v If your site uses TSO and takes advantage of RACF® support for mixed-case
| passwords, ensure that the CASE option of your QMF profile is set to MIXED.
| Otherwise, QMF converts all input to upper case, causing the CONNECT
| command to fail. When CASE=MIXED, ensure that you tell QMF application
| users to enter all input in upper case, because QMF only recognizes commands
| in upper case.
A substitution variable is any variable that you can use in a QMF command. A
substitution variable is always preceded by an ampersand (&). You can assign a
value to a substitution variable by setting global variables, by specifying values on
the RUN command, or by specifying values on the RUN command prompt panel.
For information on setting global variables, see “SET GLOBAL” on page 49.
See Using DB2 QMF to learn more about using ampersands with substitution
variables in QMF as well as how to write linear procedures and procedures with
logic.
In this example:
v The variable value VACATION is surrounded by single quotes because the value is
a character string.
v TYPE is preceded by double ampersands (&&) to indicate that the value is being
set on the RUN statement to be passed to the procedure named SCHEDULE. If
the RUN statement specifies &TYPE, the procedure containing this statement
prompts the user for the value.
This value for the substitution variable is active only within the procedure that
defines it. The value is not active in any procedure or module called from the
defining procedure.
If you issue the QMF RUN command from within a PROC or QUERY panel, you do
not need to specify the PROC or QUERY object types. The RUN command
assumes these values when you invoke it from the respective object panels.
This value for the substitution variable is active only within the procedure that
defines it. The value is not active in any procedure or module called from the
defining procedure.
For more information about writing linear procedures and procedures with logic, see
Using DB2 QMF.
If you want a procedure with logic to prompt you for all the necessary variable
values at one time like a linear procedure does, use a dummy procedure. For
example, suppose that you want to be prompted once for the substitution variables
LASTNAME and DEPT_NUM, which occur on two different lines in your procedure
with logic as shown in Figure 3 on page 11.
/* This procedure runs two queries, displaying the report after each */
/* procedure has run. */
Add the following line to the beginning of your procedure with logic, immediately
following the comment lines. (All procedures with logic must begin with at least one
comment line.)
"RUN PROC PROMPT_ME (&LASTNAME, &DEPT_NUM";
In this command, PROMPT_ME is a procedure with logic like the following, which
contains a comment line and no instructions:
/* This procedure is a dummy procedure that provides prompting */
Figure 4 shows the completed procedure with the RUN PROC command for the
PROMPT_ME procedure that prompts for variables:
/* This procedure runs two queries, displaying the report after each */
/* procedure has run */
Alternatively, you can use SET GLOBAL to prompt for all the values in your
procedure at the same time, as in the following example:
"SET GLOBAL (LASTNAME=&LASTNAME,DEPTNUM=&DEPT_NUM";
For more information on REXX variables, see the REXX reference information for
your system in the IBM Publications Center at www.ibm.com/shop/publications/
order. For details on using the GET GLOBAL and SET GLOBAL commands in
procedures with logic, see DB2 QMF Reference.
Use the ARG option when you are running a procedure that contains a REXX
PARSE ARG or ARG statement, as in the example shown in Figure 5:
/************************************************************************/
/* This procedure shows you how to use the ’ARG=’ option on the RUN */
/* PROC command. */
/************************************************************************/
parse upper arg query_name form_name
"RUN QUERY" query_name "(FORM="form_name
Figure 5. Passing variable values using the ARG option of the RUN PROC command
In this command, query_name and form_name are REXX variable names that
describe the parameters being passed to the procedure with logic; they contain the
object names for a query and a form, respectively. Using these variable names
allows you to reference the parameters that were passed to the procedure with
logic.
Table 3 shows which message you see based on the given conditions.
Table 3. Messages returned from QMF
Return code from
the last QMF Procedure return Examples of messages at the completion
command code of the procedure
0 0 OK, your procedure was run
The return code from your procedure was
0 Nonzero 8
Nonzero 0 The error message provided by QMF
Nonzero Nonzero The error message provided by QMF
A QMF error message takes precedence over the return code message if you have
an incorrect QMF command and a nonzero return code.
If you want to show the error message from the last command and exit with a QMF
return code, use the MESSAGE command and the EXIT DSQ_RETURN_CODE
instruction, as in the example in Figure 6:
..
.
"MESSAGE (TEXT=’"dsq_message_text"’"
exit dsq_return_code
/* Monthly report */
Signal on error
"DISPLAY TABLE JUNE_INFO"
"PRINT REPORT"
Exit(0);
Error: Original_msg = dsq_message_text
/* Saves error message. */
"RUN PROC GENERAL_RECOVERY"
/* This proc generates */
/* new dsq_message_text. */
"MESSAGE (TEXT=’" Original_msg "’"
/* Display original error msg. */
Exit dsq_return_code;
For more information on the MESSAGE command, see “MESSAGE” on page 46.
For more information about the syntax of the CALL instruction, see DB2 QMF
Reference.
v A function
You also can call the program PANDA as a function:
answer = PANDA()
For more information on any of these commands, see the REXX reference
information in the IBM Publications Center at www.ibm.com/shop/publications/order.
You might consider removing the substitution variables from the RUN command if
you want to call your programs using one of the REXX invocation calls. In that
case, QMF prompts the user for the variables.
Whether you are running a procedure with logic or a callable interface program
invoked by a procedure with logic, commands come into QMF the same way. In this
context, the callable interface program becomes a logical extension of the
procedure itself.
In a procedure with logic, use two ampersands on the substitution variable to pass
the variable to the query:
If a substitution variable has only one ampersand, QMF resolves the variable for the
procedure itself and cannot pass the variable to the query.
If you call a REXX callable interface application from a procedure with logic, and
that application contains the command RUN QUERY WEEKLY_Q (&DEPT=58, QMF
resolves the variable just as it would for the calling procedure. Because only one
ampersand is used, the variable is not passed to the query.
For specific information about the QMF callable interface for a particular language,
see the information in Appendix A, “Sample code for callable interface languages”
that describes the callable interface for that language:
Assembler “Assembler language interface” on page 125
C Language “C language interface” on page 142
COBOL “COBOL language interface” on page 153
FORTRAN “FORTRAN language interface” on page 164
PL/I “PL/I language interface” on page 176
REXX “REXX language interface” on page 189
When an application program needs to run a QMF command, it must first issue a
call to a QMF-supplied routine to start communication between the program and
QMF. This call is made to the QMF-supplied interface routine. QMF supplies a
routine for each supported language.
The application program can issue one or more QMF commands after the initial
start call. The application program calls the QMF-supplied routine to issue each
QMF command.
After the QMF command finishes processing, QMF supplies a return code that
indicates the status of QMF. The callable interface gathers other information about
the processing of the command and stores this information in variables accessible
to both QMF and the application program. These variables are contained in either a
variable pool or in an interface communications area. When the callable interface
returns control to the calling application program, the application can refer to these
variables but should not alter them.
When the application program no longer needs to use QMF, the program issues a
call to terminate communication between the program and QMF. This call is made
to the QMF-supplied routine.
Figure 8 shows how the application passes commands through the callable
interface to QMF.
Figure 8. How an application uses the QMF callable interface to communicate with QMF
both QMF and the callable interface application, although only QMF should alter the
values. The application program should view these variables as read-only.
The QMF callable interface communications area is required for all callable
interface calls. Storage for the callable interface communications area is allocated
by the program that is using QMF.
When running the START command, QMF updates the variables within the interface
communications area.
These variables must never be altered by the application program, with the
following exceptions:
DSQ_COMM_LEVEL
Set DSQ_COMM_LEVEL to the value of DSQ_CURRENT_COMM_LEVEL
to identify the level of DSQCOMM. This does not apply to REXX.
DSQ_INSTANCE_ID
If you call a callable interface program from within QMF, you need to set the
DSQ_INSTANCE_ID to zero (0) on the first call so that QMF resets the
variable to the value set by the initial START command.
All calls that follow the START command must pass the address of the interface
communications area that corresponds to the QMF instance. The application
program is responsible for pointing to the correct interface communications area.
The variables within the interface communications area contain the information in
Table 4.
Table 4. DSQCOMM fields that must not be altered
Information
provided by the
variable Description
Return code Indicates the status of QMF processing after QMF processes a
command.
Instance identifier Identifies the instance of QMF that was started by the START command.
Completion Contains the message ID of the message that QMF displays.
message ID
This field is set at the completion of every QMF command. It contains the
message QMF displays at the end of a command.
This field is set when an error occurs while a query is running. It contains
the message that QMF displays within the query object at the end of a
command.
START command Contains the name of the parameter in error when the START command
parameter in error fails because of a parameter error.
Cancel indicator Indicates whether the user canceled processing while QMF was running
the command.
Completion Contains the completion message that QMF displays.
message
Query message Contains the query message text of the message that is displayed on the
query panel upon completion of a RUN QUERY command.
For example, if you run a query object with an error, QMF displays a
message describing the error that prevented the query from running. The
query message field then contains this error message text.
Return codes
Return codes are returned after each call to the QMF callable interface. Return
code values are described by the interface communications area provided with
QMF.
If you want your applications to be portable across systems, the applications must
reference the values of these codes by the variable names, because the values can
be different on other systems. (For the names of the return-code variables within
the interface communications area for each programming language, see
Appendix A, “Sample code for callable interface languages,” on page 125.)
Table 5 shows the possible return codes for callable interface conditions.
Table 5. Callable interface return codes
Value Explanation
0 Successful execution
4 QMF session marked for termination by an EXIT or END command
8 Execution failed, but the error did not mark the session for termination
16 Severe error: session marked for termination
The START command works only in the callable interface. To use the GET GLOBAL
and SET GLOBAL commands in a callable interface application written in a
language other than REXX, use the extended syntax for these commands. The
extended syntax of the SET GLOBAL command allows you to set global variables
that have values up to 32,768 characters long. For more information on using the
GET GLOBAL and SET GLOBAL commands in a callable interface application, see
“GET GLOBAL (extended syntax)” on page 43 and “SET GLOBAL (extended
syntax)” on page 49.
For information about these and other commands you can use in a callable
interface application, see Chapter 8, “Using QMF commands in applications,” on
page 41. To see examples of the START and SET GLOBAL commands for each
language, see the programming examples for each language:
Assembler “Assembler programming example” on page 128
C Language “C language programming example” on page 145
COBOL “COBOL programming example” on page 156
FORTRAN “FORTRAN programming example” on page 167
PL/I “PL/I programming example” on page 179
REXX “REXX programming example” on page 191
Your application can issue a START command to test whether QMF has already
been started. If QMF has not been previously started, it starts. If QMF was
previously started, the return code is nonzero, and you receive the following
message number and message:
DSQ50719 QMF already active. Secondary session not permitted.
To pass parameters to QMF, specify the desired command keywords on the START
command. For details about the syntax and keywords used with the START
command, see “START” on page 50.
For specific information about setting up your environment and compiling and
running your callable interface application, see the appropriate coding sample for
your language in Appendix A, “Sample code for callable interface languages,” on
page 125.
If you need to modify a QMF object from a user program, you can use the callable
interface from within QMF. For example, you can export or import objects through
the callable interface during an interactive QMF session. You can use the callable
interface from within QMF by using the TSO command to call the application. You
can run any valid QMF command from the application.
You must set the DSQCOMM instance identifier (DSQ_INSTANCE_ID) to zero (0)
before your first call to QMF. QMF determines the current instance and updates
DSQ_INSTANCE_ID for use in subsequent QMF calls.
Error handling
At the completion of every QMF command, the DSQCOMM communications area
contains message text in the dsq_message_text variable and a return code in the
dsq_return_code variable. The return code is assigned one of the following values:
dsq_success Successful completion of the command
dsq_warning Normal completion with warnings
dsq_failure Command did not run correctly
dsq_severe Severe error; QMF session terminated
For a complete list of variables or fields in each DSQCOMM area, see Appendix A,
“Sample code for callable interface languages,” on page 125 and read the
information specific to the programming language you are using.
The QMF command interface allows you to issue QMF commands from an ISPF
dialog running under QMF. Using this interface, QMF communicates with the dialog
through the ISPF variable pool, as shown in Figure 9.
ISPF
ISPF
Variable
Pool
Application
Program QMF
The following topics explain how to develop applications that make use of the
command interface:
v “Writing a program that uses the command interface: an example”
v “Invoking the command interface” on page 26
v “The END command” on page 26
v “Using variables in the command interface” on page 27
v “Command interface return codes” on page 27
To use the command interface effectively, you need to understand ISPF services
and variable pools. The IBM Publications Center at www.ibm.com/shop/publications/
order contains the ISPF publications, which provide additional information.
After you start the command interface, you can pass QMF commands you want to
run using the PARM parameter of the ISPF SELECT PGM command, as follows:
SELECT PGM(DSQCCI) PARM(qmf_command)
If you want to use QMF command prompts from your ISPF application, you can
issue the INTERACT command followed by the QMF command for which you need
a prompt to appear, followed by a question mark. For example, to display the RUN
QUERY prompt panel, issue the following command:
SELECT PGM(DSQCCI) PARM(INTERACT RUN QUERY ?)
The SELECT service requires you to use double ampersands on a RUN QUERY
command. This prevents ISPF from interpreting the variable as one of its own.
On the invocation, do not specify the NEWPOOL or NEWAPPL option. Omitting the
NEWPOOL or NEWAPPL options ensures that the command interface can access
your application’s variables. The command interface uses the shared pool to
communicate between QMF and your application.
QMF will set the global variable DSQCSESC to mark the session for termination if it
encounters an EXIT command or a severe error during a command interface
invocation. When the program that called DSQCCI ends and returns control to
QMF, the QMF session terminates.
Return codes appear in a variable in the user’s exec or CLIST. If you run a REXX
exec, the return code is in the REXX variable called RC; if you run a CLIST, the
return code is in the CLIST variable &LASTCC.
The following example shows an exec that examines a return code. The example
shows how to run a query and test for an error using the REXX variable RC:
ADDRESS ISPEXEC SELECT PGM(DSQCCI) PARM(RUN QUERYA (FORM=FORMA))
Select
When (RC = 0) Then nop
When (RC = 64) Then
Say "You must run QMF with ISPF to use command interface."
When (RC = 100) Then
Say "You need to start QMF before you begin your application"
Otherwise
Say "Unexpected error ("RC") from QMF command interface."
End
You can place code for handling errors in program modules as well as in execs or
CLISTs.
A return code of 4 occurs only on the command that caused the session to be
marked for termination. If the application then attempts to run another command,
QMF returns another return code value to the application.
These return codes usually indicate more serious errors than those in the 0 through
16 range. Some may require the services of the IBM® Support Center.
Some codes indicate that the command was run but the shared variables were not
set. This means that QMF ran the STATE command properly, but the command
interface failed to set the updated shared QMF and STATE variables for the reason
given in the explanation of the error code.
Table 7. Return codes of 20 or more
Value Explanation
20 A user exit routine called the command interface; these calls are always
invalid. The command passed to the command interface was not run. The
shared variables were not set.
24 An error occurred in an ISPF VCOPY command. The command passed to
the command interface was run. The shared variables were not set.
32 An error occurred in an ISPF VREPLACE command. The command passed
to the command interface was run. The shared variables were not set.
36 An error occurred in an ISPF VPUT command. The command passed to the
command interface was run. The shared variables were not set.
40 An error occurred in an ISPF VREPLACE command. This code applies only
to the execution of the STATE command. The command passed to the
command interface was run, but the shared variables were not set.
44 An error occurred in an ISPF VPUT command. This code applies only to the
execution of the STATE command. The QMF variables were set, but the
STATE variables were not.
60 An invalid call was made to the command interface. The command passed
to the command interface was not run. The shared variables were not set.
64 This error is issued when DSQCCI is run and ISPF is not active. For
example, the user could have called DSQCCI without using an ISPF
SELECT PGM command.
100 This error occurs when an application tries to issue a QMF command when
QMF is not active. Start QMF before you begin your application. The
command passed to the command interface was not run. The shared
variables were not set.
104 The anchor was not located. The command passed to the command
interface was not run. The shared variables were set but are not valid.
When QMF is started in TSO, ISPF, or native z/OS, QMF creates a REXX
command environment called QRW. When you are executing a REXX program, you
can set the default command environment to QRW by issuing the REXX ADDRESS
command ADDRESS QRW. With ADDRESS QRW, QMF remains the default command
environment until you issue another ADDRESS command.
You can also direct a single command to be executed by the QRW environment by
issuing the REXX ADDRESS command followed by the QMF command:
ADDRESS QRW qmf_command
In this situation, QMF is the command environment only for the command that
follows the ADDRESS QRW statement.
When you are using a QMF procedure with logic, QRW is the default command
environment.
The following example shows how to use the QMF command environment:
..
.
call dsqcix "START (DSQSMODE=INTERACTIVE"
if dsq_return_code=dsq_severe | dsq_return_code=dsq_failure
then exit dsq_return_code
ADDRESS QRW
"RUN PROC MONDAY_P"
if dsq_return_code=dsq_severe | dsq_return_code=dsq_failure
then exit dsq_return_code
"EXIT"
if dsq_return_code=dsq_severe | dsq_return_code=dsq_failure
.. then exit dsq_return_code
.
This topic outlines considerations for using the callable interface with ISPF. The
following topics are covered:
v “Starting and running QMF from an ISPF application”
v “Running queries that contain variables” on page 32
v “Using QMF to invoke a program that uses ISPF services” on page 32
v “Using ISPF services from a procedure with logic” on page 32
v “Using the EDIT command with ISPF” on page 33
v “Using ISPF to debug applications” on page 34
For general information about using the callable interface, see Chapter 3, “Using the
callable interface for applications,” on page 17. For information on using the
command interface, see Chapter 4, “Using the command interface for applications,”
on page 25.
The PL/I program MYPROG then starts QMF using the callable interface START
command.
For a list of NLF identifiers, see the description for the DSQALANG keyword in
Table 8 on page 52.
v Use the GET GLOBAL or SET GLOBAL commands in your application instead of
the STATE command to set and retrieve variable values
The GET GLOBAL and SET GLOBAL commands work for all the QMF global
variables; the STATE command works only for variables containing state
information. For more information about STATE variables, see one of the
following topics:
Use the CMD keyword to indicate to ISPF that you are running your program as an
ISPF dialog function. The syntax for this command is:
ADDRESS ISPEXEC "SELECT CMD(cmdname)"
or
ADDRESS ISPEXEC "SELECT CMD(cmdname parameters)"
To set the correct ISPF environment and run a program containing your ISPF
commands, use the following ISPF SELECT CMD statement with the CMD
keyword:
In this statement, userprogram is the program that contains your ISPF commands.
For example, if the program that contains your ISPF commands is called DIALOG,
include the following command in your procedure with logic:
ADDRESS ISPEXEC "SELECT CMD(DIALOG)"
You can also use a QMF TSO command to run your program that contains ISPF
commands (for example, TSO DIALOG). In this case, QMF issues the ISPF SELECT
CMD statement for you.
If you are running QMF under ISPF, and your procedure with logic starts a program
requiring ISPF services, your procedure must start this program using the ISPF
SELECT CMD environment. For example, suppose you are running QMF under
ISPF and your procedure with logic issues the DB2 command DSN. Because the
DSN command uses ISPF services, you should use one of the following commands
to issue the DSN command:
ADDRESS ISPEXEC "SELECT CMD(DSN)"
or
ADDRESS ISPEXEC "SELECT CMD(DSNEXEC)"
In the second statement, DSNEXEC is a program that contains the ADDRESS TSO
DSN statement.
If you issue the QMF EDIT command from a PROC or QUERY panel, you do not
need to specify the PROC or QUERY object types. EDIT assumes these values
when you invoke it from their respective panels. By default, the QMF EDIT
command places your procedure or query in a PDF editor session. QMF starts the
PDF editor using the QMF application ID DSQn, where n is the NLF identifier. QMF
also sets the function keys and the location of the command line to match your
QMF application.
To override the default editor, use the EDIT QUERY and EDIT PROC commands as
follows:
EDIT QUERY (E=name
EDIT PROC (E=name
you are using). You might want to use an application ID different from the QMF
default application ID if you want to have function keys different from those QMF
provides.
If you are using PDF EDIT options that require PDF PROFILE data set members,
you must create those members. For example, the PDF EDIT RECOVERY option
requires a DSQnEDRT PROFILE data set member (where n is the NLF character
from Table 1 on page vii) that must exist before you use the EDIT command.
For more information about the QMF EDIT command, see DB2 QMF Reference.
In this statement, message-id is the identification code for the message that is to be
retrieved from the message library and written to the log.
The Dialog Test service has many other useful options for debugging your
application. For example, you can perform debugging interactively. You can run all
or portions of your application, examine the results, make changes, and rerun it.
You can also use Dialog Test to:
v Start selection panels, command procedures, and programs
v Display panels
v Add variables and modify variable values
v Run ISPF dialog services
v Add, modify, and delete breakpoint definitions
v Add, modify, and delete function and variable trace definitions
The trace (TRACES) option of the Dialog Test service enables you to create,
change, and delete trace definitions, as well as monitor dialog service calls and
dialog variable usage. During processing, if any of the trace definitions are satisfied,
trace output is written to the ISPF log. You can use the LOG option of Dialog Test
to browse the ISPF log, or you can examine the printed output when you exit ISPF.
For more information about ISPF services in general and Dialog Test in particular,
see the ISPF publications in the IBM Publications Center at www.ibm.com/shop/
publications/order.
Each national language that QMF supports is called a National Language Feature
(NLF). An NLF provides a user with a QMF session that is tailored to a specific
national language.
QMF provides bilingual support for commands and forms. You can run English QMF
commands and display English forms in any NLF. This topic provides information
about working with QMF in one or more NLF environments. The following topics are
covered:
v “Comparing the English and NLF environments”
v “Creating objects for use in bilingual applications” on page 36
v “Using the command language variable” on page 37
v “Using an initial procedure in a bilingual application” on page 38
v “Using English commands” on page 38
v “Multilingual environments” on page 39
v “Creating translatable applications” on page 39
Environmental similarities
In many ways, the QMF session environment is the same no matter which NLF is in
operation. The most important similarities are:
v Capabilities
In general, you can do anything in an NLF session that you can do in an
English-language session. You can create objects in temporary storage and save
them in the database, format and print reports, and issue SQL commands. You
can also run Prompted Query, SQL and QBE queries, as well as QMF
procedures. The difference between the English and NLF environments lies not
in what you can do, but in how you need to enter your input and what languages
are displayed.
v SQL and QBE
The verbs, operators, and keywords of the SQL and QBE languages are not
translated.
v Usage codes for forms
These are identical; they are not translated.
v System commands
TSO and CICS commands can still be issued from QMF through QMF’s TSO or
CICS command. These commands are unaffected by translation: enter TSO or
CICS followed by the command to be run, and write the command exactly as you
would if you were running it outside of QMF.
Environmental differences
Some of the differences between the NLF environment and the English-language
environment are:
v The QMF command language
Every NLF has a complete set of translated QMF verbs and keywords. These
translated verbs and keywords must appear in your QMF commands when you
are operating in the NLF’s language environment. For a given NLF, these words
might be translated. For example, suppose that, in the German NLF, the verb
DISPLAY and the keyword PROC are translated into ANZEIGEN and
PROZEDUR, respectively. During a German NLF session, QMF understands the
command ANZEIGEN PROZEDUR, but does not understand DISPLAY PROC.
Some elements of the QMF language are command synonyms and can be
translated. As a result, each NLF has its own uniquely-named command
synonym table. When the NLF is installed, its command synonym table is
created, and the profile for the NLF indicates the command synonym table name
for that NLF. For more information on creating command synonyms, see
Installing and Managing DB2 QMF for TSO/CICS.
v QMF panels and messages
Every NLF has a complete set of translated QMF messages and panels. Like the
verbs and keywords for QMF commands, these might or might not be translated.
In most cases, they are translated. Within the panels and messages, the fixed
portions of text can be translated. Information that can vary within each panel or
message, such as query names, is not translated.
v Allowable panel input
Many QMF panels requiring user input, such as prompt panels and form panels,
restrict the range of some entries to a small set of keywords, which are
translated. YES and NO responses in English, for example, are JA and NEIN in
German.
v Profile parameter values
In a multilingual environment, users have a separate profile for each available
NLF they can use for a QMF session. For each of these profiles, the parameters
are the same and have the same meanings, but the parameter names are
translated. Certain parameter values are also translated.
For example, in an English profile, the CASE parameter can have the value
UPPER, STRING, or MIXED. In a German profile, the CASE parameter is the
SCHRIFT parameter, and the valid values are GROSS, KETTE, and GEMISCHT.
v Exported and saved form objects
The SAVE, EXPORT, and IMPORT commands let you specify the language in
which you want form objects saved. You can save them in English, or in the
presiding language of your current session. For more information on these
commands, see DB2 QMF Reference.
v Sample tables and queries
IBM supplies translated versions of the English sample tables and queries.
You can translate to English a form that you create and save in an NLF by issuing a
SAVE command. For example, in French, the command to save in English a form
called SEMAINE_F as WEEKLY_F is:
SAUVER FORMAT SEMAINE_F EN WEEKLY_F (LANGUE=ANGLAIS
This converts your NLF form to an English form that you can use in your bilingual
application.
For example, suppose that your application is a procedure named WEEKLY_P. The
commands shown in Figure 11 demonstrate how to switch between English and the
presiding NLF language. Following the figure is an explanation of each line.
Figure 11. Switching in a procedure between English and the presiding NLF language
These commands can be part of any valid QMF application, from an initial
procedure to a high-level language program, but they must be in this order. The
commands in the example do the following:
1 This line of the procedure saves the presiding language value into a
variable.
The GET GLOBAL command saves the value for the presiding language in
a variable called CURR_LANG.
2 This line of the procedure sets the presiding language to the language for
which the application was written.
Since the WEEKLY_P application in this example was written using English
commands, the SET GLOBAL command sets the presiding language to
English by setting the DSQEC_NLFCMD_LANG variable to 1.
3 This line of the procedure runs the application.
After the QMF session is set to English, the application in the example can
be run. User commands must be in English. However, if a user presses a
function key, the underlying command is assumed to be in the presiding
language.
QMF assumes that prompt panels are in the user’s presiding language. For
the EXPORT and IMPORT command prompt panels, the default data set
type, data queue type, or path name is also in the presiding language.
The QMF profile in effect for the session is the user's profile under the NLF
that was set when the application started, not the QMF profile of the
presiding language. For example, suppose a user uses QMF in both
English and German and thus has both English and German QMF profiles.
If the user starts a QMF session under the German NLF, the options in the
German QMF profile are in effect. If the user sets the
DSQEC_NLFCMD_LANG variable to English to run a procedure written
with English commands, the options in the German QMF profile still remain
in effect throughout the session.
4 This line of the procedure returns to the presiding language.
After the application ends, you should reset the command language
variable to its original value as shown in the example.
For example, if you have an interactive application that you want to write in English
and run in an NLF, you must use the MESSAGE command to send the user
customized messages. In addition, you need the INTERACT command to display
the message, as in the example in Figure 13 (which can be run in a French NLF
session):
proceed_text = ’Continue...’
"RUN WEEKLY_Q" /* Use the English RUN command */
"SET GLOBAL (DSQEC_NLFCMD_LANG=0" /* switch back to French */
"MESSAGE (TEXT=’"proceed_text"’" /* message in French */
"INTERACT" /* show the report with message */
Figure 13. Using the MESSAGE and INTERACT commands to display messages
Multilingual environments
When one or more NLFs are installed, a multilingual environment is created. With
the proper authorization, you can choose a presiding language for each QMF
session. For example, you can choose English for one session and German for
another, provided the German NLF is installed. Although you cannot switch
languages during a QMF session, you can switch the command language variable.
End the current session and start another to obtain the appropriate language
environment.
This topic describes how to use these commands in application programs. All
commands explained here can be used in both callable and command interface
applications with the exception of the START command, which you can use only
with the callable interface. For additional information on any of the commands in
this topic, see DB2 QMF Reference.
“Using command synonyms” on page 56 explains how you can create your own
commands that can perform a variety of functions.
CONNECT
Use the QMF CONNECT command to access data and objects on a remote server.
When you connect to the remote system, this system becomes the current location.
When you write applications, you can issue this command from:
v The callable interface
v The command interface
v Within a procedure (linear or with logic)
Certain aspects of your applications can be affected when you use the QMF
CONNECT command to access a remote server. Be aware of the following
considerations:
v When your application connects to a new location, the QMF profile, command
synonyms, and function keys are re-initialized to the values at the new (current)
location.
v Once QMF starts, the program can issue a QMF CONNECT command to
connect to a remote server. (For a list of valid remote server types, see Installing
and Managing DB2 QMF for TSO/CICS.) Any subsequent QMF commands or
SQL statements that affect database objects are run at the remote server.
v Different types of commands behave differently with remote unit of work. When
your applications use remote unit of work, be aware that all system-specific and
most QMF commands run at the system where QMF is running (the local
system). However, when a QMF command does either of the following, the
commands affect the database at the remote server:
– Sends SQL commands to the database
– Uses or alters QMF objects and data stored in the database
| v If your site uses TSO and takes advantage of RACF support for mixed-case
| passwords, ensure that the CASE option of your QMF profile is set to MIXED.
| Otherwise, QMF converts all input to upper case, causing the CONNECT
| command to fail because the case of the password is incorrect. When
| CASE=MIXED, ensure that you tell QMF application users to enter all input in
| upper case, because QMF only recognizes commands in upper case.
An example
Suppose that you are logged onto your local system (SANJOSE) and you want to
write a REXX callable interface program that does the following:
1. Starts a QMF session.
CALL DSQCIX "START"
2. Connects to the remote DB2 database (DALLAS).
CALL DSQCIX "CONNECT TO DALLAS"
3. Runs a procedure with logic (EARNINGS) that queries the remote server for
data, formats the data, and prints the report.
CALL DSQCIX "RUN PROC EARNINGS"
The procedure EARNINGS contains the following logic:
.
.
.
"RUN QUERY EARNQ (FORM=EARNF"
"PRINT
. REPORT"
.
.
4. Ends the QMF session.
CALL DSQCIX "EXIT"
For more information about connecting to a remote location with the QMF
CONNECT command, see DB2 QMF Reference.
END
You can use the END command to set the QMF home panel as the current panel.
For example, if a QMF report is the current QMF panel, issuing the END command
from a callable interface or command interface program sets the QMF home panel
as the current screen. Once the QMF home panel is the current screen, issuing the
END command has no effect on the QMF session.
EXIT
The EXIT command works the same regardless of how the QMF session was
started: it marks all the user’s sessions for termination.
When the EXIT command is entered on the command line, the session in which it is
entered is terminated immediately. Each session begun by the INTERACT
command terminates as the application that started it completes. When the EXIT
command is issued in an application, the session ends when the original QMF
session ends. All interactive sessions begun by the INTERACT command must end
before QMF terminates.
When the user or an application issues the EXIT command, QMF sets
DSQAO_TERMINATE to 1 (marked for termination). Only an application running
within QMF can test and use this global variable. If DSQAO_TERMINATE is set to 1
when QMF returns to the main QMF session, QMF immediately terminates and
releases resources.
Variable definitions:
You can use the GET GLOBAL command to copy the value of a QMF global
variable into an application-defined variable for use by the application. The
parameters you specify on the GET GLOBAL command define the application
variable.
number of varnames
The number of variables requested.
varname lengths
A list of lengths for each variable name specified.
The length of the variable name. An 18-character area padded with trailing
blanks is allowed.
varnames
A list of names of the QMF variables.
Do not specify trailing blanks in global variable names; QMF deletes trailing
blanks.
value lengths
A list of the lengths of the values of the variables.
The following rules apply to the variable value:
v If the value length you supply is less than that of the value stored in QMF,
QMF truncates on the right and returns a truncated value.
v If the value length you supply is greater than that of the value stored in QMF,
QMF returns a value padded with trailing blanks.
values
A list of variable values.
value type
The data type of the storage area that contains the values; it must be either
character or integer.
INTERACT
You can use the INTERACT command to display the current QMF panel and allow
users to interact with QMF at different points in your application. When the user
issues the END command from a QMF panel, QMF returns control to the
application. When the user issues the EXIT command from a QMF panel, the QMF
session is marked for termination and QMF returns control to the application.
A scenario
Figure 14 shows a procedure that requires only one step to produce a report.
QMF displays the REPORT panel containing your formatted data with a message
that says, "OK, your procedure was run."
You might decide to write a procedure that involves several steps. If you want to
see the intermediate results of such a procedure, you must use the INTERACT
command at the points in the procedure where you want to see the results of a
command. For example, to see the intermediate results of a procedure that runs
more than one query, insert an INTERACT command immediately following the first
RUN QUERY command, as shown in Figure 15:
When you run this procedure from the home panel, QMF displays the REPORT
panel containing your formatted data. Next, enter the END command from the
REPORT panel. The procedure runs the second query and displays the final report.
If you omit the INTERACT command, QMF displays only the final report without
showing the result of the first query.
This global variable is valid only when the RUN QUERY command is issued from
an application. It does not affect the display of reports when the RUN QUERY
command is issued from the QMF command line.
If you want your application to display the QMF home panel after the user issues an
END command from a QMF object panel (the way interactive QMF does), add the
logic shown in “A REXX example of using an INTERACT loop” on page 193.
The command form of INTERACT has no effect on a command issued through the
callable interface. In the callable interface, the only way to control whether
commands are run interactively is to set DSQSMODE=I on the START command.
For more information about the DSQSMODE keyword, see Table 8 on page 52.
In this statement, command is the command that you want to run interactively.
Various QMF prompt and status panels can appear in this dialog.
For example, the following command displays the command prompt panel for RUN
QUERY command options:
INTERACT RUN QUERY ABC ?
You can check to see if interactive execution is allowed in the current session by
examining a variable named DSQAO_INTERACT; a value of 1 means that
INTERACT is allowed. A batch application does not allow interactive execution. See
“Global variables for state information not related to the profile” on page 199 for
details on the DSQAO_INTERACT variable.
MESSAGE
When you create applications, you often want to send specific messages to your
users about the information displayed for them or the function they should perform
next. You can write your own messages and display them on QMF panels through
the MESSAGE command. In ISPF, you can also choose to have QMF display the
message help for an ISPF error message.
Message
number (
Help=helppanel
Stopproc=Yes|NO
Text=value
When Stopproc=Yes, the procedure termination switch is on. The default value
is No (off). This switch only affects linear procedures.
While this switch is on, any QMF procedure receiving control ends its execution
immediately. While the switch is off, procedures run normally.
When the switch is off, only a MESSAGE command can turn it back on. When
the switch is on, it stays on until one of the following happens:
v Another QMF command is issued. This can be any QMF command, except a
MESSAGE command with the option to turn the switch on.
v Control returns to the user when the application ends. A user can always
issue online commands that run QMF procedures.
Suppose that you want to write an application using a procedure that runs two
queries and displays two reports. When QMF displays the first report, you want to
display a message that tells users to end the interactive session when they are
ready to continue to the second report. You can write a linear procedure like the
one shown in Figure 16 on page 48, which includes on the REPORT panel a
message defined by the MESSAGE command. To have your message appear on
the REPORT panel, place the MESSAGE command immediately before the
INTERACT command, as shown in Figure 16:
..
.
RUN QUERY WEEKLY_SALES_Q (FORM=WEEKLY_SALES_F
MESSAGE (TEXT=’OK, press END when you are finished viewing this report.’
INTERACT
RUN QUERY YEAR_TOTAL_Q (FORM=YEAR_TOTAL_F
..
.
If you are using a procedure with logic, you can use a REXX variable in place of
the text string you specify for the MESSAGE command, as shown in Figure 17.
When you use REXX variables, you must use double quotes around the variable
name in the message text string.
oktext = ’OK, press END when you are finished viewing this report.’
"RUN QUERY WEEKLY_SALES_Q (FORM=WEEKLY_SALES_F"
"MESSAGE (TEXT=’"oktext"’"
"INTERACT"
"RUN QUERY YEAR_TOTAL_Q (FORM=YEAR_TOTAL_F"
Figure 17. Using REXX variables with the MESSAGE command in a procedure
The message shown below spans multiple lines with REXX continuation characters.
(For more information about issuing messages in REXX procedures, see the REXX
documentation in the IBM Publications Center at www.ibm.com/shop/publications/
order.)
/* QMF REXX PROCEDURE */
MSGTEXT="You entered a data value incompatible with "||,
"the column data type; check the data type of the "||,
"column and try again.""MESSAGE(TEXT=("MSGTEXT"))"/*MAXTEXT=360PARANS*/EXIT
The message shown below spans multiple lines using continuation characters for
linear procedures:
MESSAGE(TEXT=’You entered a data value incompatible with
+the column data type; check the data type of the
+column and try again.’)
The following are examples of how you can use the MESSAGE command if you are
building an application that makes use of ISPF:
v MESSAGE MSG011X
– The message text is the long message in MSG011X.
– The message help panel is the panel identified (if any) in MSG011X.
– Whether the procedure termination switch is set after QMF processes the
command is determined by the procedure termination switch in MSG011X.
v MESSAGE MSG011X (HELP=PANELX STOPPROC=YES
– The message text is the long message in MSG011X.
– The message help panel is a panel named PANELX.
– The procedure termination switch is turned on, which suppresses the
execution of QMF linear procedures in the application.
SET GLOBAL
You can create your own global variables with the SET GLOBAL command and use
them in QMF commands as substitution variables. You can use your own global
variables, or you can use the ones QMF provides. For a list of the QMF-provided
global variables, see Appendix C, “QMF global variable tables,” on page 197.
Variable definitions:
number of varnames
The number of variables requested.
varname lengths
A list of lengths for each variable name specified.
The length of the global variable name should be equal to the actual length of
the global name in your program. An 18-character area padded with trailing
blanks is allowed.
varnames
A list of names of the QMF variables.
value lengths
A list of lengths of the values of the variables. If the value length you supply is
less than the length of the value stored in your storage area, the value is
truncated on the right when it is stored in QMF.
QMF uses the value from your program, starting at the address you assign for
the length you assign. If the length is too long, QMF might abend.
values
A list of variable values.
value type
The data type of the storage area that contains the values. It must be either
character or integer.
For examples of how to use the extended syntax of the SET GLOBAL command,
see Appendix A, “Sample code for callable interface languages,” on page 125 for
the sample program for the language you are using.
¢ ! $ ~ { } ? @ # % \
v A global variable name cannot contain blanks or any of the following characters:
START
This topic contains information about the START command syntax and keywords,
including a table of keyword descriptions.
General syntax
When you start QMF through the callable interface, you need to use the START
command. The syntax of the START command depends on which programming
language you are using for your callable interface application; see Appendix A,
“Sample code for callable interface languages,” on page 125 for examples of the
syntax for each programming language.
Only one QMF session can be active at one time. If you want your application to
test whether QMF has already been started, see “Starting QMF from an application”
on page 21.
Keyword definitions:
Assembler, C, COBOL, FORTRAN, and PL/I use the following specifications for the
START command:
number of keywords
The number of START command keywords you are using in your START
command.
keyword lengths
The length of each START command keyword specified.
keywords
Names of the START command keywords. See “START command keywords”
for more information.
value lengths
A list that contains the lengths of the values for each START command
keyword.
values
A list of values for the START command keywords specified in this command.
value type
The data type of the value. The data type must be character for the START
command.
v DSQSDBNM
v DSQSDBQN (CICS only)
v DSQSDBQT (CICS only)
v DSQSDBUG
v DSQSIROW
v DSQSMODE
| v DSQSMRFI
v DSQSPILL
v DSQSPLAN (TSO only)
v DSQSPRID (TSO only)
v DSQSRSTG (TSO only)
v DSQSRUN
v DSQSSPQN (CICS only)
v DSQSSUBS (TSO only)
These keywords are described in Table 8.
QMF allows you to specify START command keywords with the following
conventions:
v You can specify any keyword on the START command. In TSO, you can also
specify any keyword in the REXX program named by the DSQSCMD keyword.
Because QMF for CICS does not support REXX, you must specify all keywords
on the START command.
v If your application or the initial procedure (specified by the DSQSRUN keyword)
specifies keywords that are not supported in a particular environment, those
keywords are ignored. This allows you to compile a single program to run in
multiple QMF environments without changing the environment-specific keywords.
v If you do not specify any keywords, QMF uses the values of the START
command keywords as they appear in the program specified by the DSQSCMD
keyword. If you do not use this program, QMF uses the default values of each
keyword shown in Table 8.
For more information about these keywords and how they are affected by
environmental dependencies, see Installing and Managing DB2 QMF for TSO/CICS.
For syntax diagrams of the START command, see DB2 QMF Reference.
Table 8. START command keywords, descriptions, and default values
START command
keywords Description Default value
DSQADPAN Meant for use only with the callable interface, this START command 1 (display report)
parameter sets the DSQDC_DISPLAY_RPT global variable. This
variable controls whether QMF displays the report when a query is
run from within an application program. A value of 1 displays the
report when a query is run. Set the value to 0 to specify that the
report should not be displayed.
If you set the DSQSBSTG value to less than the minimum amount of
storage required to produce a report, QMF automatically allocates
the minimum amount of storage required. The minimum amount
required to produce a report depends on your environment.
This keyword specifies the REXX program that sets the QMF
program parameters.
You should set the value to YES when you intend to print DBCS data
from a non-DBCS display device or run a QMF batch job that prints
DBCS data. Otherwise, the value should be NO.
DSQSDBNM Specifies the remote server to connect to when starting a QMF NULL
session. A null value means that QMF connects to the default
database (the database it normally connects to without remote unit of
work).
DSQSDBQN Specifies that CICS storage is used for QMF trace data. The name DSQD
(CICS only) must conform to CICS name specifications for the type of CICS
queue specified by DSQSDBQT. For more information about CICS
name specifications, see the appropriate CICS application
programming guide. The IBM Publications Center at
www.ibm.com/shop/publications/order contains the CICS publications.
DSQSDBQT Specifies the type of CICS storage to be used for QMF trace data. TD
(CICS only)
The values are:
TD Uses a CICS transient data queue.
TS Use a CICS auxiliary temporary storage queue. Use caution
when specifying temporary storage, because QMF can
generate a large amount of trace data.
When you start QMF in batch mode, all messages and commands
are traced (equivalent to an L2 level of tracing) regardless of how
you set DSQSDBUG.
You need to know the name of the command synonym table you want to use.
The variable DSQAP_SYNONYM_TBL contains the name of the command
synonym table for each user. This variable initializes with the proper value at
startup time, when QMF reads the user's row of the Q.PROFILES table.
Your database administrator has access to the command synonym table. If you
want to create a command synonym for your personal use, you might want to
have a view defined on those tables that lets you add command synonyms.
In the example shown in Figure 18, the Q.COMMAND SYNONYMS table
contains information for the command synonym UPDATE SALES:
ADD Q.COMMAND_SYNONYMS
VERB. . . . . . . . . ( UPDATE )
OBJECT. . . . . . . . ( SALES )
SYNONYM_DEFINITION. . ( RUN PROC WEEKLY_SALES >
REMARKS . . . . . . . ( checks weekly sales figures>
After you press the ADD function key, QMF adds this command synonym to
your table.
3. Update your profile, if necessary.
If you added this command synonym to a new table or view, add the name of
the new table or view to your profile.
4. End your QMF session.
QMF does not recognize the changes you made to your command synonym
and profile tables until you start a new QMF session.
If you do not want QMF to start a report minisession, do one of the following:
v Change the value of DSQDC_DISPLAY_RPT to 0.
v Set the DSQADPAN parameter to 0 when you start QMF from the callable
interface.
See “SET GLOBAL” on page 49 for more information about global variables.
From a report minisession, you can issue the following commands and synonyms
for those commands (restrictions shown in parentheses):
v BACKWARD
v BOTTOM
v CANCEL (when pop-up window is active)
v CICS
v DISPLAY REPORT
v DISPLAY CHART
v END
v FORWARD
v GET GLOBAL
v HELP
v INTERACT
v ISPF
v LEFT
v MESSAGE
v PRINT REPORT
v PRINT CHART
v QMF
v RETRIEVE
v RIGHT
v SAVE DATA
v SET PROFILE
v SET GLOBAL
v SHOW REPORT
v SHOW CHART
v SWITCH (when online help is active)
v TOP
v TSO
v ADD
v CANCEL
v CHANGE
v CHECK
v CLEAR
v CONNECT
v CONVERT
v DELETE
v DESCRIBE
v DISPLAY (Query, Proc, Profile, Form)
v DRAW
v EDIT
v ENLARGE
v ERASE
v EXIT
v EXPORT
v EXTRACT
v GETQMF
v IMPORT
v INSERT
v INTERACT
v LIST
v NEXT
v PREVIOUS
v PRINT (Query, Proc, Profile, Form)
v REDUCE
v REFRESH
v RESET GLOBAL
v RESET (Query, Proc, Form)
v RUN
v SAVE
v SEARCH
v SHOW
v SORT
v SPECIFY
v START
v SWITCH
QMF returns an error message when you run a CLIST or a procedure that issues a
restricted command.
| When you export an object, QMF converts the object to an externalized format and
| places it in a UNIX® file (in the case of data or tables only), a TSO data set, or a
| CICS data queue. The externalized format of QMF objects is a powerful element of
| QMF application development. The IMPORT command reads the externalized
format and places the object either in QMF temporary storage or in the database
(depending on how you issue the command).
| You can export data and table objects in either the QMF, IXF, or XML format. Form,
| prompted query, and report objects are exported in encoded format. Charts are
| exported in Graphics Data Format (GDF), a GDDM format.
| For the syntax of the EXPORT and IMPORT commands as well as restrictions for
| certain data types, see DB2 QMF Reference.
What you can do with an exported UNIX file, TSO data set, or CICS
data queue
The IMPORT and EXPORT commands let you:
v Provide query results to your application
Use the QMF EXPORT command to get data out of the database and into your
application.
v Create objects within your application and use them in QMF
| You can create an object outside of the QMF environment using the appropriate
| format for the object. When you import into QMF the UNIX file (in the case of
| data or tables only), TSO data set, or CICS data queue containing the object, a
| new QMF object is created.
You cannot import reports and charts into QMF.
v Make QMF objects available to other environments or products.
Caution
Use caution when transferring exported objects between systems with
different CCSIDs or character sets, such as between EBCDIC and ASCII
systems, or between different NLF environments. Transferring the objects
between systems in this way could render them unusable.
If you need to import a prompted or QBE query into a program other than QMF,
you must first use the CONVERT QUERY command to convert the query to an
SQL query that you can export and use in other products. For more information
on the CONVERT command, see DB2 QMF Reference.
You can transfer QMF objects between QMF under TSO, ISPF, or native z/OS
batch and QMF under CICS (using CICS extrapartition transient data queues).
v Save objects and data outside of the database.
For example, in the middle of a program, you can export your data so that an
external program can manipulate it.
v Create bilingual applications
You can create a QMF form in your presiding language and translate it to English
using the LANGUAGE option on the EXPORT command. You can also use the
LANGUAGE option on the IMPORT and EXPORT commands to translate an English
form to your presiding language.
You can export data and table objects to storage areas external to QMF. The
exported formats of a table in temporary storage (DATA) and a table stored in the
database (TABLE) are identical. An object exported as data can be imported as a
table, and vice-versa.
| Data and table objects can be exported in QMF format (by specifying
| DATAFORMAT=QMF on the EXPORT command), Integrated Exchange Format (by
| You can create your own tables outside of QMF by using the QMF, IXF, or XML
| format and importing the contents of the UNIX file, TSO data set, or CICS data
| queue that contains the table. Include the required fields and add your own data as
| appropriate. Then import the UNIX file, TSO data set, or CICS data queue into QMF
| as a table object.
For more information and syntax of the EXPORT and IMPORT commands, see
DB2 QMF Reference.
Header records
The record length of an external data file is the length of a row of the data, as
described under “Data records” on page 64. The header records that precede the
data records are the same length as the data records. If the header information
exceeds the length of the data record, multiple header records are written. Table 9
shows the information contained in the header records.
Table 9. Header record information
Byte position Information and type
1-8 QMF object format level (8 characters of data).
The object level for QMF Version 8.1 and later is 3.0, so these byte
positions say "REL 3.0" for QMF Version 8.1 and later. Data exported
using QMF Version 8.1 or higher cannot be imported to earlier releases
of QMF.
9-10 Number of header records (halfword signed integer).
11-12 Number of data columns (halfword signed integer).
13-30, 37-54, ... Column name (30 characters of data).
31-32, 55-56, ... Data type (halfword signed integer). Data type codes are shown in
Table 10 on page 64.
33-34, 57-58, ... Column width (halfword signed integer); for most data types this is the
width of the column in bytes, with the following exceptions:
v In DECIMAL columns, the first byte of the halfword represents the
precision, and the second byte represents the scale.
v In GRAPHIC and VARGRAPHIC columns, this value reflects the width
of double-byte characters.
v In FLOAT columns, this value is either 4, indicating single-precision
floating point, or 8, indicating double-precision floating point.
35, 59, ... Nulls allowed: Y if nulls are allowed; N if they are not allowed (1
character of data).
Bytes 11-12 indicate the number of columns; this means that the information in
bytes 13 through 36 is repeated for each column in the header. Each column
requires 24 bytes in the header.
Date, time, and timestamp data are always exported in ISO format.
Data records
Data records are of fixed-length format and contain the data to be exported. The
maximum allowable length of a data record is 7,000 bytes. The length of a data
record is the sum of the widths of the data types that comprise the record. Use
Table 11 to calculate the widths of each data type.
Table 11. Widths of data records. Calculate the width of a particular data type by adding the
number of bytes in each column.
Null Length
Data type indicator field SO/SI Data
Character 2 Length in header (LIH)
Date 2 LIH
Floating point 2 8
| Big integer 2 LIH
Integer 2 LIH
Small integer 2 LIH
Table 11. Widths of data records (continued). Calculate the width of a particular data type by
adding the number of bytes in each column.
Null Length
Data type indicator field SO/SI Data
Time 2 LIH
Timestamp 2 LIH
Decimal 2 (Precision + 2) // 2
Graphic 2 2 (LIH × 2)
Variable character 2 2 LIH
Variable graphic 2 2 2 (2 × LIH)
| Binary 2 LIH
| Variable binary 2 2 LIH
Note: The LIH is the width given in the header record for that column.
Every data record has two bytes of indicator information, which can have the values
and meanings shown in Table 12:
Table 12. Hex values that show the validity of data records
Value Meaning
X'0000' The column contains valid data.
X'FFFF' or The column contains a null value; any data in the column is meaningless.
X'FFFE'
For example, suppose you export the following data from the Q.STAFF table:
ID NAME COMM
------ --------- ----------
10 SANDERS -
20 PERNAL 612.45
Each header record is the same length as the data records: 23 bytes. The 84 bytes
are spread across four 23-byte header records; the last record is padded with
blanks.
Figure 19 shows the header from the report and its hexadecimal representation.
The reversed-type numbers indicate notes following the figure.
R E L 3 . 0 I D
1 D9 C5 D3 40 F1 4B F0 40 0004 0003 C9 C4 40 40 40 40 40 40 40 40 40
1 2 3 4
N N A M E
2 40 40 40 40 40 40 40 01F4 0002 D5 00 D5 C1 D4 C5 40 40 40 40 40 40
5 6 7
Y C O M M
3 40 40 40 40 40 40 40 40 01C0 0009 E8 00 C3 D6 D4 D4 40 40 40 40 40
Y
4 40 40 40 40 40 40 40 40 40 01E4 07 02 E8 00 40 40 40 40 40 40 40
Figure 19. Sample header records for an exported data object in QMF format. 40 is the
hexadecimal code for a blank character.
Figure 20 shows the data from the report and the hexadecimal representation of
that data. For information about what the byte positions mean, see Table 9 on page
63.
10 S A N D E R S
1 00 00 00 0A 00 00 00 07 E2 C1 D5 C4 C5 D9 E2 00 00 FF FF 00 00 00 40 40
8 9 10
20 P E R N A L
2 00 00 00 14 00 00 00 06 D7 C5 D9 D5 C1 D3 00 00 00 00 00 00 61 24 5C
Figure 20. Sample data records for an exported data object in QMF format
9 X’07’
Length of the name in the second column of the first data record: 7
10 X’FFFF’
Indicator information: column contains a null value
The data set or data queue containing the exported data or table consists of the
following records:
v Header record (H)
v Table record (T)
v Column records (C)
v Data records (D)
The exported data set or CICS data queue consists of one H record, followed by
one T record. The T record contains a count of how many C records follow the T
record. There is a C record for each column in the table. D records follow C
records. There is a D record for each row in the table. The arrangement of records
looks like Figure 21.
Figure 21. Arrangement of records in an exported data set or CICS data queue (IXF format)
The following topics describe the format of each of these types of records. The
values shown in parentheses appear in the exported output to identify each type of
record.
v “Header record (H)”
v “Table record (T)” on page 68
v “Column records (C)” on page 69
v “Data records (D)” on page 70
v “Column data format” on page 70
v “Format of column data by data type” on page 71
v “Interpreting an object exported in IXF format” on page 75
Table 14. Parts of a header record in an IXF data set or data queue containing an exported
data object or database table (continued)
Byte
position Information and type
02-04 TSO data set or CICS data queue identifier.
05-08 IXF version; the version can be one of the following:
v 0000, which supports data objects that contain short column names (18
characters or less).
v 0001, which supports data objects that contain at least one long column
name (19 characters or more).
09-14 Originating product name (QMF).
| 15-20 Originating product release level (V9R1M0).
21-28 Date the data set or CICS data queue was created, in the form
YYYYMMDD.
29-34 Time the data set or CICS data queue was created, in the form HHMMSS.
35-39 The number of records preceding the first D (Data) record in the data set or
CICS data queue; this is a 5-digit numeric value expressed in character
form.
40 DBCS indicator that tells whether DBCS data is a possibility; Y or N.
41-42 Reserved.
The entire 18-byte field is blank if the table does not have a name.
22-29 Data name qualifier; name of the owner of the database table from which
the data is retrieved.
The 8-byte field is blank if the table does not have an owner.
30-41 Data source (database).
42 Convention used to describe data: C for columnar data.
43 Data format: C for character (OUTPUTMODE=CHARACTER); M for
machine (OUTPUTMODE=BINARY).
Table 15. Parts of a table record in an IXF data set or data queue containing an exported
data object or database table (continued)
Byte
position Information and type
44 Data location: I for internal.
45-49 Count of column (C) records: a numeric value in character form specifying
the number of C records before the first data (D) record.
50-51 Reserved.
52-81 Blanks.
| If the data type is DECIMAL, the first 3 bytes represent data precision
| and the next 2 bytes represent the scale. If the data type is BIGINT,
| INTEGER, SMALLINT, DATE, TIME, or TIMESTAMP, this field is blank
| (length is inherent in data type).
Table 16. Format of a column record in an IXF data set or data queue containing an exported
data object or table (continued)
Byte
position Information and type
44–49 or 56-61 Starting position of column data; a value (in character form) reflecting
the offset of the data for a column from the start of the data record.
If the column allows nulls, this field points to the null indicator. If the
column does not allow nulls, it points to the data itself. Whether or not
the column allows nulls, space for the null indicator is always present in
the record. The starting position is based from the first byte that contains
data. Therefore, the first five bytes of the data (D) record are not
included in any consideration for starting position of the actual data.
(The first data position is position 1, not position 0.)
50–79 or 62-91 Column label information, if available (if not available, these byte
positions contain blanks).
80–81 or 92-93 Two bytes of zeros in character form (00).
For each column, the data consists of a null indicator followed by the data itself. If
nulls are allowed (byte 22 of C record = Y), then bytes 44–49 of each C record
point to the null indicator that precedes the data for that column. If byte 22 = N
(nulls not allowed), then bytes 44–49 point to the data itself. However, in the latter
case, space for the null indicator is left in the data record. The first position in bytes
44–49 is represented by a value of 1, which points to byte 6 of a D record (bytes 1
through 5 are ignored).
See Figure 24 on page 77 (which shows character output mode) and Figure 26 on
page 78 (which shows binary output mode) for an illustration of two D records
showing data that is null in one case and not null in the other.
When the data format is binary, two bytes are used for the null indicator:
v X'FFFF' indicates data is null
v X'0000' indicates data is not null
10.37.42 is 10:37:42 AM
08.00.00 is 8 AM exactly
23.30.00 is 11:30 PM
392 TIMESTAMP The value in IXFCLENG is not Same as character format.
significant for this data type. The
length (26 bytes) is inherent in
the data type.
Examples:
2005-12-31-23.59.59.999999
(the last microsecond
in 2005)
2006-01-01-00.00.00.000000
(the first microsecond
in 2006)
Examples:
-1.2345678901234567E+14
+6.2345678901234567E-01
0.0000000000000000E+00
484 DECIMAL Bytes 39-43 of the C record Bytes 39-43 of the C record
represent the precision P (first 3 represent the precision, or P
bytes) and scale S (next 2 bytes) (first 3 bytes), and scale, or S
of the number. Allowable range (next 2 bytes), of the number.
for P is 0-15. S can be any value The allowable range for P is
less than or equal to P. 0-15. S can be any value less
than or equal to P.
Data is formatted as a P+2-byte
character value (or P+1 bytes if The data consists of a
S=0), right-justified, with the first (P+2)/2-byte decimal value in
byte reserved for a sign, and a packed decimal format. The last
decimal point (position implied by byte indicates the sign of the
S) present only if S is not equal value. For example, if P=005 and
to zero. For example, if P=005 S=00, the data format is as
and S=00, the data format is the follows:
following: X’12345C’
12345
If P=006 and S=02, the data
If P=006 and S=02, the data format is as follows:
format is the following: X’0234510D’
+2345.10
The exported data set or CICS data queue consists of a total of seven records; an
H record, a T record, three C records, and two D records as shown in Figure 23:
HIXF0000QMF V6R1M01998120409560000005N
T18 database CCI00003
C02ID NYNR50000000 000002 00
C04NAME YYNR44800000 00009000008 00
C04COMM YYNR48400000 00702000023 00
D 00010 00007SANDERSxx -
D 00020 00006PERNALxxx 00612.45
Now suppose that the same table is exported using the IXF format, but with
OUTPUTMODE=BINARY. The exported data set or CICS data queue consists of
seven records which are shown in Figure 25:
HIXF0000QMF V6R1M01998120409565000005N
T18 database CMI00003
C02ID NYNR50000000 000003 00
C04NAME YYNR44800000 00009000005 00
C04COMM YYNR48400000 00702000018 00
D xxxxxxxxSANDERSxxxxxxxx
D xxxxxxxxPERNALxxxxxxxxx
With the exception of bytes 44 through 49 (starting position of column data), the
information in the H, T, and C records is essentially the same. The data in the D
records, however, differs significantly. Figure 26 contains more information about the
records of the exported data set or CICS data queue.
| QMF uses z/OS XML parse services as well as z/OS Unicode conversion services
| when processing XML data for export or import, so these services must be
| configured and active.
| The data is exported as an XML document in Unicode UTF-8 format with a CCSID
| of 1208. The exported XML data set or CICS data queue consists of the following:
| Header records
| The header records in the exported XML file contain the version of XML used, the
| encoding scheme, and a line that references which style sheet to use to format the
| exported XML document. See “Default style sheet” on page 81 for more information
| about the default style sheet provided with QMF.
| Here is an example of the information that appears within the header lines in an
| exported file:
| <?xml version="1.0" encoding="UTF-8" ?>
| <!-- ?xml-stylesheet type="text/xsl" href="qmf.xslt" ? -->
| Metadata records
| The column metadata consists of the number of columns, column names, column
| labels (if applicable), data types, data lengths, whether the data is null, and the
| format. An example of the metadata for a column called "ID" is shown in Figure 28
| on page 80. The exported XML file contains one column-description block for each
| column.
|
| <ColumnDescription id="1">
| <Name>ID</Name>
| <Label>ID</Label>
| <Type>smallint</Type>
| <Width>2</Width>
| <Nullable>false</Nullable>
| <Format>plain</Format>
| </ColumnDescription>
|
|
| Figure 28. Metadata records in an exported XML file
| Data records
| The exported file contains one row-definition block for each row of exported data. A
| <cell> tag identifies each column in the row by number, as shown for the first row of
| the Q.STAFF sample table in Figure 29:
|
| <Row id="0">
| <Cell id="1">10</Cell>
| <Cell id="2">SANDERS</Cell>
| <Cell id="3">20</Cell>
| <Cell id="4">MGR</Cell>
| <Cell id="5">7</Cell>
| <Cell id="6">99999.99</Cell>
| <Cell id="7" null="1" />
| </Row>
|
|
| Figure 29. How a row of the Q.STAFF sample table appears in an exported XML file
| When you use the DATAFORMAT=XML clause on the EXPORT DATA or EXPORT
| TABLE command and the data contains a column defined with the XML data type,
| QMF wraps the XML data in CDATA tags to prevent the parser from trying to
| process it. Figure 30 shows an example of how XML data appears in an exported
| file.
|
| <Data>
| <Row id="0">
| <Cell id="1">Murphy</Cell>
| <Cell id="2">1234</Cell>
| <Cell id="3"><![CDATA[<?xml version="1.0" encoding="utf-8"?>]]></Cell>
| </Row>
| </Data>
|
|
| Figure 30. How data from XML columns appears in an exported XML file
| according to your business needs for formatting XML data. If you choose to name
| the schema file something other than qmf_data.xsd or you are using a different
| schema file altogether, be sure to change the name in any files that reference the
| schema document.
Rules and information for exporting and importing data objects and
tables
This topic covers general considerations for importing and exporting data or table
objects.
This connection is maintained until the data object is replaced or reset, or QMF has
| read all the records. At this point, the UNIX file, TSO data set, or CICS data queue
| is closed and is no longer considered allocated to QMF. An application should not
| attempt to delete or alter a UNIX file, TSO data set, or CICS data queue allocated
| to QMF with an IMPORT DATA command. The application needs to either start
using another data source or empty the QMF temporary storage area for the data
object (using a RESET DATA command) before it tries to alter or delete a file, data
set, or data queue it has been reading.
| During the execution of the IMPORT command, QMF does not lock the UNIX file,
| TSO data set or CICS data queue while it is being read. It does not take steps to
prevent the file, data set, or queue from being altered while it is being read. If the
file, data set, or queue is erased or altered in any way before QMF has finished
reading it, the results are unpredictable and can cause a system error.
An incomplete data prompt can occur when there is not enough temporary storage
to retrieve the entire object to be exported.
Export errors
| After QMF imports data from a UNIX file, TSO data set, or CICS data queue, QMF
| displays the report panel and a confirmation message. If the file, data set, or data
queue contains format errors, QMF does not display the Report panel; instead,
QMF displays an error message on the object panel that was current before QMF
processed the IMPORT command. However, if the current object panel was the
Report panel, and QMF finds errors in the imported data, QMF displays the home
panel and an error message.
QMF format: When you export data or a table in QMF format, the table name and
authorization ID are not included in the exported file. The column name field size
must be increased from 18 to 30 when one of the column names is longer than 18
characters. The object level is "REL 3.0" to indicate the use of long column names
in the QMF DATA object, support for which was added in QMF Version 8.1. Thus,
errors result if you try to import an object from a QMF release earlier than Version
8.1 because the object levels are incompatible.
IXF format: The IXF table record (T record) contains the owner and name of a
table that is being exported using the QMF EXPORT TABLE command. However,
the T record contains a blank owner and name when exporting a QMF data object
that was the result of a RUN QUERY command. For long name support, the table
name is truncated at 18 characters and the owner name is truncated at 8
characters.
The column name field in the C record (column record) must be increased from 18
to 30 characters when there is a column name longer than 18 characters. When
long column names are present, the IXF version number in the H (header) record is
set to 0001. When there are no column names longer than 18 characters, the IXF
version number in the H record is 0000.
The encoded format of a form, report, or prompted query consists of the following
records:
v Fixed-format records (see “Header records” on page 83)
v Variable-format records, which include the following types of records:
– Data value, or V, records (see “Data value records (V)” on page 85)
– Data table description, or T, records (see “Data table description records (T)”
on page 86)
– Table row, or R, records (see “Table row records (R)” on page 87)
– End-of-object, or E, record (see “End-of-object record (E)” on page 88)
For specifications of the exported TSO data sets or CICS data queues, see “Size
specifications for externalized QMF objects” on page 117.
Header records
Most records have a variable format. However, header records have a fixed format,
even though the data set or data queue containing the records can be of variable
format.
These records are used to identify the contents of the exported form, report, or
prompted query. A header record is the first record of the exported data set or data
queue. It describes the characteristics of the object.
F for form
R for report
T for prompted query
11 Blank
01 for report
04 for form
01 for prompted query
The object level denotes a change in an object’s format. Each time an object's format
is changed in a QMF release, its object level is also changed. The object level
increases only when the change in the format could potentially create an error in your
application.
14 Blank
15* Data format of the object ("E" for encoded format used to export form, report and
prompted query objects)
16 Blank
17 Status of the object: E - Contains errors (for form only); W - Contains warning; V -
Valid
18 Blank
19 Whole or partial object indicator (W for whole object)
20 Blank
21 National language in use when the object was exported (E for English; see Table 1 on
page vii for other languages)
22 Blank
23* You can create a form, report, or prompted query outside of QMF in the proper format
and import it into QMF. Code an R in this byte position if you want QMF to replace
the object in temporary storage with the object you are importing.
24 Blank
25-26 Length of control area at the beginning of each record:
01 for form
02 for report
01 for prompted query
27 Blank
28-29 Length of integer length fields specified in V and T records (03)
30 Blank
31-38 Date stamp in the format yy/mm/dd
39 Blank
40-44 Timestamp in the format hh:mm
45 Blank
51 Blank
For specific examples of header records, see one of the following topics:
v For forms: “Interpreting the header record in the exported data set or queue” on
page 94
v For reports: “Interpreting the report header record in the exported data set or
queue” on page 104
v For prompted queries: “Interpreting the header record in the exported data set or
queue” on page 110
The record data area is a variable-length area containing information about that
specific record. Fields in this area are separated by a delimiter (a blank character is
used in the examples in this topic).
Data value records (V): Value records are used to provide a value for a single
field in an object, such as blank lines before the heading in the form. V records
contain:
v A field number unique to the object
v The field’s length
v The field’s value
Data table description records (T): In the encoded format, most data in an
object appears in tables. These are not relational tables in the database, but rather
a means of grouping information within the encoded format.
Each T record defines one table, and each table corresponds to a particular part of
an object, such as summary calculations in the form. Thus, one exported file can
contain many of these encoded tables.
The record data area for T records is shown in Table 24. The byte positions in the
table are offsets following the end of the control area, the length of which is
indicated in the header record.
Table 24. Record data area for T records
Byte position Description
01 Blank
Bytes 11-13 (number of columns) indicate how many field number/data value length
pairs follow; this means that the information in bytes 15 through 22 is repeated for
each column.
Keep the following information about T records in mind as you export and import
objects:
v When a form or prompted query is imported, the number of R records must
match the row count specified in bytes 07-09 of the record data area of the T
record. Otherwise, QMF issues a warning.
v When a form or prompted query is imported, the number of columns indicated in
bytes 11-13 must agree with the field number/length pairs in the bytes that follow.
If not, QMF issues a warning.
v The number of field number/length pairs is limited to the number of columns in
the table, and their order is arbitrary.
v Columns with a length of zero (or not included in this table) are set to their
default values when the object in the temporary storage area is updated and a
warning is issued. This is not always true for prompted queries. Where possible,
a default is supplied; otherwise, an error occurs.
v To set a column field to blank, the column must have a positive length in the T
record and a blank value in the R record.
Table row records (R): R records provide a set of values for a single row in an
encoded table. R records contain a list of values arranged in an order described by
the associated T record. An R record matches the description of the positions and
lengths of the data values specified in the T record.
Following the control area, the data area for R records consists of a series of
values separated by a delimiter (blank character). The format is as follows:
_value.._value..._value..
In this format, value... represents the data value for this row and column and _ is
the delimiter.
End-of-object record (E): The E record specifies the end of an exported object. It
is the last record of an exported file, appearing as the character E. For an exported
report, an E record is followed by a blank character to complete its control area. For
a form, the blank is omitted.
Any records following the E record are ignored. If an E record is not included with
the file being imported, QMF assumes that an end-of-file implies the end of the
object.
Application data record (*): Application data records allow application programs
to include their own data, such as comments, associated with a given object in the
external file. Application programs frequently use these records as comment records
to further describe the object in the file. The information following the asterisk is
essentially ignored and has no effect on the input process.
Application data records can appear anywhere in the external file except before the
header (H) record. QMF does not write out application data (*) records upon export.
However, you can use these records in the data set or CICS data queue you
create. They are useful as comment records. The contents of an application data
record are shown in Table 26:
Table 26. Contents of an application data record
Byte position Description
01 Application data record identifier (*)
02-end of record Data
The record data area for an L record is shown in Table 28. Bytes 6-13 are line type
attributes. Byte 06 is always 1. Each byte in bytes 7 through 13 indicates the
presence or absence of the corresponding line type attribute in the formatted report
line (1 = attribute present, 0 = attribute absent).
Table 28. Record data area for an L record
Byte position Description
01 Blank
The record data area for a C record is shown in Table 30. The byte positions shown
are offset from the end of the control area, the length of which is indicated in the
header record.
Table 30. Record data area for a C record
Byte position Description
01 Blank
02-end Value or set of values being continued
Exporting a form
The form object contains all the information specified in all the QMF form panels.
When you export a form, QMF converts to the encoded format any form panels
whose values deviate from the default values. Thus, the following panels are in the
encoded format only if you modified the panel:
v FORM.BREAKn, where n = 1 to 6
v FORM.CALC
v FORM.CONDITIONS
v All variation panels greater than 1 for FORM.DETAIL
Eliminating unused panels from the externalized format helps you save space on
your system.
SELECT JOB
FROM Q.STAFF
WHERE NAME=’NO_NAME’
Figure 33. A query that creates an empty report (for the purposes of viewing the default form)
When QMF displays the report, enter EXPORT FORM TO DEFAULT (including the
QUEUETYPE=xx parameter in CICS).
T 1110 001 011 1112 007 1113 040 1114 007 1115 006 1116 005 1117 005 1118 003 1119 008 1120 008
1122 006 1121 050
R CHAR JOB 2 5 C 1 DEFAULT
DEFAULT NO
V 1201 001 0
V 1202 001 2
T 1210 001 003 1212 004 1213 006 1214 055
R 1 CENTER
V 1301 001 2
V 1302 001 0
T 1310 001 003 1312 004 1313 006 1314 055
R 1 CENTER
V 1401 002 NO
V 1402 001 1
V 1403 001 0
T 1410 001 003 1412 004 1413 006 1414 055
R 1 RIGHT
V 1501 001 1
V 1502 003 YES
V 1503 003 YES
V 1504 003 YES
V 1505 003 YES
V 1506 003 YES
V 1507 003 YES
V 1508 003 YES
V 1509 003 YES
V 1510 003 YES
V 1511 004 NONE
V 1512 002 NO
V 1513 007 DEFAULT
V 1514 002 NO
V 1515 004 NONE
V 2790 001 1
V 2791 003 YES
V 2805 003 YES
T 2810 001 003 2812 004 2813 006 2814 055
R 1 LEFT
V 2901 002 NO
V 2902 001 1
V 2904 001 0
V 2906 002 NO
V 2907 002 NO
T 2910 001 003 2912 004 2913 006 2914 055
R 1 LEFT
V 3080 001 1
V 3101 002 NO
V 3102 002 NO
V 3103 001 0
V 3104 001 0
T 3110 001 003 3112 004 3113 006 3114 055
R 1 LEFT
V 3201 002 NO
V 3202 001 1
V 3203 001 0
V 3204 001 1T 3210 001 003 3212 004 3213 006 3214 055
R 1 RIGHT
V 3080 001 2
V 3101 002 NO
V 3102 002 NO
V 3103 001 0
V 3104 001 0
T 3110 001 003 3112 004 3113 006 3114 055
R 1 LEFT
V 3201 002 NO
V 3202 001 1
V 3203 001 0
V 3204 001 1
T 3210 001 003 3212 004 3213 006 3214 055
R 1 RIGHT
E
You can import your default data set or CICS data queue every time you log on by
issuing the command IMPORT FORM FROM DEFAULT (including the QUEUETYPE=xx
parameter in CICS) in your initial procedure.
When you export a form from a non-English session, you can either export the form
in the current session language or in English. Because of this, the national
language identifier in the H record might not reflect the language of the session
from which you exported the form. See Table 1 on page vii for a list of national
language identifiers.
Field 3080, a V record, acts as a “trigger” for the break panels that follow it. This
record appears once for every break panel in your form. The value of the field
reflects the number of the break panel that the fields following field 3080 describe.
Table 32. Table and field numbers for an exported FORM object
Table or field
number Record type Description Form panel
1110 T Column headings table FORM.COLUMNS
1112 R Column data type; column data type is FORM.COLUMNS
not displayed on the form panels but is
associated with the form in its external
format. The column data type is not
required when a form is imported. If it
is missing during import, QMF provides
default data type information from the
edit codes. (See “Importing a form
object” on page 99 for more
information.)
Table 32. Table and field numbers for an exported FORM object (continued)
Table or field
number Record type Description Form panel
1212 R Page heading line number FORM.PAGE
1213 R Page heading alignment FORM.PAGE
1214 R Page heading text FORM.PAGE
1301 V Blank lines before footing FORM.PAGE
1302 V Blank lines after footing FORM.PAGE
1310 T Page foot table FORM.PAGE
1312 R Page footing line number FORM.PAGE
1313 R Page footing alignment FORM.PAGE
1314 R Page footing text FORM.PAGE
1401 V New page for final text FORM.FINAL
1402 V Final summary line number FORM.FINAL
1403 V Blank lines before final text FORM.FINAL
1410 T Final text table FORM.FINAL
1412 R Final text line number FORM.FINAL
1413 R Final text alignment FORM.FINAL
1414 R Final text FORM.FINAL
1501 V Detail line spacing FORM.OPTIONS
1502 V Outlining for break columns FORM.OPTIONS
1503 V Default break text FORM.OPTIONS
1504 V Function name in column heading for FORM.OPTIONS
grouping
1505 V Column-wrapped lines kept on a page FORM.OPTIONS
1506 V Across-summary column FORM.OPTIONS
1507 V Separators for column heading FORM.OPTIONS
1508 V Separators for break summary FORM.OPTIONS
1509 V Separators for across heading FORM.OPTIONS
1510 V Separators for final summary FORM.OPTIONS
1511 V Width of wrapped report lines FORM.OPTIONS
1512 V Page renumbering at breaks FORM.OPTIONS
1513 V Width of break or final text FORM.OPTIONS
1514 V Column re-ordering FORM.OPTION
1515 V Fixed columns FORM.OPTIONS
2790 V Detail variation number FORM.DETAIL
2791 V Detail variation selection FORM.DETAIL
2805 V Include column heading FORM.DETAIL
2810 T Detail heading table FORM.DETAIL
2812 R Detail heading text line FORM.DETAIL
2813 R Detail heading alignment FORM.DETAIL
2814 R Detail heading text FORM.DETAIL
2901 V New page for detail text FORM.DETAIL
2902 V Line number of column data FORM.DETAIL
2904 V Number of lines to skip after detail text FORM.DETAIL
2906 V Repeat detail heading FORM.DETAIL
2907 V Number of detail text lines to keep FORM.DETAIL
together
Table 32. Table and field numbers for an exported FORM object (continued)
Table or field
number Record type Description Form panel
2910 T Detail text table FORM.DETAIL
2912 R Detail text line number FORM.DETAIL
2913 R Detail text alignment FORM.DETAIL
2914 R Detail text FORM.DETAIL
3080 V Break panel number FORM.BREAKn
3101 V New page for break heading FORM.BREAKn
3102 V Repeat break heading FORM.BREAKn
3103 V Number of lines to skip before break FORM.BREAKn
heading
3104 V Number of lines to skip after break FORM.BREAKn
heading
3110 T Break heading text table FORM.BREAKn
3112 R Break heading line number FORM.BREAKn
3113 R Break heading alignment FORM.BREAKn
3114 R Break heading text FORM.BREAKn
3201 V New page for break text FORM.BREAKn
3202 V Break text summary line FORM.BREAKn
3203 V Number of lines to skip before break FORM.BREAKn
text
3204 V Number of lines to skip after break text FORM.BREAKn
3210 T Break text table FORM.BREAKn
3212 R Break text line FORM.BREAKn
3213 R Break text alignment FORM.BREAKn
3214 R Break text FORM.BREAKn
3310 T Conditions table FORM.CONDITIONS
3312 R Condition identification number FORM.CONDITIONS
3313 R Conditional expression FORM.CONDITIONS
3314 R Pass nulls on conditions panel FORM.CONDITIONS
Table 33 on page 98 shows the data-type keywords QMF generates for the edit
codes specified on the form. In this table, x represents the number of decimal
places to be displayed, where x is an integer from 0 to 99.
Table 33. Data type keywords generated for edit codes specified on the QMF form panels
Edit code specified Data type keyword
C, CW, CT, CDx CHAR
| B, BW, X, XW BINARY
G, GW GRAPHIC
E, D, I, J, K, L, P, EZ, DZ, IZ, JZ, KZ, LZ, PZ, DZC, Dx, Ix, NUMERIC
Jx, Kx, Lx, Px
TDXx DATE
TTXx TIME
TSI TIMEST
M UNKNOWN
U, V UNKNOWN
Invalid edit codes entered UNKNOWN
When you export a form, QMF only exports those variation panels with values that
have been changed from the default. Therefore, the total number of variations in the
external form can be less than that shown in the variation count indicator on the
panel. QMF can alter the individual variation numbers to put the variations back into
a continuous sequence.
When QMF reads such a record, it ignores all data in the record following the *.
The record, therefore, has no effect on the import process.
v Restrictions for using forms in CICS
Because REXX is not available under QMF for CICS, the areas on the QMF form
that rely on REXX do not work if you try to run the form in the CICS environment.
These areas include anything entered on the FORM.CALC panels, the
FORM.CONDITIONS panels, and the Specify Definition window. Therefore,
REXX calculations, conditional row formatting, and column definitions are not
available to QMF for CICS users.
For general information and rules governing the data sets or queues that contain
forms, reports, and prompted queries, see “Importing forms and prompted queries”
on page 115. For specific guidelines to follow when importing a form, see “Importing
a form object.”
The T record of the COLUMNS table (field number 1110) must immediately follow
the header record, and it must include a numeric count of the number of rows in the
encoded format (an * row count is not allowed).
If the entire COLUMNS table has been read in, unspecified fields are set to their
default values, and the form is displayed.
Variation panels: The variation number field (field number 2790) determines
which variation panel is updated by all the variation panel information that follows
the field. This V record should precede all other V, T, and R records for a given
variation panel.
If a value for a particular variation appears more than once in the encoded format,
the later values replace the original values. The number of variations in the form are
equal to the highest variation number in the form. There is no required order for
variation numbers when importing.
Omitting data type, edit code, and width in an imported form: In the
COLUMNS table, data type (field number 1112), edit code (field number 1117), and
width (field number 1116) can optionally be omitted when the following rules are
observed:
v Edit code must be included if data type and width are omitted. Based on the
specified edit code, QMF inserts appropriate defaults for data type and width.
v Data type must be included if edit code and width are omitted. QMF provides
default values for edit code and width.
v Width must be accompanied by either data type or edit code.
Table 34 contains information about values for the field containing the data type of
the column.
Table 34. Values for the field containing the data type of the column
Character string
Data type Code in decimal (database form) Meaning
DATE
384 DATE Date
TIME 388 TIME Time
TIMEST 392 TIMESTAMP Timestamp
NUMERIC 496 INTEGER Integer
500 SMALLINT Small integer
| 492 BIGINT Big integer
484 DECIMAL Decimal
480 FLOAT Floating point
CHAR 448 VARCHAR Varying-length character
452 CHAR Fixed-length character
456 LONG VARCHAR Long varying
character
904 ROWID Row identifier
GRAPHIC Varying-length graphic
464 VARGRAPHIC Fixed-length graphic
468 GRAPHIC Long varying
472 LONG VARGRAPHIC graphic
| BINARY 908 VARBINARY Varying-length binary
| 912 BINARY Fixed-length binary
In addition to the data type values shown in Table 34, there is an UNKNOWN data
type keyword that QMF uses in response to a U, V, or invalid edit code.
Detecting errors during import: If QMF detects an error in the format of the form
file during import, the import function ends with a message describing the error and
its location in the file.
If an error is encountered in the header record and a form already exists in the
temporary storage area, the existing form is displayed. If the form is successfully
imported, QMF displays the form panel.
If an error is encountered after the header record is read, any existing form in the
temporary storage area is discarded, and the home panel is displayed. However, if
the data object exists, QMF generates a default form for the data but does not
display it.
Certain minor errors detected by QMF do not terminate the import. In such cases,
QMF issues a warning message and, where appropriate, applies defaults. Some
examples are:
v V records
– Zero-length fields.
– The specified length field does not match the length of the data actually
supplied.
v T records
– Zero column length.
– The number of columns specified does not match the following field
number/length pairs.
The following command displays the error message for a particular message
number:
HELP message_number
This topic explains how to interpret the format of an exported sample report.
For a list of the field numbers, see “Interpreting the report header record in the
exported data set or queue” on page 104.
AVERAGE
DEPT JOB SALARY
------ ---------------
10 MGR 20865.86
----------
* 20865.86
15 CLERK 12383.35
MGR 20659.80
SALES 16502.83
----------
* 15482.33
20 CLERK 13878.68
MGR 18357.50
SALES 18171.25
----------
* 16071.53
==========
17473.24
COMPANY NAME
REPORT 17
When exporting a report, QMF writes the full text of the formatted report with
additional information to interpret the contents of the report.
The header record is the first record of the exported file. It is followed by the
appropriate V, T, and R records. If the report is an across-style report, it has another
group of V, T, and R records that follows the first group.
If you want to use only the formatted data of the report in your application, you can
have QMF send print output to a data set or CICS data queue. This data set or
CICS data queue contains only the formatted data without any layout information.
Table 36 shows the table numbers for T records and field numbers for V records:
Table 36. Table and field numbers for an exported report
Table or field
number Record type Description
1001 V Profile DECIMAL option
1002 V Length of L record control area + fixed area
When working with table and field numbers in an exported report, note the
following:
v Position 1 of the report line immediately follows the L-record fixed area.
v R records for text lines in each report heading (PAGE or BREAK) or footing
(PAGE, BREAK, or FINAL) are only written up to and including the last line that
contains modifications to the form defaults.
At least one R record is written for each heading or footing even when the fields
for a given heading or footing all have their original values.
v Continuation records are written for the report object when the maximum record
length would otherwise be exceeded.
<HTML>
<HEAD>
<TITLE>
Report
</TITLE>
</HEAD>
<BODY>
<PRE>
AVERAGE
DEPT JOB SALARY
---- ----- ---------
10 MGR 20865.86
---------
* 20865.86
15 CLERK 12383.53
MGR 20659.80
SALES 16052.83
---------
* 15482.33
20 CLERK 13878.67
MGR 18357.50
SALES 18171.25
---------
* 16071.52
=========
17473.52
COMPANY NAME
REPORT 17
</PRE>
</BODY>
</HTML>
COMPANY NAME
REPORT 18
PAGE 1
Figure 38. Sample across-style report. This report uses QMF across-style report functions.
Figure 39 on page 108 shows the encoded format that results from exporting the
across-style report in Figure 38.
Table 36 on page 104 explains field numbers common to both standard reports and
across-style reports. Table 38 explains the additional fields you see in the exported
across-style report.
Table 38. Field numbers for exported across-style report
Field number Record type Description
2001 V Edit code by which across value is formatted
2002 V Number of data lines per across group
2003 V Indicates whether the across summary column exists
For aggregated columns in an across report, fields 1014, 1015, and 1016 describe
the relative starting and ending positions of the field within an across value’s set of
aggregated columns. (Refer to field 2014 in Table 38 on page 108.)
Tables:
Q.STAFF(A)
Q.ORG(B)
Q.STAFF(C)
Join Tables:
A.DEPT And B.DEPTNUMB
And A.ID And C.ID
Columns:
A.ID
A.DEPT
A.JOB
A.SALARY
DEPTNUMB
C.SALARY
C.SALARY+A.COMM
Row Conditions:
If A.SALARY Is Greater Than 10000
And A.DEPT Is Equal To 84 or 96
Sort:
Descending by C.SALARY+A.COMM
Duplicate Rows:
Keep duplicate rows
See Figure 41 on page 110 for a complete example of the Prompted Query
encoded format.
Table definitions (field number 1110) are always exported. Join conditions (field
number 1510) are always exported if more than one table is selected.
To import a prompted query file, the file must have an H record followed by the
encoded table's T record. If no tables are specified, an empty query is imported.
Join conditions are not required unless more than one table is selected.
For information about R records, see “Table row records (R)” on page 87.
Table 40. Table and field numbers for an exported prompted query object
Record type Table number Field number Field description
T 1110 - Table definitions table. The T record in this
section of the exported prompted query in
Figure 41 on page 110 identifies this as the
portion containing the table names involved in
the query:
T 1110 003 002 1112 001 1113 050
Table 40. Table and field numbers for an exported prompted query object (continued)
Record type Table number Field number Field description
T 1150 - Join conditions table. The T record in this section
of the exported prompted query in Figure 41 on
page 110 identifies this as the portion containing
the join conditions involved in the query. Each T
record is followed by R records that identify
which tables will be joined and appears as
follows in the exported sample query in Figure 41
on page 110:
T 1150 002 002 1152 020 1153 020
R A.DEPT B.DEPTNUMB
R A.ID C.ID
Table 40. Table and field numbers for an exported prompted query object (continued)
Record type Table number Field number Field description
T 1310 - Row selection conditions. The T record in this
section of the exported prompted query in
Figure 41 on page 110 identifies this section of
the exported query as the portion containing the
query conditions. Each T record is followed by R
records that characterize each condition. The
section appears as follows in the exported
prompted query:
T 1310 009 003 1312 001 1313 008 1314 255
R 1 C A.SALARY
R 2 IS GT
R 3 10000
R 4 I
R 1 C A.DEPT
R 2 IS EQ
R 3 84
R 3 96
R 4 A
Table 40. Table and field numbers for an exported prompted query object (continued)
Record type Table number Field number Field description
For entry type '2', identifies the operator:
v EQ for 'equal to'
v LT for 'less than'
v LE for 'less than or equal to'
v GT for 'greater than'
v GE for 'greater than or equal to'
v BT for 'between'
v SW for 'starting with'
v EW for 'ending with'
v CT for 'containing'
v NL for NULL
For entry type '3', identifies a value
For entry type '4' (not used)
T 1410 - Sort conditions table. The T record in this section
of the exported prompted query in Figure 41 on
page 110 identifies this as the portion containing
the sort conditions for the query. Each T record is
followed by R records that characterize each sort
condition. This section appears as follows in the
exported prompted query:
T 1410 001 002 1412 001 1413 255
R D C.SALARY+A.COMM
The meaning of values for fields 1313 and 1314 depends on the sequence number
indicated in field number 1312 in the 1310 table.
v If QMF encounters a duplicate data value or table while importing, it replaces the
previous value or table. However, duplicates are not allowed where they would
violate the rules for a particular object. For example, the number of columns
provided for a form can’t be changed after the first COLUMNS table has been
processed.
v Table numbers, field numbers, and numeric lengths can contain leading zeroes or
leading blanks. However, trailing blanks (except for the blank delimiter) are not
allowed; fields must be right-justified.
v When * is used instead of a length or count, it must be left-justified and padded
with trailing blanks.
v If the value supplied for a data entry field is shorter than the field, it is padded
with trailing blanks; if it is longer, it is truncated.
v If the record is shorter than its fixed-format length, those fields left unspecified
are assumed to be blank.
SQL query
SELECT *
FROM Q.STAFF
SELECT *
FROM Q.STAFF
Because of the simplicity of the record format, creating or editing an SQL query or
procedure outside of QMF is very straightforward. An SQL query or procedure
consists of a fixed-length data set or data queue containing 79-byte query or
procedure records. When you import the resulting data set or data queue, your
query or procedure is in the QMF temporary storage area, ready to be run.
Charts
You can export a chart for processing outside of the QMF environment. A chart
cannot be saved as a QMF object in the database or retrieved from the database.
You cannot import charts into QMF.
When you export a chart in QMF, it converts the data from the report to a Graphics
Data Format (GDF). GDF, a GDDM format, is an existing standard for data
interchange. You can print the exported chart data using GDDM utilities, or include
it in documents. See the appropriate GDDM application programming guide for
details about the GDF format. The IBM Publications Center at www.ibm.com/shop/
publications/order contains the GDDM publications for further reference.
You can use an exported chart object just as you would any GDF-formatted data
set. For example, using the Document Composition Facility (DCF), an application
can combine a QMF report (using a printed or exported report) with a QMF chart
(using an exported chart) and send the formatted information to a printer.
For CICS, record sizes are indicated in Table 41; however, they are not enforced.
For example, you could import an SQL query from a temporary storage queue with
a record size of 32K and QMF would truncate it to 79 bytes.
Record format is not a factor for CICS temporary storage or transient data queues.
A temporary storage queue holds records without regard to their format. A transient
data queue is defined to a destination control table (DCT) and ignores the record
format.
You must specify a name for your data set or CICS data queue on the EXPORT or
IMPORT command. For more information about names, see DB2 QMF Reference.
Queue names have no default prefix or suffix. CICS temporary storage queue
names are 8 bytes; transient data queue names are 4 bytes.
Table 41. File and data set attributes
Object Record size Record format
Data or table Maximum size: 7,000 bytes Records must be fixed length
(QMF format)
Data or table Maximum size: 32,756 Records must be variable length
(IXF format)
The minimum LRECL for an exported
form that includes defined columns is
161 bytes.
Minimum: 65 bytes
HTML report Maximum: 32,000 bytes Records must be variable length.
Storage considerations
This topic explains how QMF handles storage when importing and exporting
objects.
QMF handles CICS transient data queues differently than temporary storage
queues.
v Transient data queues: QMF imports the entire transient data queue prior to
displaying the object on the screen. This means that the contents of the entire
queue must fit into your storage or spill area. It also means that, if the object to
be displayed is large, there may be a delay before QMF displays the object on
the screen.
A CICS intrapartition transient data queue can hold up to 32K rows of data; an
extrapartition transient data queue can be as large as it needs to be to hold the
object.
v Temporary storage queues: By default, QMF reads approximately 100 rows of
temporary storage before displaying them to the user. A temporary storage queue
can hold up to 32K rows of data.
QMF uses the SUSPEND parameter on the IMPORT and EXPORT commands to
let CICS regulate when the command is run.
The SUSPEND parameter on the IMPORT and EXPORT commands determines the
action to be taken if a queue is busy. When the SUSPEND parameter is set to YES,
QMF issues a CICS ENQ (enqueue) for the CICS data queue name. This tells
CICS to wait until the queue is available before writing the QMF object to the
queue, thus ensuring that the QMF transaction does not interfere with any other
jobs being handled by the queue.
When the SUSPEND parameter is set to NO, the EXPORT command is canceled
and a message is returned. The default value of SUSPEND is NO.
The techniques described in this topic apply to callable interface applications. For
information on ISPF debugging techniques, see Chapter 6, “Writing QMF
applications that use ISPF services,” on page 31.
You can use the REXX trace facility through the REXX trace statement. For more
details on this statement, see the REXX information in the IBM Publications Center
at www.ibm.com/shop/publications/order.
See “Allocating the QMF trace data output” on page 122 and Installing and
Managing DB2 QMF for TSO/CICS for details on how to allocate storage for trace
data.
The A option can be A0, A1, or A2. A0 is the default and is interpreted as the signal
for no A-tracing at all. A1 and A2 can then call for increasingly detailed results. This
is the pattern used for the other QMF trace options. (For more information on these
options, see Installing and Managing DB2 QMF for TSO/CICS.)
You specify the A option in the same way you specify the L option: through a QMF
SET PROFILE command, or by entering it on the screen after you issue the
DISPLAY PROFILE command. For example, you can enter the following just before
you invoke the application you are debugging:
SET PROFILE (TRACE=L2A1)
When you begin your application, both L2 and A1 tracing are in effect.
Figure 44. Sample REXX program that sets tracing for application support services
This discontinues tracing for the rest of the QMF session, but does not affect the
permanent QMF profile.
For examples of how to allocate QMF trace data output for TSO, see the
programming examples for the language you are using:
Assembler “Assembler language interface” on page 125
C Language “C language interface” on page 142
COBOL “COBOL language interface” on page 153
FORTRAN “FORTRAN language interface” on page 164
PL/I “PL/I language interface” on page 176
REXX “REXX language interface” on page 189
For CICS, you can use program parameters DSQSDBQT and DSQSDBQN to
specify where QMF puts your trace data. (For more information about these
program parameters, see “START” on page 50 or Installing and Managing DB2
QMF for TSO/CICS.) Use caution when using CICS temporary storage, because
QMF can produce a large amount of trace data. Because trace data that exceeds
the size of the queue is discarded, CICS temporary storage is recommended only
for trace data from messages or small applications.
By placing MESSAGE commands at strategic points in your program, you can log
useful information in the QMF trace file. You can examine the information either on
a display device or in printed output. For more information about the QMF trace
data output, see “Allocating the QMF trace data output” on page 122 or Installing
and Managing DB2 QMF for TSO/CICS.
The following lines show an example of how to turn tracing on and issue meaningful
messages that will appear in the trace output:
call
. dsqcix "SET PROFILE (TRACE=L2"
.
.
call
. dsqcix "MESSAGE (TEXT=’QUERYA COMPLETED SUCCESSFULLY’"
.
.
call
. dsqcix "MESSAGE (TEXT=’EXECB ENTERED WITH VALUE OF 7’"
.
.
Because QMF messages may change from one release to the next, you should not
use the QMF trace data output as input to an application.
The sample program shown in each of these topics does the following:
v Starts QMF
v Sets three global variables
v Runs a query called Q1
v Prints the resulting report using form F1
v Ends the QMF session
QMF does not supply query Q1 or form F1; they are just shown for the purposes of
the examples in each topic.
This topic also shows how to assemble (or compile) and link-edit the programs as
well as how to run them using the callable interface. IBM does not provide the
REXX execs, JCL, or CLISTs in these examples, but you can copy them and alter
them to suit your needs.
DSQCIA
This call is for QMF commands that do not require access to application program
variables. Use this call for most QMF commands.
CALL DSQCIA,(DSQCOMM,CMDLTH,CMDSTR),VL
DSQCOMM
The interface communications area
CMDLTH
Length of the command string (CMDSTR); a FULLWORD parameter
CMDSTR
The QMF command being issued on the function call; an uppercase character
string of the length specified by CMDLTH
VL is the Assembler VARIABLE LIST statement. For more information about this
statement, see the information for your version of Assembler in the IBM Publications
Center at www.ibm.com/shop/publications/order.
All values specified in the VALUE field must have the data type specified in
VTYPE.
VL is the Assembler VARIABLE LIST statement. For more information about this
statement, see the information for your version of Assembler in the IBM Publications
Center at www.ibm.com/shop/publications/order.
The sample programs for the Assembler callable interface perform the following
functions:
v Start QMF
v Set three global variables
v Run a query called Q1
v Print the resulting report using form F1
v End the QMF session
QMF does not supply query Q1 or form F1, but the sample programs use these
objects.
This topic also shows how to assemble, link-edit, and run an Assembler program
using the callable interface. The REXX JCL and CLISTs in these examples are not
provided with QMF, but you can copy them from here, altering them to suit your
needs.
Figure 45. DSQABFAC, the sample Assembler program for CICS (Part 1 of 5)
*********************************************************************** 00040000
* Set numeric values into query using SET command * 00041000
*********************************************************************** 00042000
SPACE 1 00043000
LA R1,20 Set values for SET GLOBAL command 00044000
ST R1,VVAL1 00045000
LA R1,40 00046000
ST R1,VVAL2 00047000
LA R1,84 00048000
ST R1,VVAL3 00049000
LA R1,SETGL Addr of SET GLOBAL command length 00050000
ST R1,QMFP2 00051000
LA R1,SETG Address of SET GLOBAL command 00052000
ST R1,QMFP3 00053000
LA R1,3 Three SET GLOBAL variables 00054000
ST R1,NUMPARMS 00055000
LA R1,NUMPARMS Address of number of parameters 00056000
ST R1,QMFP4 00057000
LA R1,VNAME1L Address of variable name lengths 00058000
ST R1,QMFP5 00059000
LA R1,VNAME1 Address of variable names 00060000
ST R1,QMFP6 00061000
LA R1,VVAL1L Address of value lengths 00062000
ST R1,QMFP7 00063000
LA R1,VVAL1 Address of values 00064000
ST R1,QMFP8 00065000
LA R1,DSQ_VARIABLE_FINT Address of value data type 00066000
ST R1,QMFP9 00067000
OI QMFP9,X’80’ Set end of parameter list 00068000
LA R1,QMFPLIST Address of parameter list 00069000
CALL DSQCIA 00070000
SPACE 1 00071000
Figure 45. DSQABFAC, the sample Assembler program for CICS (Part 2 of 5)
*********************************************************************** 00072000
* Run a query * 00073000
*********************************************************************** 00074000
LA R1,QUERYL Addr of RUN QUERY command length 00075000
ST R1,QMFP2 00076000
LA R1,QUERY Address of RUN QUERY command 00077000
ST R1,QMFP3 00078000
OI QMFP3,X’80’ Set end of parameter list 00079000
LA R1,QMFPLIST Address of parameter list 00080000
CALL DSQCIA 00081000
SPACE 1 00082000
*********************************************************************** 00083000
* Print the result of the query * 00084000
*********************************************************************** 00085000
LA R1,REPTL Addr of PRINT REPORT cmd length 00086000
ST R1,QMFP2 00087000
LA R1,REPT Address of PRINT REPORT command 00088000
ST R1,QMFP3 00089000
OI QMFP3,X’80’ Set end of parameter list 00090000
LA R1,QMFPLIST Address of parameter list 00091000
CALL DSQCIA 00092000
SPACE 1 00093000
*********************************************************************** 00094000
* End the query interface session * 00095000
*********************************************************************** 00096000
LA R1,ENDQIL Address of EXIT command length 00097000
ST R1,QMFP2 00098000
LA R1,ENDQI Address of EXIT command 00099000
ST R1,QMFP3 00100000
OI QMFP3,X’80’ Set end of parameter list 00101000
LA R1,QMFPLIST Address of parameter list 00102000
CALL DSQCIA 00103000
SPACE 1 00104000
*********************************************************************** 00105000
* Return * 00106000
*********************************************************************** 00107000
SPACE 1 00108000
XR R15,R15 ZERO RETURN CODE 00109000
DFHEIRET RCREG=15 00110000
Figure 45. DSQABFAC, the sample Assembler program for CICS (Part 3 of 5)
*********************************************************************** 00111000
* Data Areas * 00112000
*********************************************************************** 00113000
SPACE 1 00114000
* Query Interface commands 00115000
SPACE 1 00116000
STARTQI DC C’START’ START FUNCTION 00117000
SETG DC C’SET GLOBAL’ SET GLOBAL FUNCTION 00118000
QUERY DC C’RUN QUERY Q1’ RUN QUERY 00119000
REPT DC C’PRINT REPORT (FORM=F1)’ PRINT REPORT 00120000
ENDQI DC C’EXIT’ END INTERFACE 00121000
SPACE 1 00122000
DS 0F 00123000
STARTQIL DC AL4(L’STARTQI) LENGTH OF START FUNCTION 00124000
SETGL DC AL4(L’SETG) LENGTH OF SET GLOBAL FUNCTION 00125000
QUERYL DC AL4(L’QUERY) LENGTH OF RUN QUERY COMMAND 00126000
REPTL DC AL4(L’REPT) LENGTH OF PRINT REPORT COMMAND 00127000
ENDQIL DC AL4(L’ENDQI) LENGTH OF END INTERFACE COMMAND 00128000
SPACE 1 00129000
* START command keyword 00130000
SPACE 1 00131000
STARTKY DC C’DSQSMODE’ 00132000
STARTV DC C’INTERACTIVE’ 00133000
DS 0F 00134000
STARTKYL DC AL4(L’STARTKY) 00135000
STARTVL DC AL4(L’STARTV) 00136000
SPACE 1 00137000
* SET GLOBAL command variable names 00138000
SPACE 1 00139000
VNAME1 DC C’MYVAR01’ 00140000
VNAME2 DC C’SHORT’ 00141000
VNAME3 DC C’MYVAR03’ 00142000
DS 0F 00143000
VNAME1L DC AL4(L’VNAME1) 00144000
VNAME2L DC AL4(L’VNAME2) 00145000
VNAME3L DC AL4(L’VNAME3) 00146000
SPACE 1 00147000
* SET GLOBAL command values 00148000
SPACE 1 00149000
VVAL1L DC AL4(L’VVAL1) 00150000
VVAL2L DC AL4(L’VVAL2) 00151000
VVAL3L DC AL4(L’VVAL3) 00152000
* Callable interface communications definition 00153000
DSQCOMMA 00154000
Figure 45. DSQABFAC, the sample Assembler program for CICS (Part 4 of 5)
Figure 45. DSQABFAC, the sample Assembler program for CICS (Part 5 of 5)
Figure 46. DSQABFA, the sample Assembler program for TSO (Part 1 of 4)
***********************************************************************
* Set numeric values into query using SET command *
***********************************************************************
SPACE 1
LA R1,20 SET VALUES TO BE MODIFIED
ST R1,VVAL1
LA R1,40
ST R1,VVAL2
LA R1,84
ST R1,VVAL3
LA R1,3 3 PARAMETERS
ST R1,NUMPARMS
SPACE 1
CALL DSQCIA, X
(CICOMM, X
SETGL, SET GLOBAL COMMAND LENGTH X
SETG, SET GLOBAL COMMAND X
NUMPARMS, NUM OF VARIABLES TO BE SET X
VNAME1L, VARIABLE NAME LENGTHS X
VNAME1, VARIABLE NAMES X
VVAL1L, VALUE LENGTHS X
VVAL1, VALUES X
DSQ_VARIABLE_FINT),VL VALUES ARE INTEGERS
SPACE 1
***********************************************************************
* Run a query *
***********************************************************************
SPACE 1
CALL DSQCIA, X
(CICOMM, X
QUERYL, QUERY COMMAND LENGTH X
QUERY),VL TEXT OF QUERY COMMAND
SPACE 1
***********************************************************************
* Print the result of the query *
***********************************************************************
SPACE 1
CALL DSQCIA,(CICOMM,REPTL,REPT),VL
SPACE 1
***********************************************************************
* End the query interface session *
***********************************************************************
SPACE 1
CALL DSQCIA,(CICOMM,ENDQIL,ENDQI),VL
SPACE 1
Figure 46. DSQABFA, the sample Assembler program for TSO (Part 2 of 4)
***********************************************************************
* Return *
***********************************************************************
SPACE 1
SR R15,R15 SET RETURN CODE
L R13,4(R13)
L R14,12(R13) RESTORE CALLER REGISTERS
LM R0,R12,20(R13)
BR R14
EJECT
***********************************************************************
* Data Areas *
***********************************************************************
SPACE 1
* Query Interface commands
SPACE 1
STARTQI DC C’START’ START FUNCTION
SETG DC C’SET GLOBAL’ SET GLOBAL FUNCTION
QUERY DC C’RUN QUERY Q1’ RUN QUERY
REPT DC C’PRINT REPORT (FORM=F1)’ PRINT REPORT
ENDQI DC C’EXIT’ END INTERFACE
SPACE 1
DS 0F
STARTQIL DC AL4(L’STARTQI) LENGTH OF START FUNCTION
SETGL DC AL4(L’SETG) LENGTH OF SET GLOBAL FUNCTION
QUERYL DC AL4(L’QUERY) LENGTH OF RUN QUERY COMMAND
REPTL DC AL4(L’REPT) LENGTH OF PRINT REPORT COMMAND
ENDQIL DC AL4(L’ENDQI) LENGTH OF END INTERFACE COMMAND
SPACE 1
* START command keyword
SPACE 1
STARTKY DC C’DSQSMODE’
STARTV DC C’INTERACTIVE’
DS 0F
STARTKYL DC AL4(L’STARTKY)
STARTVL DC AL4(L’STARTV)
SPACE 1
* SET GLOBAL command variable names
SPACE 1
VNAME1 DC C’MYVAR01’
VNAME2 DC C’SHORT’
VNAME3 DC C’MYVAR03’
DS 0F
VNAME1L DC AL4(L’VNAME1)
VNAME2L DC AL4(L’VNAME2)
VNAME3L DC AL4(L’VNAME3)
SPACE 1
* SET GLOBAL command values
SPACE 1
VVAL1 DS F
VVAL2 DS F
VVAL3 DS F
VVAL1L DC AL4(L’VVAL1)
VVAL2L DC AL4(L’VVAL2)
VVAL3L DC AL4(L’VVAL3)
SPACE 1
NUMPARMS DS F NUMBER OF KEYWORDS
SPACE 1
Figure 46. DSQABFA, the sample Assembler program for TSO (Part 3 of 4)
Figure 46. DSQABFA, the sample Assembler program for TSO (Part 4 of 4)
MACRO 00001000
DSQCOMMA 00002000
********************************************************************** 00003000
* Callable Interface - variable constants * 00004000
********************************************************************** 00005000
* 00006000
* Communications Level ID 00007000
* 00008000
DSQ_CURRENT_COMM_LEVEL DC CL12’DSQL>001002<’ 00009000
* 00010000
* Query Product IDs 00011000
* 00012000
DSQ_QRW DC C’01’ 00013000
DSQ_QMF DC C’02’ 00014000
DSQ_QM4 DC C’03’ 00015000
* 00016000
* Query Product Release IDs 00017000
* 00018000
DSQ_QRW_V1R2 DC C’01’ 00019000
DSQ_QRW_V1R3 DC C’02’ 00020000
DSQ_QMF_V2R4 DC C’01’ 00021000
DSQ_QMF_V3R1 DC C’02’ 00022000
DSQ_QMF_V3R1M1 DC C’03’ 00023000
DSQ_QMF_V3R2 DC C’04’ 00024000
DSQ_QMF_V3R3 DC C’05’ 00025000
DSQ_QMF_V6R1 DC C’06’ 00026000
DSQ_QM4_V1R1 DC C’01’ 00027000
* 00028000
* Extended parameter data types 00029000
* 00030000
DSQ_VARIABLE_CHAR DC C’CHAR’ 00031000
DSQ_VARIABLE_FINT DC C’FINT’ 00032000
* 00033000
* Return codes 00034000
* 00035000
DSQ_SUCCESS EQU 0 00036000
DSQ_WARNING EQU 4 00037000
DSQ_FAILURE EQU 8 00038000
DSQ_SEVERE EQU 16 00039000
* 00040000
* Instance ID values 00041000
* 00042000
DSQ_CONTINUE EQU 0 00043000
* 00044000
When you translate, assemble, and link-edit a program that uses the QMF callable
interface, be aware of the following:
v The interface communications area, DSQCOMMA, must be available to the
assemble step or copied into your program as a DSECT.
v The QMF interface module, DSQCIA, must be made available during the link-edit
step of your program.
The JCL shown in Figure 48 on page 140 is an example of how to use the
CICS-supplied procedure DFHEBTAL. For instructions on how to use this
procedure, see the appropriate CICS information in the IBM Publications Center at
www.ibm.com/shop/publications/order.
//sampasm JOB
// EXEC PROC=DFHEBTAL
//TRN.SYSIN DD *
*ASM XOPTS(CICS translator options .....)
.
Your program or copy of QMF sample DSQABFA
.
/*
//* Provide Access to QMF Communications Macro DSQCOMM
| //ASM.SYSLIB DD DSN=QMF910.SDSQSAPE,DISP=SHR
//* Provide Access to QMF Interface Module
| //LKED.QMFLOAD DD DSN=QMF910.SDSQLOAD,DISP=SHR
//LKED.SYSIN DD *
INCLUDE CICSLOAD(DFHEAI)
INCLUDE CICSLOAD(DFHEAI0)
INCLUDE QMFLOAD(DSQCIA)
ORDER DFHEAI,DFHEAI0
ENTRY sampasm
| MODE AMODE(31) RMODE(31)
NAME sampasm(R)
/*
Figure 48. JCL for running the CICS translator, assembler, and linkage editor
//sampasm JOB
//STEP1 EXEC PROC=ASMHCL
//* Provide Access to QMF Communications Macro DSQCOMM
| //C.SYSLIB DD DSN=QMF910.SAMPLIB,DISP=SHR
//C.SYSIN DD *
.
Your program or copy of QMF sample DSQABFA
.
/*
//* Provide Access to QMF Interface Module
| //L.QMFLOAD DD DSN=QMF910.SDSQLOAD,DISP=SHR
//L.SYSIN DD *
INCLUDE QMFLOAD(DSQCIA)
ENTRY sampasm
| MODE AMODE(31) RMODE(31)
NAME sampasm(R)
/*
Figure 49. JCL for running the assembler and linkage editor in TSO
After your program is assembled successfully, you can run it, as explained in one of
the following topics:
PROC 0
CONTROL ASIS
/************************************************************/
/* Specify attribute list for dataset allocations */
/************************************************************/
ATTR PRINTDCB LRECL(133) RECFM(F B A) BLKSIZE(1330)
ATTR DEBUGDCB LRECL(80) RECFM(F B) BLKSIZE(3120)
ATTR UDUMPDCB LRECL(125) RECFM(V B A) BLKSIZE(1632)
ATTR EDITDCB LRECL(79) RECFM(F B A) BLKSIZE(4029)
/************************************************************/
/* Datasets used by TSO */
/************************************************************/
| ALLOC FI(SYSPROC) DA(’QMF910.SDSQCLTE’,’ISR.ISRCLIB’)
| ALLOC FI(SYSEXEC) DA(’QMF910.SDSQEXCE’)
/************************************************************/
/* Datasets used by ISPF */
/************************************************************/
ALLOC FI(ISPLLIB) SHR REUSE +
| DA(’QMF910.SDSQLOAD’,’ADM.GDDMLOAD’,’DSN.DSNEXIT’,’DSN.DSNLOAD’)
ALLOC FI(ISPMLIB) SHR REUSE +
| DA(’QMF910.SDSQMLBE’,’ISR.ISRMLIB’,’ISP.ISPMLIB’)
ALLOC FI(ISPPLIB) SHR REUSE +
| DA(’QMF910.SDSQPLBE’,’ISR.ISRPLIB’,’ISP.ISPPLIB’)
ALLOC FI(ISPSLIB) SHR REUSE +
| DA(’QMF910.SDSQSLBE’,’ISR.ISRSLIB’,’ISP.ISPSLIB’)
ALLOC FI(ISPTLIB) SHR REUSE +
DA(’ISR.ISRTLIB’,’ISP.ISPTLIB’)
/************************************************************/
/* QMF/GDDM Datasets */
/************************************************************/
| ALLOC FI(ADMGGMAP) DA(’QMF910.SDSQMAPE’) SHR REUSE
| ALLOC FI(ADMCFORM) DA(’QMF910.DSQCFORM’) SHR REUSE
| ALLOC FI(DSQUCFRM) DA(’QMF910.DSQUCFRM’) SHR REUSE
ALLOC FI(ADMSYMBL) DA(’ADM.GDDMSYM’) SHR REUSE
ALLOC FI(ADMGDF) DA(’ADM.GDDM.CHARTLIB’) SHR REUSE
ALLOC FI(ADMDEFS) DA(’ADM.GDDM.NICKNAME’) SHR REUSE
/************************************************************/
/* Datasets used by QMF */
/************************************************************/
ALLOC FI(DSQPRINT) SYSOUT(X) USING(PRINTDCB)
ALLOC FI(DSQDEBUG) SYSOUT(X) USING(DEBUGDCB)
ALLOC FI(DSQUDUMP) SYSOUT(X) USING(UDUMPDCB)
ALLOC FI(DSQSPILL) NEW UNIT(SYSDA) SPACE(1,1) TRACKS
ALLOC FI(DSQEDIT) NEW UNIT(SYSDA) USING(EDITDCB)
| ALLOC FI(DSQPNLE) DA(’QMF910.DSQPNLE’) SHR REUSE
/************************************************************/
/* Start your program as the initial ISPF dialog */
/************************************************************/
ISPSTART PGM(sampasm) NEWAPPL(DSQE)
EXIT CODE(4)
Figure 50. CLIST for running your program in TSO under ISPF
PROC 0
CONTROL ASIS
/************************************************************/
/* Note: QMF, DB2 and GDDM load libraries must be allocated */
/* before executing this CLIST. */
| /* Name of QMF load library is "QMF910.SDSQLOAD". */
/************************************************************/
/* Specify attribute list for dataset allocations */
/************************************************************/
ATTR PRINTDCB LRECL(133) RECFM(F B A) BLKSIZE(1330)
ATTR DEBUGDCB LRECL(80) RECFM(F B) BLKSIZE(3120)
ATTR UDUMPDCB LRECL(125) RECFM(V B A) BLKSIZE(1632)
ATTR EDITDCB LRECL(79) RECFM(F B A) BLKSIZE(4029)
/************************************************************/
/* Datasets used by TSO */
/************************************************************/
| ALLOC FI(SYSPROC) DA(’QMF910.SDSQCLTE’)
| ALLOC FI(SYSEXEC) DA(’QMF910.SDSQEXCE’)
/************************************************************/
/* QMF/GDDM Datasets */
/************************************************************/
| ALLOC FI(ADMGGMAP) DA(’QMF910.SDSQMAPE’) SHR REUSE
| ALLOC FI(ADMCFORM) DA(’QMF910.DSQCFORM’) SHR REUSE
| ALLOC FI(DSQUCFRM) DA(’QMF910.DSQUCFRM’) SHR REUSE
ALLOC FI(ADMSYMBL) DA(’ADM.GDDMSYM’) SHR REUSE
ALLOC FI(ADMGDF) DA(’ADM.GDDM.CHARTLIB’) SHR REUSE
ALLOC FI(ADMDEFS) DA(’ADM.GDDM.NICKNAME’) SHR REUSE
/************************************************************/
/* Datasets used by QMF */
/************************************************************/
ALLOC FI(DSQPRINT) SYSOUT(X) USING(PRINTDCB)
ALLOC FI(DSQDEBUG) SYSOUT(X) USING(DEBUGDCB)
ALLOC FI(DSQUDUMP) SYSOUT(X) USING(UDUMPDCB)
ALLOC FI(DSQSPILL) NEW UNIT(SYSDA) SPACE(1,1) TRACKS
ALLOC FI(DSQEDIT) NEW UNIT(SYSDA) USING(EDITDCB)
| ALLOC FI(DSQPNLE) DA(’QMF910.DSQPNLE’) SHR REUSE
/************************************************************/
/* Start your program using TSO CALL command */
/************************************************************/
CALL sampasm
EXIT CODE(0)
Figure 51. CLIST for running your program under TSO without ISPF
C language interface
This topic explains the interface communications area for the C language,
DSQCOMMC, and two C function calls, DSQCICE and DSQCIC.
DSQCIC
This call is for QMF commands that do not require access to application program
variables. Use this call for most QMF commands; its syntax is as follows:
DSQCIC (&DSQCOMM,&CMDLTH,&CMDSTR)
DSQCICE
This call has an extended syntax for the three QMF commands that require access
to application program variables: START and the extended formats of GET
GLOBAL and SET GLOBAL.
DSQCICE (&DSQCOMM,&CMDLTH,&CMDSTR,
&PNUM,&KLTH,&KWORD,
&VLTH,&VALUE,&VTYPE);
All of the values specified in the VALUE field must have the data type specified
in VTYPE.
The C language interface is similar to the others. There are, however, the following
parameter considerations:
v Command strings and the START, GET, and SET command parameters are all
input character strings. For these, C requires you to pass a storage area that is
terminated with a null value, which must be included in the parameter’s length.
The compile-time length function should be used to obtain the parameter length
that is passed to the QMF interface.
v If the string is not terminated by a null value before reaching the end of the
string, an error is returned by QMF. The null value (X'00') indicates the end of a
character string.
v For C parameters that are output character strings, including values obtained by
the GET command, QMF moves data from QMF storage to the application’s
storage area and sets the null indicator at the end of the string. If the character
string does not fit in the user’s storage area, a warning message is issued and
the data is truncated on the right. A null indicator is always placed at the end of
the data string.
The program shown in Figure 52 on page 146, DSQABFC, is provided with QMF.
You can look at the sample source code listing here or you can access it online.
The sample program is a member of the library QMF910.SDSQSAPn (where n is a
national language identifier from Table 1 on page vii).
QMF does not supply query Q1 or form F1, but the sample program uses these
objects.
/******************************************************************/
/* Sample Program: DSQABFC */
/* C Version of the Callable Interface */
/******************************************************************/
/******************************************************************/
/* Include standard and string "C" functions */
/******************************************************************/
#include <string.h>
#include <stdlib.h>
/******************************************************************/
/* Include and declare query interface communications area */
/******************************************************************/
#include <DSQCOMMC.H>
int main()
{
/******************************************************************/
/* Query interface command length and commands */
/******************************************************************/
signed long command_length;
static char start_query_interface[] = "START";
static char set_global_variables[] = "SET GLOBAL";
static char run_query[] = "RUN QUERY Q1";
static char print_report[] = "PRINT REPORT (FORM=F1";
static char end_query_interface[] = "EXIT";
/******************************************************************/
/* Query command extension, number of parameters and lengths */
/******************************************************************/
signed long number_of_parameters; /* number of variables */
signed long keyword_lengths[10]; /* lengths of keyword names */
signed long data_lengths[10]; /* lengths of variable data */
/******************************************************************/
/* Variable data type constants */
/******************************************************************/
static char char_data_type[] = DSQ_VARIABLE_CHAR;
static char int_data_type[] = DSQ_VARIABLE_FINT;
/******************************************************************/
/* Keyword parameter and value for START command */
/******************************************************************/
static char start_keywords[] = "DSQSMODE";
static char start_keyword_values[] = "INTERACTIVE";
/******************************************************************/
/* Keyword parameter and values for SET command */
/******************************************************************/
#define SIZE_VAL 8
char set_keywords [3][SIZE_VAL]; /* Parameter name array */
signed long set_values[3]; /* Parameter value array */
/******************************************************************/
/* MAIN PROGRAM */
/******************************************************************/
/******************************************************************/
/* Start a Query Interface Session */
/******************************************************************/
strncpy (communication_area.dsq_comm_level,
DSQ_CURRENT_COMM_LEVEL,
sizeof(communication_area.dsq_comm_level));
number_of_parameters = 1;
command_length = sizeof(start_query_interface);
keyword_lengths[0] = sizeof(start_keywords);
data_lengths[0] = sizeof(start_keyword_values);
dsqcice(&communication_area,;
&command_length,;
&start_query_interface[0],
&number_of_parameters,;
&keyword_lengths[0],
&start_keywords[0],
&data_lengths[0],
&start_keyword_values[0],
&char_data_type[0]);
/******************************************************************/
/* Set numeric values into query using SET command */
/******************************************************************/
number_of_parameters = 3;
command_length = sizeof(set_global_variables);
strcpy(set_keywords[0],"MYVAR01");
strcpy(set_keywords[1],"SHORT");
strcpy(set_keywords[2],"MYVAR03");
keyword_lengths[0] = SIZE_VAL;
keyword_lengths[1] = SIZE_VAL;
keyword_lengths[2] = SIZE_VAL;
data_lengths[0] = sizeof(long);
data_lengths[1] = sizeof(long);
data_lengths[2] = sizeof(long);
set_values[0] = 20;
set_values[1] = 40;
set_values[2] = 84;
dsqcice(&communication_area,;
&command_length,;
&set_global_variables[0],
&number_of_parameters,;
&keyword_lengths[0],
&set_keywords[0][0],
&data_lengths[0],
&set_values[0],
&int_data_type[0]);
/******************************************************************/
/* Run a Query */
/******************************************************************/
command_length = sizeof(run_query);
dsqcic(&communication_area,&command_length,;
&run_query[0]);
/******************************************************************/
/* Print the results of the query */
/******************************************************************/
command_length = sizeof(print_report);
dsqcic(&communication_area,&command_length,;
&print_report[0]);
/******************************************************************/
/* End the query interface session */
/******************************************************************/
command_length = sizeof(end_query_interface);
dsqcic(&communication_area,&command_length,;
&end_query_interface[0]);
exit(0);
}
DSQCOMM for C
The include file shown in Figure 53 on page 149, DSQCOMMC, is provided with the
QMF product.
/******************************************************************/
/* C Include for Query Callable Interface */
/******************************************************************/
struct dsqcomm {
long int dsq_return_code; /* Function return code */
long int dsq_instance_id; /* id established in start cmd*/
char dsq_comm_level[12]; /* communications level id */
char dsq_product[2]; /* query product id */
char dsq_product_release[2]; /* query product release */
char dsq_reserve1[28]; /* reserved */
char dsq_message_id[8]; /* completion message ID */
char dsq_q_message_id[8]; /* query message ID */
char dsq_start_parm_error[8]; /* start parameter in error */
char dsq_cancel_ind[1]; /* cmd cancelled indicator */
/* 1 = cancelled, 0 = not cancelled*/
char dsq_reserve2[23]; /* RESERVED AREAS */
char dsq_reserve3[156];
char dsq_message_text[128]; /* Message text */
char dsq_q_message_text[128]; /* Query message text */
} ;
/* RETURN CODES */
#define DSQ_SUCCESS 0
#define DSQ_WARNING 4
#define DSQ_FAILURE 8
#define DSQ_SEVERE 16
/* Communications Level */
/* INSTANCE CODES */
#define DSQ_CONTINUE 0
/* CANCELLED INDICATOR */
/* VARIABLE TYPES */
When you translate, compile, and link-edit a program that uses the QMF callable
interface under CICS, consider the following:
v The interface communications area DSQCOMMC must be available to the
compile step or copied into your program.
v The QMF interface module DSQCICX must be available during the link-edit step
of your program.
v Programs written in C must be link-edited with AMODE=31.
//sampleC JOB
// EXEC PROC=DFHEBTDL
//TRN.SYSIN DD *
#pragma XOPTS(CICS translator options .....)
.
Your program or copy of QMF sample DSQABFC
.
/*
//* Provide Access to QMF Communications Macro DSQCOMMC
| //ASM.SYSLIB DD DSN=QMF910.SDSQSAPE,DISP=SHR
//* Provide Access to QMF Interface Module
| //LKED.QMFLOAD DD DSN=QMF910.SDSQLOAD,DISP=SHR
//LKED.SYSIN DD *
INCLUDE CICSLOAD(DFHELII)
INCLUDE QMFLOAD(DSQCICX)
ORDER DFHELII
ENTRY sampleC
| MODE AMODE(31) RMODE(31)
NAME sampleC(R)
/*
Figure 54. JCL for running the CICS translator, C compiler, and linkage editor
//sampleC JOB
//STEP1 EXEC PROC=EDCCL,LPARM=’MAP’
//* Provide Access to QMF Communications Macro DSQCOMM
| //COMPILE.SYSLIB DD DSN=QMF910.SAMPLIB,DISP=SHR
//COMPILE.SYSIN DD DATA,DLM=’<>’
.
Your program or copy of QMF sample DSQABFC
.
<>
//* Provide Access to QMF Interface Module DSQCICX
| //LKED.SYSLIB DD DSN=QMF910.SDSQLOAD,DISP=SHR
/*
Figure 55. JCL for running the C compiler and linkage editor in TSO
PROC 0
CONTROL ASIS
/************************************************************/
/* Note: QMF, DB2, GDDM and C load libraries must be */
/* allocated before running this CLIST. */
| /* Name of QMF load library is "QMF910.SDSQLOAD". */
/************************************************************/
/* Specify attribute list for dataset allocations */
/************************************************************/
ATTR PRINTDCB LRECL(133) RECFM(F B A) BLKSIZE(1330)
ATTR DEBUGDCB LRECL(80) RECFM(F B) BLKSIZE(3120)
ATTR UDUMPDCB LRECL(125) RECFM(V B A) BLKSIZE(1632)
ATTR EDITDCB LRECL(79) RECFM(F B A) BLKSIZE(4029)
/************************************************************/
/* Datasets used by TSO */
/************************************************************/
| ALLOC FI(SYSPROC) DA(’QMF910.SDSQCLTE’)
| ALLOC FI(SYSEXEC) DA(’QMF910.SDSQEXCE’)
/************************************************************/
/* QMF/GDDM Datasets */
/************************************************************/
| ALLOC FI(ADMGGMAP) DA(’QMF910.SDSQMAPE’) SHR REUSE
| ALLOC FI(ADMCFORM) DA(’QMF910.DSQCFORM’) SHR REUSE
| ALLOC FI(DSQUCFRM) DA(’QMF910.DSQUCFRM’) SHR REUSE
| ALLOC FI(ADMSYMBL) DA(’ADM.GDDMSYM’) SHR REUSE
ALLOC FI(ADMGDF) DA(’ADM.GDDM.CHARTLIB’) SHR REUSE
ALLOC FI(ADMDEFS) DA(’ADM.GDDM.NICKNAME’) SHR REUSE
/************************************************************/
/* Datasets used by QMF */
/************************************************************/
ALLOC FI(DSQPRINT) SYSOUT(X) USING(PRINTDCB)
ALLOC FI(DSQDEBUG) SYSOUT(X) USING(DEBUGDCB)
ALLOC FI(DSQUDUMP) SYSOUT(X) USING(UDUMPDCB)
ALLOC FI(DSQSPILL) NEW UNIT(SYSDA) SPACE(1,1) TRACKS
ALLOC FI(DSQEDIT) NEW UNIT(SYSDA) USING(EDITDCB)
| ALLOC FI(DSQPNLE) DA(’QMF910.DSQPNLE’) SHR REUSE
/************************************************************/
/* Start your program using TSO CALL command */
/************************************************************/
CALL sampleC
EXIT CODE(0)
Figure 56. CLIST for running your program in TSO without ISPF
PROC 0
CONTROL ASIS
/************************************************************/
/* Specify attribute list for dataset allocations */
/************************************************************/
ATTR PRINTDCB LRECL(133) RECFM(F B A) BLKSIZE(1330)
ATTR DEBUGDCB LRECL(80) RECFM(F B) BLKSIZE(3120)
ATTR UDUMPDCB LRECL(125) RECFM(V B A) BLKSIZE(1632)
ATTR EDITDCB LRECL(79) RECFM(F B A) BLKSIZE(4029)
/************************************************************/
/* Datasets used by TSO */
/************************************************************/
ALLOC FI(SYSPROC) DA(’QMF910.SDSQCLTE’,’ISR.ISRCLIB’)
ALLOC FI(SYSEXEC) DA(’QMF910.SDSQEXCE’)
/************************************************************/
/* Datasets used by ISPF */
/************************************************************/
ALLOC FI(ISPLLIB) SHR REUSE +
| DA(’QMF910.SDSQLOAD’,’ADM.GDDMLOAD’,’DSN.DSNEXIT’,’DSN.DSNLOAD’, +
’EDC.SEDCLINK’,’PLI.SIBMLINK’)
ALLOC FI(ISPMLIB) SHR REUSE +
| DA(’QMF910.SDSQMLBE’,’ISR.ISRMLIB’,’ISP.ISPMLIB’)
ALLOC FI(ISPPLIB) SHR REUSE +
| DA(’QMF910.SDSQPLBE’,’ISR.ISRPLIB’,’ISP.ISPPLIB’)
ALLOC FI(ISPSLIB) SHR REUSE +
| DA(’QMF910.SDSQSLBE’,’ISR.ISRSLIB’,’ISP.ISPSLIB’)
ALLOC FI(ISPTLIB) SHR REUSE +
DA(’ISR.ISRTLIB’,’ISP.ISPTLIB’)
/************************************************************/
/* QMF/GDDM Datasets */
/************************************************************/
| ALLOC FI(ADMGGMAP) DA(’QMF910.SDSQMAPE’) SHR REUSE
| ALLOC FI(ADMCFORM) DA(’QMF910.DSQCFORM’) SHR REUSE
| ALLOC FI(DSQUCFRM) DA(’QMF910.DSQUCFRM’) SHR REUSE
| ALLOC FI(ADMSYMBL) DA(’ADM.GDDMSYM’) SHR REUSE
ALLOC FI(ADMGDF) DA(’ADM.GDDM.CHARTLIB’) SHR REUSE
ALLOC FI(ADMDEFS) DA(’ADM.GDDM.NICKNAME’) SHR REUSE
/************************************************************/
/* Datasets used by QMF */
/************************************************************/
ALLOC FI(DSQPRINT) SYSOUT(X) USING(PRINTDCB)
ALLOC FI(DSQDEBUG) SYSOUT(X) USING(DEBUGDCB)
ALLOC FI(DSQUDUMP) SYSOUT(X) USING(UDUMPDCB)
ALLOC FI(DSQSPILL) NEW UNIT(SYSDA) SPACE(1,1) TRACKS
ALLOC FI(DSQEDIT) NEW UNIT(SYSDA) USING(EDITDCB)
| ALLOC FI(DSQPNLE) DA(’QMF910.DSQPNLE’) SHR REUSE
/************************************************************/
/* Start your program as the initial ISPF dialog */
/************************************************************/
ISPSTART PGM(sampleC) NEWAPPL(DSQE)
EXIT CODE(4)
DSQCIB
This call is for QMF commands that do not require access to application program
variables. Use this call for most QMF commands.
CALL DSQCIB USING DSQCOMM CMDLTH CMDSTR
You can change this statement to its call literal form as follows:
CALL "DSQCIB" USING ...
You can look at the sample source code here or you can access it online. The
sample program is a member of the library QMF910.SDSQSAPn (where n is a
national language identifier from Table 1 on page vii).
The sample program for the COBOL callable interface performs the following
functions:
v Starts QMF
v Sets three global variables
v Runs a query called Q1
v Prints the resulting report using form F1
v Ends the QMF session
QMF does not supply query Q1 or form F1, but the sample program uses these
objects.
****************************************************************
* The following is a VS COBOL II version of the query
* callable interface *** DSQABFCO **.
****************************************************************
IDENTIFICATION DIVISION.
PROGRAM-ID. DSQABFCO.
DATE-COMPILED.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
*************************
* Copy DSQCOMMB definition - contains query interface variables
*************************
COPY DSQCOMMB.
PROCEDURE DIVISION.
*
* Start a query interface session
MOVE DSQ-CURRENT-COMM-LEVEL TO DSQ-COMM-LEVEL.
MOVE 5 TO QICLTH.
MOVE 8 TO KLTHS(1).
MOVE 11 TO VLTHS(1).
MOVE 1 TO QIPNUM.
CALL DSQCIB USING DSQCOMM, QICLTH, STARTQI,
QIPNUM, QIKLTHS, SNAMES,
QIVLTHS, SVALUES, DSQ-VARIABLE-CHAR.
*
* Set numeric values into query variables using SET GLOBAL command
MOVE 10 TO QICLTH.
MOVE 7 TO KLTHS(1).
MOVE 5 TO KLTHS(2).
MOVE 7 TO KLTHS(3).
MOVE 4 TO VLTHS(1).
MOVE 4 TO VLTHS(2).
MOVE 4 TO VLTHS(3).
MOVE 20 TO VVALS(1).
MOVE 40 TO VVALS(2).
MOVE 84 TO VVALS(3).
MOVE 3 TO QIPNUM.
CALL DSQCIB USING DSQCOMM, QICLTH, SETG,
QIPNUM, QIKLTHS, VNAMES,
QIVLTHS, VVALUES, DSQ-VARIABLE-FINT.
*
* Run a Query
MOVE 12 TO QICLTH.
CALL DSQCIB USING DSQCOMM, QICLTH, QUERY.
*
* Print the results of the query
MOVE 22 TO QICLTH.
CALL DSQCIB USING DSQCOMM, QICLTH, REPT.
*
* End the query interface session
MOVE 4 TO QICLTH.
CALL DSQCIB USING DSQCOMM, QICLTH, ENDQI.
STOP RUN.
For CICS, the STOP RUN statement must be changed to a GOBACK statement.
************************************************************* 00001000
* COBOL INCLUDE FOR QUERY CALLABLE INTERFACE 00002000
************************************************************* 00003000
00004000
* STRUCTURE DECLARE FOR COMMUNICATIONS AREA 00005000
00006000
01 DSQCOMM. 00007000
00008000
03 DSQ-RETURN-CODE PIC 9(8) USAGE IS COMP. 00009000
* FUNCTION RETURN CODE * 00010000
03 DSQ-INSTANCE-ID PIC 9(8) USAGE IS COMP. 00011000
* IDENTIFIER FROM START CMD * 00012000
03 DSQ-COMM-LEVEL PIC X(12). 00013000
* COMMUNICATIONS LEVEL * 00014000
03 DSQ-PRODUCT PIC X(2). 00015000
* QUERY PRODUCT ID * 00016000
03 DSQ-PRODUCT-RELEASE PIC X(2). 00017000
* QUERY PRODUCT RELEASE * 00018000
03 DSQ-RESERVE1 PIC X(28). 00019000
* RESERVED AREA * 00020000
03 DSQ-MESSAGE-ID PIC X(8). 00021000
* COMPLETION MESSAGE ID * 00022000
03 DSQ-Q-MESSAGE-ID PIC X(8). 00023000
* QUERY MESSAGE ID * 00024000
03 DSQ-START-PARM-ERROR PIC X(8). 00025000
* START PARAMETER IN ERROR * 00026000
03 DSQ-CANCEL-IND PIC X(1). 00027000
* 1 = COMMAND CANCELLED * 00028000
* 0 = COMMAND NOT CANCELLED * 00029000
03 DSQ-RESERVE2 PIC X(23). 00030000
* RESERVED AREA * 00031000
03 DSQ-RESERVE3 PIC X(156). 00032000
* RESERVED AREA * 00033000
03 DSQ-MESSAGE-TEXT PIC X(128). 00034000
* QMF MESSAGE TEXT * 00035000
03 DSQ-Q-MESSAGE-TEXT PIC X(128). 00036000
* QMF QUERY MESSAGE TEXT * 00037000
* 512 BYTES TOTAL * 00038000
00039000
00040000
* VALUES FOR DSQ-RETURN-CODE 00041000
00042000
01 DSQ-SUCCESS PIC 9(8) USAGE IS COMP VALUE 0. 00043000
01 DSQ-WARNING PIC 9(8) USAGE IS COMP VALUE 4. 00044000
01 DSQ-FAILURE PIC 9(8) USAGE IS COMP VALUE 8. 00045000
01 DSQ-SEVERE PIC 9(8) USAGE IS COMP VALUE 16. 00046000
00047000
* VALUES FOR DSQ-INSTANCE-ID 00048000
00049000
01 DSQ-CONTINUE PIC 9(8) USAGE IS COMP VALUE 0. 00050000
00051000
* VALUES FOR DSQ-COMM-LEVEL 00052000
00053000
01 DSQ-CURRENT-COMM-LEVEL PIC X(12) VALUE "DSQL>001002<". 00054000
00055000
* VALUES FOR DSQ-PRODUCT 00056000
00057000
01 DSQ-QRW PIC X(2) VALUE "01". 00058000
01 DSQ-QMF PIC X(2) VALUE "02". 00059000
01 DSQ-QM4 PIC X(2) VALUE "03". 00060000
00061000
* VALUES FOR DSQ-PRODUCT-RELEASE 00062000
00063000
01 DSQ-QRW-V1R2 PIC X(2) VALUE "01". 00064000
01 DSQ-QRW-V1R3 PIC X(2) VALUE "02". 00065000
01 DSQ-QMF-V2R4 PIC X(2) VALUE "01". 00066000
01 DSQ-QMF-V3R1 PIC X(2) VALUE "02". 00067000
01 DSQ-QMF-V3R1M1 PIC X(2) VALUE "03". 00068000
01 DSQ-QMF-V3R2 PIC X(2) VALUE "04". 00069000
01 DSQ-QMF-V3R3 PIC X(2) VALUE "05". 00070000
01 DSQ-QMF-V6R1 PIC X(2) VALUE "06". 00071000
01 DSQ-QM4-V1R1 PIC X(2) VALUE "01". 00072000
00073000
* VALUES FOR DSQ-CANCEL-INDE 00074000
00075000
01 DSQ-CANCEL-YES PIC X(1) VALUE "1". 00076000
01 DSQ-CANCEL-NO PIC X(1) VALUE "0". 00077000
00078000
* VALUES FOR MODE 00079000
00080000
01 DSQ-INTERACTIVE PIC X(1) VALUE "1". 00081000
01 DSQ-BATCH PIC X(1) VALUE "2". 00082000
00083000
* VALUES YES AND NO 00084000
00085000
01 DSQ-YES PIC X(1) VALUE "1". 00086000
01 DSQ-NO PIC X(1) VALUE "2". 00087000
00088000
* CALLABLE INTERFACE PROGRAM NAME 00089000
00090000
01 DSQCIB PIC X(6) VALUE "DSQCIB". 00091000
00092000
* VALUES FOR VARIABLE TYPE ON CALL PARAMETER 00093000
00094000
01 DSQ-VARIABLE-CHAR PIC X(4) VALUE "CHAR". 00095000
01 DSQ-VARIABLE-FINT PIC X(4) VALUE "FINT". 00096000
translation process and the COBOL compiler by specifying QUOTE or APOST. Make
sure the APOST or QUOTE option in effect for the COBOL compiler matches that
of the CICS translator.
The communications area (DSQCOMMB) and the sample COBOL program
(DSQABFCO) as distributed by QMF use quotes to delimit literals. If your site or
program uses apostrophes instead of quotes, change DSQCOMMB or copy the
structure to your program, changing quotes to apostrophes.
v Availability of the communications area (DSQCOMMB)
The communications area DSQCOMMB must be available to the COBOL compile
step or copied into your program as a control structure.
v Availability of the interface module (DSQCIB)
The QMF interface module must be available during the link-edit step of your
program.
The JCL and CLISTs in these examples are not provided with QMF, but you can
copy them from here, altering them to suit your needs.
//samCOBOL JOB
// EXEC PROC=DFHEBTVL
//TRN.SYSIN DD *
*CBL XOPTS(CICS translator options ...QUOTE COBOL2)
.
Your program or copy of QMF sample DSQABFCO
.
/*
//* Provide Access to QMF Communications Macro DSQCOMMB
| //COB.SYSLIB DD DSN=QMF910.SDSQSAPE,DISP=SHR
//* Provide Access to QMF Interface Module
| //LKED.QMFLOAD DD DSN=QMF910.SDSQLOAD,DISP=SHR
//LKED.SYSIN DD *
INCLUDE CICSLOAD(DFHECI)
INCLUDE QMFLOAD(DSQCIB)
ORDER DFHECI
ENTRY samCOBOL
| MODE AMODE(31) RMODE(31)
NAME samCOBOL(R)
/*
Figure 60. JCL to run the CICS translator, COBOL compiler, and linkage editor
//samCOBOL JOB
//STEP1 EXEC PROC=IGYWCL
//* Provide Access to QMF Communications Macro DSQCOMM
| //COBOL.SYSLIB DD DSN=QMF910.SAMPLIB,DISP=SHR
//COBOL.SYSIN DD *
.
Your program or copy of QMF sample DSQABFCO
.
/*
//* Provide Access to QMF Interface Module
| //LKED.QMFLOAD DD DSN=QMF910.SDSQLOAD,DISP=SHR
//LKED.SYSIN DD *
INCLUDE QMFLOAD(DSQCIB)
ENTRY samCOBOL
| MODE AMODE(31) RMODE(31)
NAME samCOBOL(R)
/*
Figure 61. JCL to run the COBOL compiler and linkage editor
PROC 0
CONTROL ASIS
/************************************************************/
/* Note: QMF, DB2, GDDM and COBOL load libraries must be */
/* allocated before running this CLIST. */
| /* Name of QMF load library is "QMF910.SDSQLOAD". */
/************************************************************/
/* Specify attribute list for dataset allocations */
/************************************************************/
ATTR PRINTDCB LRECL(133) RECFM(F B A) BLKSIZE(1330)
ATTR DEBUGDCB LRECL(80) RECFM(F B) BLKSIZE(3120)
ATTR UDUMPDCB LRECL(125) RECFM(V B A) BLKSIZE(1632)
ATTR EDITDCB LRECL(79) RECFM(F B A) BLKSIZE(4029)
/************************************************************/
/* Datasets used by TSO */
/************************************************************/
| ALLOC FI(SYSPROC) DA(’QMF910.SDSQCLTE’)
| ALLOC FI(SYSEXEC) DA(’QMF910.SDSQEXCE’)
| /************************************************************/
/* QMF/GDDM Datasets */
/************************************************************/
| ALLOC FI(ADMGGMAP) DA(’QMF910.SDSQMAPE’) SHR REUSE
| ALLOC FI(ADMCFORM) DA(’QMF910.DSQCFORM’) SHR REUSE
| ALLOC FI(DSQUCFRM) DA(’QMF910.DSQUCFRM’) SHR REUSE
| ALLOC FI(ADMSYMBL) DA(’ADM.GDDMSYM’) SHR REUSE
ALLOC FI(ADMGDF) DA(’ADM.GDDM.CHARTLIB’) SHR REUSE
ALLOC FI(ADMDEFS) DA(’ADM.GDDM.NICKNAME’) SHR REUSE
/************************************************************/
/* Datasets used by QMF */
/************************************************************/
ALLOC FI(DSQPRINT) SYSOUT(X) USING(PRINTDCB)
ALLOC FI(DSQDEBUG) SYSOUT(X) USING(DEBUGDCB)
ALLOC FI(DSQUDUMP) SYSOUT(X) USING(UDUMPDCB)
ALLOC FI(DSQSPILL) NEW UNIT(SYSDA) SPACE(1,1) TRACKS
ALLOC FI(DSQEDIT) NEW UNIT(SYSDA) USING(EDITDCB)
| ALLOC FI(DSQPNLE) DA(’QMF910.DSQPNLE’) SHR REUSE
/************************************************************/
/* Start your program using TSO CALL command */
/************************************************************/
CALL samCOBOL
EXIT CODE(0)
Figure 62. JCL to run the COBOL compiler and linkage editor in TSO without ISPF
PROC 0
CONTROL ASIS
/************************************************************/
/* Specify attribute list for dataset allocations */
/************************************************************/
ATTR PRINTDCB LRECL(133) RECFM(F B A) BLKSIZE(1330)
ATTR DEBUGDCB LRECL(80) RECFM(F B) BLKSIZE(3120)
ATTR UDUMPDCB LRECL(125) RECFM(V B A) BLKSIZE(1632)
ATTR EDITDCB LRECL(79) RECFM(F B A) BLKSIZE(4029)
/************************************************************/
/* Datasets used by TSO */
/************************************************************/
| ALLOC FI(SYSPROC) DA(’QMF910.SDSQCLTE’,’ISR.ISRCLIB’)
| ALLOC FI(SYSEXEC) DA(’QMF910.SDSQEXCE’)
| /************************************************************/
/* Datasets used by ISPF */
/************************************************************/
ALLOC FI(ISPLLIB) SHR REUSE +
| DA(’QMF910.SDSQLOAD’,’ADM.GDDMLOAD’,’DSN.DSNEXIT’,’DSN.DSNLOAD’, +
’PRDUCT.COB2LIB’)
ALLOC FI(ISPMLIB) SHR REUSE +
| DA(’QMF910.SDSQMLBE’,’ISR.ISRMLIB’,’ISP.ISPMLIB’)
ALLOC FI(ISPPLIB) SHR REUSE +
| DA(’QMF910.SDSQPLBE’,’ISR.ISRPLIB’,’ISP.ISPPLIB’)
ALLOC FI(ISPSLIB) SHR REUSE +
| DA(’QMF910.SDSQSLBE’,’ISR.ISRSLIB’,’ISP.ISPSLIB’)
ALLOC FI(ISPTLIB) SHR REUSE +
DA(’ISR.ISRTLIB’,’ISP.ISPTLIB’)
/************************************************************/
/* QMF/GDDM Datasets */
/************************************************************/
| ALLOC FI(ADMGGMAP) DA(’QMF910.SDSQMAPE’) SHR REUSE
| ALLOC FI(ADMCFORM) DA(’QMF910.DSQCFORM’) SHR REUSE
| ALLOC FI(DSQUCFRM) DA(’QMF910.DSQUCFRM’) SHR REUSE
| ALLOC FI(ADMSYMBL) DA(’ADM.GDDMSYM’) SHR REUSE
ALLOC FI(ADMGDF) DA(’ADM.GDDM.CHARTLIB’) SHR REUSE
ALLOC FI(ADMDEFS) DA(’ADM.GDDM.NICKNAME’) SHR REUSE
/************************************************************/
/* Datasets used by QMF */
/************************************************************/
ALLOC FI(DSQPRINT) SYSOUT(X) USING(PRINTDCB)
ALLOC FI(DSQDEBUG) SYSOUT(X) USING(DEBUGDCB)
ALLOC FI(DSQUDUMP) SYSOUT(X) USING(UDUMPDCB)
ALLOC FI(DSQSPILL) NEW UNIT(SYSDA) SPACE(1,1) TRACKS
ALLOC FI(DSQEDIT) NEW UNIT(SYSDA) USING(EDITDCB)
| ALLOC FI(DSQPNLE) DA(’QMF910.DSQPNLE’) SHR REUSE
/************************************************************/
/* Start your program as the initial ISPF dialog */
/************************************************************/
ISPSTART PGM(samCOBOL) NEWAPPL(DSQE)
EXIT CODE(4)
Figure 63. CLIST for running your program in TSO under ISPF
The EXIT CODE(4) suppresses the display of the ISPF disposition panel.
DSQCIF
This call is for QMF commands that do not require access to application program
variables. Use this call for most QMF commands.
RC = DSQCIF(DSQCOMM,
+ CMDLTH,
+ CMDSTR)
DSQCIFE
This call has an extended syntax for the three commands that require access to
application program variables: START and the extended formats of GET GLOBAL
and SET GLOBAL.
PNUM
Number of command keywords; it is an integer parameter
KLTH
Length of each specified keyword; it is an integer parameter or parameter array
KWORD
QMF keyword or keywords; it is a character or array of characters whose
lengths are the same as specified by KLTH
You can use an array of characters if all of the keywords have the same length.
QMF assumes that the keywords are in contiguous storage and are not
separated by any special delimiters.
VLTH
Length of each value associated with the keyword; it is an integer parameter or
parameter array
VALUE
Value associated with each keyword
Its type is specified in the VTYPE parameter and can be a character, array of
characters, integer parameter, or parameter array. If you have character values,
QMF assumes that the values are in contiguous storage and are not separated
by any special delimiters.
VTYPE
Data type of the contents of the VALUE parameter. This is one of two data
types, which are provided in the communications area, DSQCOMMF:
v DSQ_VARIABLE_CHAR for character values
v DSQ_VARIABLE_FINT for integer values
All of the values specified in the VALUE field must have the data type specified
in VTYPE.
You can look at the sample source code listing here or you can access it online.
The sample program is a member of the library QMF910.SDSQSAPn (where n is a
national language identifier from Table 1 on page vii).
The sample program for the FORTRAN callable interface performs the following
functions:
v Starts QMF
v Sets three global variables
v Runs a query called Q1
v Prints the resulting report using form F1
v Ends the QMF session
QMF does not supply query Q1 or form F1, but the sample program uses these
objects.
C***********************************************************************
C Sample Program: dsqabff
C FORTRAN Version of Callable Interface
C
C Creation Date: 11/21/89
C
C ENVIRONMENT: API IN FORTRAN
C***********************************************************************
C
C Processing:
C a. Start a Query Manager Session using the Callable Interface.
C
C b. Set Global Query Manager numeric variables.
C
C d. Run a Query Manager query using the Callable Interface.
C
C e. Print a report using the Callable Interface.
C
C f. Exit the Query Manager Session.
C
C Prerequisites: 1. Create the SAMPLE database.
C
C 2. Create a prompted query, Q1, which has a SELECT state
C
C 3. Create a form, F1, that displays data for query Q1.
C
C***********************************************************************
PROGRAM DSQABFF
C***********************************************************************
C Include and declare query interface communications area
C***********************************************************************
INCLUDE (DSQCOMMF)
C**********************************************************************
C Query interface command lengths and commands
C**********************************************************************
INTEGER COMMAND_LENGTH
CHARACTER START_QUERY_INTERFACE*5,
+ SET_GLOBAL_VARIABLES*10,
+ RUN_QUERY*12,
+ PRINT_REPORT*22,
+ END_QUERY_INTERFACE*4
C**********************************************************************
C Query command extension, number of parameters and lengths
C**********************************************************************
INTEGER NUMBER_OF_PARAMETERS,
+ KEYWORD_LENGTHS(10),
+ DATA_LENGTHS(10)
C**********************************************************************
C Variable data type constants
C**********************************************************************
CHARACTER CHAR_DATA_TYPE*4,
+ INT_DATA_TYPE*4
C**********************************************************************
C Keyword parameter and value for START command
C**********************************************************************
CHARACTER*8 START_KEYWORDS(1)
CHARACTER*11 START_KEYWORD_VALUES(1)
C**********************************************************************
C Keyword parameter and values for SET command
C**********************************************************************
CHARACTER SET_KEYWORDS(19)
CHARACTER SET_KEYWORD_1*7,
+ SET_KEYWORD_2*5,
+ SET_KEYWORD_3*7
CHARACTER SET_VALUES(12)
INTEGER*4 SET_VALUE_1,
+ SET_VALUE_2,
+ SET_VALUE_3
C***********************************************************************
C Declare command length and return code variables
C***********************************************************************
INTEGER LEN,
+ RC
C***********************************************************************
C Initialization
C***********************************************************************
C**********************************************************
C Start Query Session
C**********************************************************
DSQ_COMM_LEVEL = DSQ_CURRENT_COMM_LEVEL
NUMBER_OF_PARAMETERS = 1
COMMAND_LENGTH = LEN(START_QUERY_INTERFACE)
KEYWORD_LENGTHS(1) = LEN(START_KEYWORDS(1))
DATA_LENGTHS(1) = LEN(START_KEYWORD_VALUES(1))
START_KEYWORDS(1) = ’DSQSMODE’
START_KEYWORD_VALUES(1) = ’INTERACTIVE’
RC = DSQCIFE(DSQCOMM,
+ COMMAND_LENGTH,
+ START_QUERY_INTERFACE,
+ NUMBER_OF_PARAMETERS,
+ KEYWORD_LENGTHS,
+ START_KEYWORDS,
+ DATA_LENGTHS,
+ START_KEYWORD_VALUES,
+ CHAR_DATA_TYPE)
C**********************************************************************
C Set numeric values into query using SET command
C**********************************************************************
NUMBER_OF_PARAMETERS = 3
COMMAND_LENGTH = LEN(SET_GLOBAL_VARIABLES)
SET_KEYWORD_1 = ’MYVAR01’
SET_KEYWORD_2 = ’SHORT’
SET_KEYWORD_3 = ’MYVAR03’
KEYWORD_LENGTHS(1) = LEN(SET_KEYWORD_1)
KEYWORD_LENGTHS(2) = LEN(SET_KEYWORD_2)
KEYWORD_LENGTHS(3) = LEN(SET_KEYWORD_3)
DATA_LENGTHS(1) = 4
DATA_LENGTHS(2) = 4
DATA_LENGTHS(3) = 4
SET_VALUE_1 = 20
SET_VALUE_2 = 40
SET_VALUE_3 = 84
RC = DSQCIFE(DSQCOMM,
+ COMMAND_LENGTH,
+ SET_GLOBAL_VARIABLES,
+ NUMBER_OF_PARAMETERS,
+ KEYWORD_LENGTHS,
+ SET_KEYWORDS,
+ DATA_LENGTHS,
+ SET_VALUES,
+ INT_DATA_TYPE)
C**********************************************************************
C Run a query
C**********************************************************************
COMMAND_LENGTH = LEN(RUN_QUERY)
RC = DSQCIF(DSQCOMM,
+ COMMAND_LENGTH,
+ RUN_QUERY)
C**********************************************************************
C Print the results of the query
C**********************************************************************
COMMAND_LENGTH = LEN(PRINT_REPORT)
RC = DSQCIF(DSQCOMM,
+ COMMAND_LENGTH,
+ PRINT_REPORT)
C**********************************************************************
C End the query interface session
C**********************************************************************
COMMAND_LENGTH = LEN(END_QUERY_INTERFACE)
RC = DSQCIF(DSQCOMM,
+ COMMAND_LENGTH,
+ END_QUERY_INTERFACE)
END
C********************************************************************** 00001000
C FORTRAN include file for Callable Interface 00002000
C********************************************************************** 00003000
C Return codes 00004000
INTEGER DSQ_SUCCESS, DSQ_WARNING, DSQ_FAILURE, DSQ_SEVERE 00005000
PARAMETER( 00006000
+ DSQ_SUCCESS = 0, 00007000
+ DSQ_WARNING = 4, 00008000
+ DSQ_FAILURE = 8, 00009000
+ DSQ_SEVERE = 16) 00010000
00011000
C Communications level 00012000
CHARACTER DSQ_CURRENT_COMM_LEVEL*12 00013000
PARAMETER( 00014000
+ DSQ_CURRENT_COMM_LEVEL = ’DSQL>001002<’) 00015000
00016000
C Query product IDs 00017000
CHARACTER DSQ_QRW*2, DSQ_QMF*2, DSQ_QM4*2 00018000
PARAMETER( 00019000
+ DSQ_QRW = ’01’, 00020000
+ DSQ_QMF = ’02’, 00021000
+ DSQ_QM4 = ’03’) 00022000
00023000
C Query product release levels 00024000
CHARACTER DSQ_QRW_V1R2*2, DSQ_QRW_V1R3*2, 00025000
+ DSQ_QMF_V2R4*2, DSQ_QMF_V3R1*2, 00026000
+ DSQ_QMF_V3R1M1*2, DSQ_QMF_V3R2*2, 00027000
+ DSQ_QMF_V3R3*2, DSQ_QMF_V6R1*2, 00028000
+ DSQ_QM4_V1R1*2 00029000
PARAMETER( 00030000
+ DSQ_QRW_V1R2 = ’01’, 00031000
+ DSQ_QRW_V1R3 = ’02’, 00032000
+ DSQ_QMF_V2R4 = ’01’, 00033000
+ DSQ_QMF_V3R1 = ’02’, 00034000
+ DSQ_QMF_V3R1M1 = ’03’, 00035000
+ DSQ_QMF_V3R2 = ’04’, 00036000
+ DSQ_QMF_V3R3 = ’05’, 00037000
+ DSQ_QMF_V6R1 = ’06’, 00038000
+ DSQ_QM4_V1R1 = ’01’) 00039000
00040000
C Host variable types 00041000
CHARACTER DSQ_VARIABLE_CHAR*4, DSQ_VARIABLE_FINT*4 00042000
PARAMETER( 00043000
+ DSQ_VARIABLE_CHAR = ’CHAR’, 00044000
+ DSQ_VARIABLE_FINT = ’FINT’) 00045000
00046000
C Cancel indicator 00047000
CHARACTER DSQ_CANCEL_YES, DSQ_CANCEL_NO 00048000
PARAMETER( 00049000
+ DSQ_CANCEL_YES = ’1’, 00050000
+ DSQ_CANCEL_NO = ’0’) 00051000
00052000
CHARACTER DSQCOMM(512) 00053000
The JCL and CLISTs in these examples are not provided with QMF, but you can
copy them from here, altering them to suit your needs.
//samFORT JOB
//STEP1 EXEC PROC=VSF2CL
//* Provide Access to QMF Communications Macro DSQCOMM
| //FORT.SYSLIB DD DSN=QMF910.SAMPLIB,DISP=SHR
//FORT.SYSIN DD *
.
Your program or copy of QMF sample DSQABFF
.
/*
//* Provide Access to QMF Interface Module
| //LKED.QMFLOAD DD DSN=QMF910.SDSQLOAD,DISP=SHR
//LKED.SYSIN DD *
INCLUDE QMFLOAD(DSQCIF)
INCLUDE QMFLOAD(DSQCIFE)
ENTRY samFORT
| MODE AMODE(31) RMODE(31)
NAME samFORT(R)
/*
Figure 66. JCL for running the FORTRAN compiler and linkage editor
PROC 0
CONTROL ASIS
/************************************************************/
/* Note: QMF, DB2, GDDM and FORTRAN load libraries must be */
/* allocated before running this CLIST. */
| /* Name of QMF load library is "QMF910.SDSQLOAD". */
/************************************************************/
/* Specify attribute list for dataset allocations */
/************************************************************/
ATTR PRINTDCB LRECL(133) RECFM(F B A) BLKSIZE(1330)
ATTR DEBUGDCB LRECL(80) RECFM(F B) BLKSIZE(3120)
ATTR UDUMPDCB LRECL(125) RECFM(V B A) BLKSIZE(1632)
ATTR EDITDCB LRECL(79) RECFM(F B A) BLKSIZE(4029)
/************************************************************/
/* Datasets used by TSO */
/************************************************************/
| ALLOC FI(SYSPROC) DA(’QMF910.SDSQCLTE’)
| ALLOC FI(SYSEXEC) DA(’QMF910.SDSQEXCE’)
| /************************************************************/
/* QMF/GDDM Datasets */
/************************************************************/
| ALLOC FI(ADMGGMAP) DA(’QMF910.SDSQMAPE’) SHR REUSE
| ALLOC FI(ADMCFORM) DA(’QMF910.DSQCFORM’) SHR REUSE
| ALLOC FI(DSQUCFRM) DA(’QMF910.DSQUCFRM’) SHR REUSE
ALLOC FI(ADMSYMBL) DA(’ADM.GDDMSYM’) SHR REUSE
ALLOC FI(ADMGDF) DA(’ADM.GDDM.CHARTLIB’) SHR REUSE
ALLOC FI(ADMDEFS) DA(’ADM.GDDM.NICKNAME’) SHR REUSE
/************************************************************/
/* Datasets used by QMF */
/************************************************************/
ALLOC FI(DSQPRINT) SYSOUT(X) USING(PRINTDCB)
ALLOC FI(DSQDEBUG) SYSOUT(X) USING(DEBUGDCB)
ALLOC FI(DSQUDUMP) SYSOUT(X) USING(UDUMPDCB)
ALLOC FI(DSQSPILL) NEW UNIT(SYSDA) SPACE(1,1) TRACKS
ALLOC FI(DSQEDIT) NEW UNIT(SYSDA) USING(EDITDCB)
| ALLOC FI(DSQPNLE) DA(’QMF910.DSQPNLE’) SHR REUSE
/************************************************************/
/* Start your program using TSO CALL command */
/************************************************************/
CALL samFORT
EXIT CODE(0)
Figure 67. CLIST for running your program in TSO without ISPF
PROC 0
CONTROL ASIS
/************************************************************/
/* Specify attribute list for dataset allocations */
/************************************************************/
ATTR PRINTDCB LRECL(133) RECFM(F B A) BLKSIZE(1330)
ATTR DEBUGDCB LRECL(80) RECFM(F B) BLKSIZE(3120)
ATTR UDUMPDCB LRECL(125) RECFM(V B A) BLKSIZE(1632)
ATTR EDITDCB LRECL(79) RECFM(F B A) BLKSIZE(4029)
/************************************************************/
/* Datasets used by TSO */
/************************************************************/
| ALLOC FI(SYSPROC) DA(’QMF910.SDSQCLTE’,’ISR.ISRCLIB’)
| ALLOC FI(SYSEXEC) DA(’QMF910.SDSQEXCE’)
| /************************************************************/
/* Datasets used by ISPF */
/************************************************************/
ALLOC FI(ISPLLIB) SHR REUSE +
| DA(’QMF910.SDSQLOAD’,’ADM.GDDMLOAD’,’DSN.DSNEXIT’,’DSN.DSNLOAD’, +
’PRDUCT.VSF2LOAD’)
ALLOC FI(ISPMLIB) SHR REUSE +
| DA(’QMF910.SDSQMLBE’,’ISR.ISRMLIB’,’ISP.ISPMLIB’)
ALLOC FI(ISPPLIB) SHR REUSE +
| DA(’QMF910.SDSQPLBE’,’ISR.ISRPLIB’,’ISP.ISPPLIB’)
ALLOC FI(ISPSLIB) SHR REUSE +
| DA(’QMF910.SDSQSLBE’,’ISR.ISRSLIB’,’ISP.ISPSLIB’)
ALLOC FI(ISPTLIB) SHR REUSE +
DA(’ISR.ISRTLIB’,’ISP.ISPTLIB’)
/************************************************************/
/* QMF/GDDM Datasets */
/************************************************************/
| ALLOC FI(ADMGGMAP) DA(’QMF910.SDSQMAPE’) SHR REUSE
| ALLOC FI(ADMCFORM) DA(’QMF910.DSQCFORM’) SHR REUSE
| ALLOC FI(DSQUCFRM) DA(’QMF910.DSQUCFRM’) SHR REUSE
| ALLOC FI(ADMSYMBL) DA(’ADM.GDDMSYM’) SHR REUSE
ALLOC FI(ADMGDF) DA(’ADM.GDDM.CHARTLIB’) SHR REUSE
ALLOC FI(ADMDEFS) DA(’ADM.GDDM.NICKNAME’) SHR REUSE
/************************************************************/
/* Datasets used by QMF */
/************************************************************/
ALLOC FI(DSQPRINT) SYSOUT(X) USING(PRINTDCB)
ALLOC FI(DSQDEBUG) SYSOUT(X) USING(DEBUGDCB)
ALLOC FI(DSQUDUMP) SYSOUT(X) USING(UDUMPDCB)
ALLOC FI(DSQSPILL) NEW UNIT(SYSDA) SPACE(1,1) TRACKS
ALLOC FI(DSQEDIT) NEW UNIT(SYSDA) USING(EDITDCB)
| ALLOC FI(DSQPNLE) DA(’QMF910.DSQPNLE’) SHR REUSE
/************************************************************/
/* Start your program as the initial ISPF dialog */
/************************************************************/
ISPSTART PGM(samFORT) NEWAPPL(DSQE)
EXIT CODE(4)
Figure 68. CLIST for running your program in TSO under ISPF
The EXIT CODE(4) suppresses the showing of the ISPF disposition panel.
DSQCIPL syntax
This call is for QMF commands that do not require access to application program
variables. Use this call for most QMF commands.
CALL DSQCIPL(DSQCOMM,
CMDLTH,
CMDSTR)
DSQCIPX syntax
This call is for the three commands that require access to application program
variables: START and the extended formats of GET GLOBAL and SET GLOBAL.
You can use an array of characters if all of the keywords have the same length.
QMF assumes that the keywords are in contiguous storage and are not
separated by any special separator characters.
VLTH
Length of each value associated with the keyword; it is an integer FIXED
BIN(31) parameter or parameter array
VALUE
Value associated with each keyword
Its type is specified in the VTYPE parameter and can be a character, array of
characters, integer FIXED BIN(31) parameter, or parameter array. If you have
character values, QMF assumes that the values are in contiguous storage and
are not separated by any special delimiters.
VTYPE
Data type of the contents of the VALUE parameter. This is one of two data
types, which are provided in the DSQCOMML communications area:
v DSQ_VARIABLE_CHAR for character values
v DSQ_VARIABLE_FINT for integer FIXED BIN(31) values
All of the values specified in the VALUE field must have the data type specified
in VTYPE.
You can look at the sample source code here or you can access it online. The
sample program is a member of the library QMF910.SDSQSAPn (where n is a
national language identifier from Table 1 on page vii).
The sample program for the PL/I callable interface performs the following functions:
v Starts QMF
v Sets three global variables
v Runs a query called Q1
v Prints the resulting report using form F1
v Ends the QMF session
QMF does not supply query Q1 or form F1, but the sample program uses these
objects.
/********************************************************************/ 00053000
/* Main program */ 00054000
/********************************************************************/ 00055000
DSQCOMM = ’’; 00056000
DSQ_COMM_LEVEL = DSQ_CURRENT_COMM_LEVEL; 00057000
00058000
/********************************************************************/ 00059000
/* Start a query interface session */ 00060000
/********************************************************************/ 00061000
NUMBER_OF_PARAMETERS = 1; 00062000
COMMAND_LENGTH = LENGTH(START_QUERY_INTERFACE); 00063000
KEYWORD_LENGTHS(1) = LENGTH(START_KEYWORDS); 00064000
DATA_LENGTHS(1) = LENGTH(START_KEYWORD_VALUES); 00065000
00066000
CALL DSQCIPX(DSQCOMM, 00067000
COMMAND_LENGTH, 00068000
START_QUERY_INTERFACE, 00069000
NUMBER_OF_PARAMETERS, 00070000
KEYWORD_LENGTHS, 00071000
START_KEYWORDS, 00072000
DATA_LENGTHS, 00073000
START_KEYWORD_VALUES, 00074000
DSQ_VARIABLE_CHAR); 00075000
00076000
/********************************************************************/ 00077000
/* Set numeric values into query using SET command */ 00078000
/********************************************************************/ 00079000
NUMBER_OF_PARAMETERS = 3; 00080000
COMMAND_LENGTH = LENGTH(SET_GLOBAL_VARIABLES); 00081000
KEYWORD_LENGTHS(1) = LENGTH(SET_KEYWORDS_1); 00082000
KEYWORD_LENGTHS(2) = LENGTH(SET_KEYWORDS_2); 00083000
KEYWORD_LENGTHS(3) = LENGTH(SET_KEYWORDS_3); 00084000
DATA_LENGTHS(1) = 4; 00085000
DATA_LENGTHS(2) = 4; 00086000
DATA_LENGTHS(3) = 4; 00087000
SET_VALUES_1 = 20; 00088000
SET_VALUES_2 = 40; 00089000
SET_VALUES_3 = 84; 00090000
00091000
CALL DSQCIPX(DSQCOMM, 00092000
COMMAND_LENGTH, 00093000
SET_GLOBAL_VARIABLES, 00094000
NUMBER_OF_PARAMETERS, 00095000
KEYWORD_LENGTHS, 00096000
SET_KEYWORDS, 00097000
DATA_LENGTHS, 00098000
SET_VALUES, 00099000
DSQ_VARIABLE_FINT); 00100000
00101000
/********************************************************************/ 00102000
/* Run a Query */ 00103000
/********************************************************************/ 00104000
COMMAND_LENGTH = LENGTH(RUN_QUERY); 00105000
00106000
CALL DSQCIPL(DSQCOMM, 00107000
COMMAND_LENGTH, 00108000
RUN_QUERY); 00109000
00110000
/********************************************************************/ 00111000
/* Print the results of the query */ 00112000
/********************************************************************/ 00113000
COMMAND_LENGTH = LENGTH(PRINT_REPORT); 00114000
00115000
CALL DSQCIPL(DSQCOMM, 00116000
COMMAND_LENGTH, 00117000
PRINT_REPORT); 00118000
00119000
/********************************************************************/ 00120000
/* End the query interface session */ 00121000
/********************************************************************/ 00122000
COMMAND_LENGTH = LENGTH(END_QUERY_INTERFACE); 00123000
00124000
CALL DSQCIPL(DSQCOMM, 00125000
COMMAND_LENGTH, 00126000
END_QUERY_INTERFACE); 00127000
00128000
END DSQABFP; 00129000
/********************************************************************/ 00001000
/* PL/I include for Query Callable Interface */ 00002000
/********************************************************************/ 00003000
00004000
/* Structure declare for Communications Area */ 00005000
DCL 00006000
1 DSQCOMM, 00007000
3 DSQ_RETURN_CODE FIXED BIN(31), /* function return code */ 00008000
3 DSQ_INSTANCE_ID FIXED BIN(31), /* start ID */ 00009000
3 DSQ_COMM_LEVEL CHAR(12), /* communications level */ 00010000
3 DSQ_PRODUCT CHAR(2), /* query product id */ 00011000
3 DSQ_PRODUCT_RELEASE CHAR(2), /* query product release */ 00012000
3 DSQ_RESERVE1 CHAR(28), /* reserved */ 00013000
3 DSQ_MESSAGE_ID CHAR(8), /* completion message ID */ 00014000
3 DSQ_Q_MESSAGE_ID CHAR(8), /* query message ID */ 00015000
3 DSQ_START_PARM_ERROR CHAR(8), /* start parms in error */ 00016000
3 DSQ_CANCEL_IND CHAR(1), /* cmd cancel indicator */ 00017000
/* 1 = cancelled, 0 = not cancelled*/ 00018000
3 DSQ_RESERVE2 CHAR(23), /* reserved */ 00019000
3 DSQ_RESERVE3 CHAR(156), /* reserved */ 00020000
3 DSQ_MESSAGE_TEXT CHAR(128), /* QMF command message */ 00021000
3 DSQ_Q_MESSAGE_TEXT CHAR(128); /* QMF query message */ 00022000
00023000
/* Return Codes */ 00024000
DCL 00025000
DSQ_SUCCESS FIXED BIN(31) INIT(0) STATIC, 00026000
DSQ_WARNING FIXED BIN(31) INIT(4) STATIC, 00027000
DSQ_FAILURE FIXED BIN(31) INIT(8) STATIC, 00028000
DSQ_SEVERE FIXED BIN(31) INIT(16) STATIC; 00029000
00030000
/* Communications Level */ 00031000
DCL 00032000
DSQ_CURRENT_COMM_LEVEL CHAR(12) INIT(’DSQL>001002<’) STATIC; 00033000
00034000
/* Query Product ID */ 00035000
DCL 00036000
DSQ_QRW CHAR(2) INIT(’01’) STATIC, 00037000
DSQ_QMF CHAR(2) INIT(’02’) STATIC, 00038000
DSQ_QM4 CHAR(2) INIT(’03’) STATIC; 00039000
00040000
The JCL and CLISTs in these examples are not provided with QMF, but you can
copy them from here, altering them to suit your needs.
When you translate, compile, and link-edit a program that uses the QMF callable
interface, consider the following:
v The communications area (DSQCOMML) must be available in the compile step
or copied into your program.
v The QMF interface modules DSQCIPL and DSQCIPX must be available during
the link-edit step of your program.
//samPLI JOB
// EXEC PROC=DFHEBTPL
//TRN.SYSIN DD *
*PROCESS XOPTS(CICS translator options .....)
.
Your program or copy of QMF sample DSQABFP
.
/*
//* Provide Access to QMF Communications Macro DSQCOMML
| //PLI.SYSLIB DD DSN=QMF910.SDSQSAPE,DISP=SHR
//* Provide Access to QMF Interface Module
| //LKED.QMFLOAD DD DSN=QMF910.SDSQLOAD,DISP=SHR
//LKED.SYSIN DD *
INCLUDE CICSLOAD(DFHPL1OI)
INCLUDE CICSLOAD(DFHEPI)
INCLUDE QMFLOAD(DSQCIPL)
INCLUDE QMFLOAD(DSQCIPX)
ORDER DFHPL1OI,DFHEPI
ENTRY sampPLI
| MODE AMODE(31) RMODE(31)
NAME sampPLI(R)
/*
Figure 71. JCL for running the CICS translator, PL/I compiler, and linkage editor
//samPLI JOB
//STEP1 EXEC IEL1CL
//* Provide Access to QMF Communications Macro DSQCOMML
| //PLI.SYSLIB DD DSN=QMF910.SAMPLIB,DISP=SHR
//PLI.SYSIN DD *
.
Your program or copy of QMF sample DSQABFP
.
/*
//* Provide Access to QMF Interface Module
| //LKED.QMFLOAD DD DSN=QMF910.SDSQLOAD,DISP=SHR
//LKED.SYSIN DD *
INCLUDE QMFLOAD(DSQCIPL)
INCLUDE QMFLOAD(DSQCIPX)
ENTRY sampPLI
| MODE AMODE(31) RMODE(31)
NAME sampPLI(R)
/*
Figure 72. JCL to run the PL/I compiler and linkage editor
PROC 0
CONTROL ASIS
/************************************************************/
/* Note: QMF, DB2, GDDM and PL/I load libraries must be */
/* allocated before running this CLIST. */
| /* Name of QMF load library is "QMF910.SDSQLOAD". */
/************************************************************/
/* Specify attribute list for dataset allocations */
/************************************************************/
ATTR PRINTDCB LRECL(133) RECFM(F B A) BLKSIZE(1330)
ATTR DEBUGDCB LRECL(80) RECFM(F B) BLKSIZE(3120)
ATTR UDUMPDCB LRECL(125) RECFM(V B A) BLKSIZE(1632)
ATTR EDITDCB LRECL(79) RECFM(F B A) BLKSIZE(4029)
/************************************************************/
/* Datasets used by TSO */
/************************************************************/
| ALLOC FI(SYSPROC) DA(’QMF910.SDSQCLTE’)
| ALLOC FI(SYSEXEC) DA(’QMF910.SDSQEXCE’)
| /************************************************************/
/* QMF/GDDM Datasets */
/************************************************************/
| ALLOC FI(ADMGGMAP) DA(’QMF910.SDSQMAPE’) SHR REUSE
| ALLOC FI(ADMCFORM) DA(’QMF910.DSQCFORM’) SHR REUSE
| ALLOC FI(DSQUCFRM) DA(’QMF910.DSQUCFRM’) SHR REUSE
| ALLOC FI(ADMSYMBL) DA(’ADM.GDDMSYM’) SHR REUSE
ALLOC FI(ADMGDF) DA(’ADM.GDDM.CHARTLIB’) SHR REUSE
ALLOC FI(ADMDEFS) DA(’ADM.GDDM.NICKNAME’) SHR REUSE
/************************************************************/
/* Datasets used by QMF */
/************************************************************/
ALLOC FI(DSQPRINT) SYSOUT(X) USING(PRINTDCB)
ALLOC FI(DSQDEBUG) SYSOUT(X) USING(DEBUGDCB)
ALLOC FI(DSQUDUMP) SYSOUT(X) USING(UDUMPDCB)
ALLOC FI(DSQSPILL) NEW UNIT(SYSDA) SPACE(1,1) TRACKS
ALLOC FI(DSQEDIT) NEW UNIT(SYSDA) USING(EDITDCB)
| ALLOC FI(DSQPNLE) DA(’QMF910.DSQPNLE’) SHR REUSE
/************************************************************/
/* Start your program using TSO CALL command */
/************************************************************/
CALL sampPLI
EXIT CODE(0)
PROC 0
CONTROL ASIS
/************************************************************/
/* Specify attribute list for dataset allocations */
/************************************************************/
ATTR PRINTDCB LRECL(133) RECFM(F B A) BLKSIZE(1330)
ATTR DEBUGDCB LRECL(80) RECFM(F B) BLKSIZE(3120)
ATTR UDUMPDCB LRECL(125) RECFM(V B A) BLKSIZE(1632)
ATTR EDITDCB LRECL(79) RECFM(F B A) BLKSIZE(4029)
/************************************************************/
/* Datasets used by TSO */
/************************************************************/
| ALLOC FI(SYSPROC) DA(’QMF910.SDSQCLTE’,’ISR.ISRCLIB’)
| ALLOC FI(SYSEXEC) DA(’QMF910.SDSQEXCE’)
| /************************************************************/
/* Datasets used by ISPF */
/************************************************************/
ALLOC FI(ISPLLIB) SHR REUSE +
| DA(’QMF910.SDSQLOAD’,’ADM.GDDMLOAD’,’DSN.DSNEXIT’,’DSN.DSNLOAD’, +
’PLI.PLILINK’,’PLI.SIBMLINK’)
ALLOC FI(ISPMLIB) SHR REUSE +
| DA(’QMF910.SDSQMLBE’,’ISR.ISRMLIB’,’ISP.ISPMLIB’)
ALLOC FI(ISPPLIB) SHR REUSE +
| DA(’QMF910.SDSQPLBE’,’ISR.ISRPLIB’,’ISP.ISPPLIB’)
ALLOC FI(ISPSLIB) SHR REUSE +
| DA(’QMF910.SDSQSLBE’,’ISR.ISRSLIB’,’ISP.ISPSLIB’)
ALLOC FI(ISPTLIB) SHR REUSE +
DA(’ISR.ISRTLIB’,’ISP.ISPTLIB’)
/************************************************************/
/* QMF/GDDM Datasets */
/************************************************************/
| ALLOC FI(ADMGGMAP) DA(’QMF910.SDSQMAPE’) SHR REUSE
| ALLOC FI(ADMCFORM) DA(’QMF910.DSQCFORM’) SHR REUSE
| ALLOC FI(DSQUCFRM) DA(’QMF910.DSQUCFRM’) SHR REUSE
| ALLOC FI(ADMSYMBL) DA(’ADM.GDDMSYM’) SHR REUSE
ALLOC FI(ADMGDF) DA(’ADM.GDDM.CHARTLIB’) SHR REUSE
ALLOC FI(ADMDEFS) DA(’ADM.GDDM.NICKNAME’) SHR REUSE
/************************************************************/
/* Datasets used by QMF */
/************************************************************/
ALLOC FI(DSQPRINT) SYSOUT(X) USING(PRINTDCB)
ALLOC FI(DSQDEBUG) SYSOUT(X) USING(DEBUGDCB)
ALLOC FI(DSQUDUMP) SYSOUT(X) USING(UDUMPDCB)
ALLOC FI(DSQSPILL) NEW UNIT(SYSDA) SPACE(1,1) TRACKS
ALLOC FI(DSQEDIT) NEW UNIT(SYSDA) USING(EDITDCB)
| ALLOC FI(DSQPNLE) DA(’QMF910.DSQPNLE’) SHR REUSE
/************************************************************/
/* Start your program as the initial ISPF dialog */
/************************************************************/
ISPSTART PGM(sampPLI) NEWAPPL(DSQE)
EXIT CODE(4)
Figure 74. CLIST for running your program in TSO under ISPF
Under TSO, you can reduce the resources required to use REXX services when
you use procedures with logic and certain QMF form functions (calculations, defined
columns, and conditions) by invoking QMF using the REXX callable interface.
For example, fewer resources are required to perform PRINT REPORT or BOTTOM
on the REPORT panel if the QMF session is initiated using the REXX callable
interface. The reduction of resource consumption can be substantial and is most
noticeable when running QMF under TSO.
( parmname = value
)
The entire command, including the parmlist, should be passed to QMF as a single
REXX variable written as a character string. This string must be enclosed in
quotation marks (' ') or (" "). When using REXX variables as part of the command
string, don’t enclose the argument. For example:
CALL DSQCIX "RUN QUERY NAME (&ECN="REXAUG",CONFIRM=YES)"
parmname
Name of a parameter
value
Value that is to be associated with the parameter name specified by parmname
In the parmlist, the same results occur whether the following elements are present
or not:
v Comma (,) between parameters (a space produces the same result).
v Closing parenthesis (which is not required).
v Equal sign (=) between parmname and value (a space produces the same
result).
You can look at the sample source code listing here or you can access it online.
The sample program is a member of the library QMF910.SDSQEXCE.
The sample program for the REXX callable interface performs the following
functions:
v Starts QMF
v Sets three global variables
v Runs a query called Q1
v Prints the resulting report using form F1
v Ends the QMF session
QMF does not supply query Q1 or form F1, but the sample program uses these
objects.
/*REXX***************************************************************/
/* Sample Program: DSQABFX */
/* REXX Version of the QMF Callable Interface */
/********************************************************************/
/********************************************************************/
/* Start a query interface session */
/********************************************************************/
/********************************************************************/
/* Set numeric values into query using SET command */
/********************************************************************/
/********************************************************************/
/* Run a Query */
/********************************************************************/
/********************************************************************/
/* Print the results of the query */
/********************************************************************/
/********************************************************************/
/* End the query interface session */
/********************************************************************/
/*****************************************************************/
/* Issue TSO Allocates for QMF Product */
/*****************************************************************/
Address TSO
By adding the logic shown in Figure 77 on page 194 to your program, you can
make the END command in an interactive session (started by the INTERACT
command from a callable interface program) behave similarly to the way END
behaves in interactive QMF.
exit dsq_return_code
Warning: Do not use any QMF macros as programming interfaces other than those
identified in this topic.
Table 48. Macros that provide interfaces to QMF functions
Purpose Macro names
Product interface macro DSQQMFn
Callable interface users can use global variable names that are 18 characters or
less. Command interface users must use names that are 8 characters or less.
3 for STRING
Table 50. Global variables for state information not related to the profile (continued)
Callable interface variable Command interface variable
name name Length Description
DSQAO_DBCS DSQADBCS 01 DBCS support status; values can be:
1 for DBCS support
2 for no DBCS support
DSQAO_FORM_PANEL DSQASUBP 02 Current form panel; values can be:
1 for FORM.MAIN
2 for FORM.COLUMNS
3 for FORM.PAGE
4 for FORM.FINAL
5 for FORM.BREAK1
6 for FORM.BREAK2
7 for FORM.BREAK3
8 for FORM.BREAK4
9 for FORM.BREAK5
10 for FORM.BREAK6
11 for FORM.OPTIONS
12 for FORM.CALC
13 for FORM.DETAIL
14 for FORM.CONDITIONS
Table 50. Global variables for state information not related to the profile (continued)
Callable interface variable Command interface variable
name name Length Description
DSQAO_OBJ_OWNER DSQAITMO 128 The owner of the table (contained in a report),
query, procedure, or form shown on the
currently displayed panel.
A for GLOBALS
| DSQAO_QMF_RELEASE DSQAREVN 02 Numeric release number of QMF, which
| appears in header records for exported forms,
| reports, and prompted queries; for QMF Version
| 9.1, this is '15'.
| DSQAO_QMF_VER_RLS DSQAQMF 10 Version and release of QMF. For QMF Version
| 9.1, this is 'QMF V9R1.0'.
DSQAO_QMFADM None 01 QMF administrator authority:
0 Current authorization ID does not
have QMF administrator authority.
1 Current authorization ID has
administrator authority.
DSQAO_QRY_SUBTYPE DSQASUBI 01 Query subtype. Values can be:
1 for a subtype of SQL
2 for a subtype of QBE
3 for a subtype of PROMPTED
Table 50. Global variables for state information not related to the profile (continued)
Callable interface variable Command interface variable
name name Length Description
DSQAO_SUBSYS_ID none 04 If QMF is running in TSO, this is the ID of the
local DB2 subsystem to which QMF is attached.
5 CICS
DSQAO_TERMINATE DSQCSESC 01 QMF termination flag; values can be:
0 if the session was not marked for
termination
1 if the session was marked for
termination
DSQAO_VARIATION DSQAVARN 02 Form panel variation number; blank means
FORM.DETAIL is not the current panel.
When the queue type is transient data (TD), the maximum length of the
corresponding queue name is 4. For example, if DSQAO_CICS_SQTYPE is TD, the
maximum length of DSQAO_CICS_SQNAME is 4.
Table 51. Global variables associated with the CICS environment
Callable interface variable Command interface variable
name name Length Description
DSQAP_CICS_PQNAME none 08 Names the CICS data queue to contain the
QMF print output.
DSQAP_CICS_PQTYPE none 02 Type of CICS storage used to contain the QMF
print output:
TS Writes the QMF print to a CICS
temporary storage queue on an
auxiliary storage device. This is the
default.
TD Writes the QMF print to a CICS
transient data queue.
DSQAO_CICS_SQNAME none 08 Names the CICS data queue to be used as the
spill file.
Table 51. Global variables associated with the CICS environment (continued)
Callable interface variable Command interface variable
name name Length Description
DSQAO_CICS_SQTYPE none 02 Type of CICS storage used to contain the QMF
spill file:
TS Writes the QMF spill data to a CICS
temporary storage queue on an
auxiliary storage device. This is the
default.
TD Writes the QMF spill data to a CICS
transient data queue.
DSQAO_CICS_TQNAME none 08 Names the CICS data queue to contain the
QMF trace data.
DSQAO_CICS_TQTYPE none 02 Type of CICS storage used to contain the QMF
trace data:
TS Writes the QMF trace to a CICS
temporary storage queue on an
auxiliary storage device.
TD Writes the QMF trace to a CICS
transient data queue. This is the
default.
If the CONFIRM option of the EDIT TABLE command is NO, the Table Editor
suppresses the display of all confirmation panels. If the CONFIRM option is YES,
the Table Editor determines which categories of confirmation are enabled by
checking the values of the global variables shown in this table.
The Table Editor defaults depend on the SAVE keyword from the EDIT TABLE
command:
1 Panel is enabled.
2 Panel is enabled or disabled
depending on the Table Editor
defaults; this is the default.
DSQCP_TEEND none 01 Displays a confirmation panel when you issue
an END subcommand or a CANCEL
subcommand to terminate a Table Editor
subsession.
1 Panel is enabled.
2 Panel is enabled or disabled
depending on the Table Editor
defaults; this is the default.
DSQCP_TEDEL none 01 Displays a confirmation panel after a DELETE
subcommand; values can be:
0 Panel is disabled.
1 Panel is enabled.
2 Panel is enabled or disabled
depending on the Table Editor
defaults; this is the default.
DSQCP_TEDFLT none 01 The reserved character used to indicate the
default value for a column in the Table Editor;
initially set to a plus sign (+) character.
Table 53. Global variables associated with the Table Editor (continued)
Callable interface variable Command interface variable
name name Length Description
DSQCP_TEDFLT_DBCS none 04 The reserved DBCS character used to indicate
the default value for a graphic string column in
the Table Editor.
Table 54. Global variables that control the display of certain types of information (continued)
Command interface variable
Callable interface variable name name Length Description
DSQDC_CURRENCY none 18 The currency symbol used when the DC edit
code is specified.
Table 54. Global variables that control the display of certain types of information (continued)
Command interface variable
Callable interface variable name name Length Description
DSQDC_LIST_ORDER none 02 Sets the default sort order for objects in a list
of database objects; values for the first
character can be:
1 The list will use the default order.
2 The list will be sorted by object
owner.
Table 55. Global variables that control how commands and procedures are executed (continued)
Callable interface variable Command interface variable
name name Length Description
| DSQEC_DSALLOC_PRI None 8 QMF allocates data sets in tracks. This global
| variable specifies the primary quantity of tracks
| for the TSO data set that will be used to store
| the results of the QMF EXPORT command.
Table 55. Global variables that control how commands and procedures are executed (continued)
Callable interface variable Command interface variable
name name Length Description
| DSQEC_PO None 1 Specifies the type of partitioned (PO) data set
| to create when exporting a QMF object to a
| new TSO data set. Values can be the
| following:
| 0 Allocates a data set of the type listed
| as the default for your site. This type
| is specified in the IGDSMSxx
| member of the SYS1.PARMLIB. This
| is the default value.
IBM may have patents or pending patent applications covering subject matter
described in this document. The furnishing of this document does not give you any
license to these patents. You can send license inquiries, in writing, to:
IBM Director of Licensing
IBM Corporation
North Castle Drive
Armonk, NY 10504-1785
U.S.A.
For license inquiries regarding double-byte (DBCS) information, contact the IBM
Intellectual Property Department in your country or send inquiries, in writing, to:
IBM World Trade Asia Corporation
Licensing
2-31 Roppongi 3-chome, Minato-ku
Tokyo 106-0032, Japan
The following paragraph does not apply to the United Kingdom or any other
country where such provisions are inconsistent with local law:
INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS
PUBLICATION “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE. Some states do not allow disclaimer of express or
implied warranties in certain transactions, therefore, this statement may not apply to
you.
IBM may use or distribute any of the information you supply in any way it believes
appropriate without incurring any obligation to you.
Licensees of this program who wish to have information about it for the purpose of
enabling: (i) the exchange of information between independently created programs
and other programs (including this one) and (ii) the mutual use of the information
which has been exchanged, should contact:
IBM Corporation
J46A/G4
555 Bailey Avenue
The licensed program described in this information and all licensed material
available for it are provided by IBM under terms of the IBM Customer Agreement,
IBM International Program License Agreement, or any equivalent agreement
between us.
This information contains examples of data and reports used in daily business
operations. To illustrate them as completely as possible, the examples include the
names of individuals, companies, brands, and products. All of these names are
fictitious and any similarity to the names and addresses used by an actual business
enterprise is entirely coincidental.
Trademarks
The following terms are trademarks of International Business Machines Corporation
in the United States, other countries, or both.
CICS IBM
DB2 iSeries
Distributed Relational Database Architecture OS/390
DRDA QMF
eServer RACF
GDDM WebSphere
z/OS
Linux is a trademark of Linus Torvalds in the United States, other countries, or both.
UNIX is a registered trademark of The Open Group in the United States and other
countries.
Other company, product, and service names may be trademarks or service marks
of others.
aggregation function. Any of a group of functions that summarizes data in a column. They are requested with these
usage codes on the form panels: AVERAGE, CALC, COUNT, FIRST, LAST, MAXIMUM, MINIMUM, STDEV, SUM,
CSUM, PCT, CPCT, TPCT, TCPCT.
aggregation variable. An aggregation function that is placed in a report using the FORM.BREAK, FORM.CALC,
FORM.DETAIL, or FORM.FINAL panels. Its value appears as part of the break footing, detail block text, or final text
when the report is produced.
alias. In DB2 for z/OS, an alternate name that can be used in SQL statements to refer to a table or view in the same
or a remote DB2 for z/OS subsystem. In QMF, a locally defined name used to access a QMF table or view stored on a
local or remote DB2 for z/OS subsystem.
application. A program written by QMF users that extends the capabilities of QMF without modifying the QMF
program itself. Started from a QMF session by issuing a RUN command for a QMF procedure, a site-defined
command, or a TSO command that invokes a CLIST.
application requester. (1) A facility that accepts a database request from an application process and passes it to an
application server. (2) In DRDA®, the source of a request to a remote relational database management system.
The application requester is the database management system code that handles the QMF end of the distributed
connection. The local DB2 for z/OS subsystem to which QMF attaches is known as the application requester for QMF,
because the DB2 for z/OS application requester is installed within the local database manager. Therefore, an entire
DB2 for z/OS subsystem (including data) is associated with the application requester, but the SQL statements are
processed at the current location.
application server. The target of a request from an application requester. (1) The local or remote database manager
to which the application process is connected. The application server executes at the system containing the desired
data. (2) In DRDA, the target of a request from an application requester. With DB2 for z/OS, the application server is
part of a full DB2 for z/OS subsystem.
With DB2 for VM and VSE, the application server is part of a DB2 for VM and VSE database machine.
application-support command. A QMF command that can be used within an application program to exchange
information between the application program and QMF. These commands include INTERACT, MESSAGE, STATE, and
QMF.
area separator. The barrier that separates the fixed area of a displayed report from the remainder of the report.
base QMF environment. The English-language environment of QMF, established when QMF is installed. Any other
language environment is established after installation.
batch QMF session. A QMF session running in the background. Begins when a specified QMF procedure is invoked
and ends when the procedure ends. During a background QMF session, no user interaction and panel display
interaction are allowed.
bind. In DRDA, the process by which the SQL statements in an application program are made known to a database
management system over application support protocol (and database support protocol) flows. During a bind, output
from a precompiler or preprocessor is converted to a control structure called a package. In addition, access paths to
the referenced data are selected and some authorization checking is performed. (In DB2 for z/OS, the output may also
be an application plan.)
built-in function. Generic term for scalar function or column function. Can also be “function.”
calculation variable. CALCid is a special variable for forms that contains a user-defined calculated value. Each
CALCid is defined on the FORM.CALC panel.
callable interface. A programming interface that provides access to QMF services. An application can access these
services even when the application is running outside of a QMF session. Contrast with command interface.
column wrapping. Formatting values in a report so that they occupy several lines within a column. Often used when
a column contains values whose length exceeds the column width.
command interface. An interface for running QMF commands. The QMF commands can only be issued from within
an active QMF session. Contrast with callable interface.
command synonym. The verb or verb/object part of a site-defined command. Users enter this for the command,
followed by whatever other information is needed.
command synonym table. A table each of whose rows describes a site-defined command. Each user can be
assigned one of these tables.
commit. The process that makes a data change permanent. When a commit occurs, data locks are freed, enabling
other applications to reference the just-committed data. See also “rollback”.
concatenation. The combination of two strings into a single string by appending the second to the first.
correlation name. An alias for a table name, specified in the FROM clause of a SELECT query. When concatenated
with a column name, it identifies the table to which the column belongs.
current location. The application server to which the QMF session is currently connected. Except for
connection-type statements, such as CONNECT (which are handled by the application requester), this server
processes all the SQL statements. When initializing QMF, the current location is indicated by the DSQSDBNM startup
program parameter.
Customer Information Control System (CICS). An IBM licensed program that enables transactions entered at
remote terminals to be processed concurrently by user-written application programs. It includes facilities for building,
using, and maintaining databases.
database administrator. The person who controls the content of and access to a database.
database management system. A system for defining, creating, manipulating, controlling, managing, and using
databases. The database management system also has transaction management and data recovery facilities to
protect data integrity.
database manager. A program used to create and maintain a database and to communicate with programs requiring
access to the database.
database server. In DRDA, the target of a request received from an application server.
date/time default formats. Date and time formats specified by a database manager installation option. They can be
the EUR, ISO, JIS, USA, or LOC (LOCAL) formats.
date/time data. The data in a table column with a DATE, TIME, or TIMESTAMP data type.
DB2 for Linux, UNIX, and Windows. The IBM family of DRDA database products on the UNIX and Intel platforms.
default form. The form created by QMF when a query is run. The default form is not created if a saved form is run
with the query.
destination control table (DCT). In CICS, a table containing a definition for each transient data queue.
detail block text. The text in the body of the report associated with a particular row of data.
detail heading text. The text in the heading of a report. Whether or not headings will be printed is specified in
FORM.DETAIL.
dialog panel. A panel that overlays part of a Prompted Query primary panel and extends the dialog that helps build
a query.
distributed data. Data that is stored in more than one system in a network, and is available to remote users and
application programs.
distributed database. A database that appears to users as a logical whole, locally accessible database, but is
comprised of databases in multiple locations.
distributed relational database. A distributed database where all data is stored according to the relational model.
Distributed Relational Database Architecture™ (DRDA). A connection protocol for distributed relational database
processing that is used by IBM and vendor relational database products.
distributed unit of work. A method of accessing distributed relational data in which users or applications can, within
a single unit of work, submit SQL statements to multiple relational database management systems, but no more than
one RDBMS per SQL statement.
DB2 for z/OS has a limited form of distributed-unit-of-work support called system-directed access, which QMF
supports.
double-byte character set (DBCS). A set of characters in which each character is represented by two bytes.
Languages such as Japanese, Chinese, and Korean, which contain more symbols that can be represented by 256
code points, require double-byte character sets. Because each character requires two bytes, the typing, display, and
printing of DBCS characters requires hardware and programs that support DBCS.
echo area. The part of the Prompted Query primary panel in which a prompted query is built.
EUR (European) format. A format that represents date and time values as follows:
v Date: dd.mm.yyyy
v Time: hh.mm.ss
extended syntax. QMF command syntax that is used by the QMF callable interface; this syntax defines variables
that are stored in the storage area acquired by the callable interface application and shared with QMF.
global variable. A variable that, once set, can be used for an entire QMF session. A global variable can be used in a
procedure, query, or form. Contrast with run-time variable.
Graphical Data Display Manager (GDDM). A group of routines that allows pictures to be defined and displayed
procedurally through function routines that correspond to graphic primitives.
grouped row. A row of data in a QBE target or example table that is summarized either by the G. keyword or a
built-in function.
HTML. Hypertext Markup Language. A standardized markup language for documents displayed on the Internet.
initialization program. A program that sets QMF program parameters. This program is specified by the DSQSCMDn
parameter (where “n” is a single character identifying the national language feature you are using) on the START
command in the callable interface. The default program is DSQSCMDE (which is an English program that passes
QMF program parameter values). For a list of national language features and their one-character identifiers, see
Installing and Managing DB2 QMF for TSO/CICS.
ISO (International Standards Organization) format. A format that represents date and time values as follows:
v Date: yyyy-mm-dd
v Time: hh.mm.ss
IXF. Integration Exchange Format: A protocol for transferring tabular data among various software products.
JIS (Japanese Industrial Standard) format. A format that represents date and time values as follows:
v Date: yyyy-mm-dd
v Time: hh:mm:ss
keyword parameter. An element of a QMF command consisting of a keyword and an assigned value.
literal. In programming languages, a lexical unit that directly represents a value; a character string whose value is
given by the characters themselves.
linear procedure. Any procedure not beginning with a REXX comment. A linear procedure can contain QMF
commands, comments, blank lines, RUN commands, and substitution variables. See also “procedure with logic.”
linear syntax. QMF command syntax that is entered in one statement of a program or procedure, or that can be
entered on the QMF command line.
local DB2 for z/OS. With DB2 for z/OS, the application requester is part of a DB2 for z/OS subsystem that is running
in the same z/OS system as QMF. Therefore, an entire DB2 for z/OS subsystem (including data) is associated with the
application requester, but the SQL statements are processed at the current location. This subsystem is where the QMF
plan is bound.
location. A specific relational database management system in a distributed relational database system. Each DB2
for z/OS subsystem is considered to be a location.
NLF. National Language Feature. Any of several optional features available with QMF that lets the user select a
language other than English.
package. The control structure produced when the SQL statements in an application program are bound to a
relational database management system. The database management system uses the control structure to process
SQL statements encountered during statement execution.
panel. A particular arrangement of information, grouped together for presentation in a window. A panel can contain
informational text, entry fields, options the user can choose from, or a mixture of these.
parameter. An element of a QMF command. This term is used generically in QMF documentation to reference either
a keyword parameter or a positional parameter.
permanent storage. The database where all tables and QMF objects are stored. Contrast with temporary storage.
plan. A form of package where the SQL statements of several programs are collected together during bind to create
a plan.
positional parameter. An element of a QMF command that must be placed in a certain position within the
command.
primary panel. The main Prompted Query panel containing your query.
primary QMF session. An interactive session begun from outside QMF. Within this session, other sessions can be
started by using the INTERACT command.
procedure with logic. Any QMF procedure beginning with a REXX comment. In a procedure with logic, you can
perform conditional logic, make calculations, build strings, and pass commands back to the TSO or CICS environment.
See also “linear procedure.”
profile. An object that contains information about the characteristics of the user’s session. A stored profile is a profile
that has been saved in permanent storage. A profile in temporary storage has the name PROFILE. There can be only
one profile for each user.
Prompted Query. A query built in accordance with the user’s responses to a set of dialog panels.
QBE (Query-by-Example). A language used to write queries graphically. For more information, see Using DB2 QMF.
QMF administrative authority. At minimum, insert or delete privilege for the Q.PROFILES control table.
QMF command. Refers to any command that is part of the QMF language. Does not include site-defined
commands.
QMF session. All interactions between the user and QMF from the time the user invokes QMF until the EXIT
command is issued.
qualifier. (1) When referring to a QMF object, the part of the name that identifies the owner or the location of an
object. (2) When referring to a TSO data set, any part of the name that is separated from the rest of the name by
periods. For example, ‘TCK’, ‘XYZ’, and ‘QUERY’ are all qualifiers in the data set name ‘TCK.XYZ.QUERY’.
relational database management system (RDBMS). A system for defining, creating, manipulating, controlling,
managing, and using relational databases.
remote unit of work. (1) The form of SQL distributed processing where the application is on a system different from
the relational database. A single application server services all remote-unit-of-work requests within a single logical unit
of work. (2) A unit of work that allows for the remote preparation and execution of SQL statements.
REXX. Restructured extended executor, a procedural language used by QMF and in applications that you can write
for use with QMF.
rollback. The process that removes uncommitted database changes made by one application or user. When a
rollback occurs, locks are freed and the state of the resource being changed is returned to its state at the last commit,
rollback, or initiation. See also commit.
row operator area. The left-most column of a QBE target or example table.
run-time variable. A variable in a procedure or query whose value is specified by the user when the procedure or
query is run. The value of a run-time variable is only available in the current procedure or query. Contrast with global
variable.
scalar. A value in a column or the value of a literal or an expression involving other scalars.
scalar function. An operation that produces a single value from another value and is expressed in the form of a
function name followed by a list of arguments enclosed in parentheses.
SNAP dump. A dynamic dump of the contents of one or more storage areas that QMF generates during an abend.
Structured Query Language (SQL). A standardized language for defining and manipulating data in a relational
database.
subquery. A complete SQL query that appears in a WHERE or HAVING clause of another query (the main query or
a higher-level subquery).
substitution variable. (1) A variable in a procedure or query whose value is specified either by a global variable or
by a run-time variable. (2) A variable in a form whose value is specified by a global variable.
substring. The part of a string whose beginning and length are specified in the SUBSTR function.
System Log (SYSLOG). A data set or file in which job-related information, operational data, descriptions of unusual
occurrences, commands, and messages to and from the operator may be stored.
tabular data. Data in columnar format. The content and the form of the data is specified on FORM.MAIN and
FORM.COLUMNS.
target table. An empty table in which example elements are used to combine columns, combine rows, or include
constant values in a report.
temporary storage. Areas where the QUERY, FORM, PROC, PROFILE, REPORT, DATA, and CHART objects in
current use are stored.
temporary storage queue. In CICS, a temporary storage area used for transfer of objects between QMF and an
application or a system service.
thread. The DB2 for z/OS structure that describes an application’s connection, traces its progress, provides resource
function processing capability, and delimits its accessibility to DB2 resources and services. Most DB2 for z/OS
functions execute under a thread structure.
three-part name. A fully-qualified name of a table or view, consisting of a location name, owner ID, and object name.
When supported by the application server, a three-part name can be used in an SQL statement to retrieve or update
the specified table or view at the specified location.
timestamp. A date, time, and possibly a number of microseconds (a six- or seven-part value).
transient data queue. In CICS, a storage area whose name is defined in the Destination Control Table (DCT), where
objects are stored for subsequent internal or external processing.
two-phase commit. A protocol used in distributed unit of work to ensure that participating relational database
management systems commit or roll back a unit of work consistently.
unit of work. (1) A recoverable sequence of operations within an application process. At any time, an application
process is a single unit of work, but the life of an application process may involve many units of work as a result of
commit or rollback operations. (2) In DRDA, a sequence of SQL commands that the database manager treats as a
single entity. The database manager ensures the consistency of data by verifying that either all the data changes
made during a unit of work are performed or none of them are performed.
unnamed column. An empty column added to an example table. Like a target table, it is used to combine columns,
combine rows, or include constant values in a report.
variation. A data formatting definition specified on a FORM.DETAIL panel that can be used to conditionally format a
report or part of a report.
z/OS. An operating system for the IBM eServer™ product line that uses 64-bit real storage.
Index 225
importing (continued) MESSAGE command (continued)
form object 99 ISPF panels 46
object level information 84 options 46
prompted query object 115 QMF help panels 46
tables created outside QMF 63 suppressing linear procedure execution 47
incomplete data prompt 81 tracing 123
initial procedures metadata records in exported XML 79
bilingual applications 38 migration information 84
CONNECT command 8 minisession
name, specifying 7 invalid commands 58
storing 8 report 57
writing 7 valid commands 58
INTERACT command mixed-case passwords 198
command form 45 multi-row fetch 55
description 44 multilingual environments 39
session
ending 45
form 44 N
termination 43 New Function Mode and multi-row fetch 55
interact switch (DSQAO_INTERACT) 46 NLF (National Language Feature)
interactive mode defined 35
GDDM ICU 44 language 36
initial procedures 8 language ID 31
QMF 44 multilingual environments 39
ISPF (Interactive System Productivity Facility) panel requirements 36
callable interface 32 session environments 35
IXF
binary 70
character 70 P
examples 75 panel 44
exporting in 67 current 44
long name support 68 interactive 44
OUTPUTMODE=BINARY 77 PARSE ARG statement 11
parse services and exporting XML 78
passwords, mixed-case 9
K PDF 34
keyboard shortcuts ix PDS and PDSE data sets
keywords 51 defining export storage 208, 209
for edit codes, in exported file 97 defining type to QMF 210
START command 51 PL/I
callable interface 176
CICS 184
L communications area 177
L option for debugging 121 DSQABFP 179
language DSQCOMM 182
callable interface 4 function calls 178
ID 31 ISPF 186
NLF, specifying 37 macros 195
return codes 22 sample program 179
LAYOUT command 92 TSO 185
linear procedure z/OS 184
STOPPROC option 47 prerequisite DB2 for z/OS knowledge viii
suppressing 47 primary space allocation upon export 209
product interface macros 195
program calls 18
M prompted query
macros, product interface 195 data formats 63
MESSAGE command export format 111
description 46 exporting 82, 109
displaying text 47 field numbers 111
examples 48 import/export file specifications 117
Q
QBE (Query-By-Example) S
export format 117 SAVE DATA command 62
import/export file specifications 117 schema definition in exported XML file 79, 80
QMF format for exporting data and tables 63 screen readers and magnifiers ix
qmf_data.xsd schema file 80 secondary space allocation upon export 209
SELECT command 25, 32
session environments 35
R SET GLOBAL command
RACF and mixed-case passwords 198 callable interface 20, 49
records prompting for variables 11
application data (*) 88 syntax 49
column (C) 69 signal on error instruction 12
data (D) 70 SQL query object 116
data continuation (C) 91 START command
data value (V) 85 debugging errors 123
fixed format 83 interface communications area 18
formats 64 keywords
header 83 DSQADPAN 52
table description (T) 68 DSQALANG 53
variable format 84 DSQSBSTG 53
remote unit of work DSQSCMD 54
command behavior 41 DSQSDBCS 54
report DSQSDBNM 54
across 104 DSQSDBQN 54
data formats 63 DSQSDBQT 54
displaying text 47 DSQSDBUG 55
export example 101 DSQSIROW 55
export format 104 DSQSMODE 55
export records 103 DSQSMRFI 55
export uses 101 DSQSPILL 55
exported across 107 DSQSPRID 55
exporting 62 DSQSRSTG 56
field numbers 104 DSQSRUN 56
HTML 105 DSQSSPQN 56
line (L) records 89 DSQSSUBS 56
minisession 57 list 51
object 2 QMF startup 21, 50
across 104 syntax 50
export format 104 STATE command 27
field numbers 104 storage
table numbers 104 export considerations 118
panel 2 specifying when exporting 208, 210
records 83 style sheet for exported XML files 81
row data 87 substitution variables 9
sample header 104 assigning values 9
table data 86 global variables, setting 9
table numbers 104 REXX program calls 14
result set records in exported XML 79 syntax 9
return codes synonyms 56
callable interface 20
command interface 27, 28
message 12 T
nonzero 12 table
creating outside QMF 67
Index 227
table (continued)
description records (T) 68, 86
exporting 62
form, numbers 95
object
import/export file specifications 117
import/export rules 81
importing 62
processing 62
prompted query, numbers 111
report, numbers 104
row records (R) 87
table record 68
temporary storage 22
modifying 22
queue 119
restrictions 3
trace data output 121, 122
tracing
A option 121
creating trace definitions 34
example 123
ISPF commands 34
L option 121
turning off 122
transient data queue
contrasted with temporary storage queue 118
translatable applications 39
TSO
Assembler callable interface programs 140
Assembler programs 140
C callable interface programs 151
C programs 151
mixed-case passwords on RACF 9
REXX callable interface programs 192
REXX programs 192
V
validation of exported XML file 80
VARBINARY data type, exporting 64, 65
variables
error handling 22
global 9, 197
substitution 9
pool 17
prompting for 10
QMF 27
rc 12
rules 50
setting 9
substitution 9
variation panels 98, 99
X
XML data type, exporting 78
Printed in USA
SC18-9687-00