In order to take full advantage of the following examples you need to have CXU installed and to have defined a CXU-key. You also need an active ISPF EDIT or VIEW session. Whether you use a new dataset/member or an existing is up to you, but you must be prepared to change data. Examples:
Display the contents of a dataset or member
Execute a SQL statement
Display the columns in a DB2 table
Execute SQL statement containing hostvariables within program source
Display list of selected datasets or members
Place the cursor on any character (except a dot) in an existing datasetname or datasetname(membername). Press your CXU-key. The contents of the dataset or member is displayed in a new ISPF EDIT/VIEW/BROWSE session or as a member list. CXU determines how the contents should be presented to you. Read more here.
Hint: CXU does not have any requirements regarding dataset names or the data
contents (JCL, program source or the like). Thus it is a good idea to create a dataset or
member containing the dataset names you prefer to work with. Using the CXU-key you can go
from this dataset or member to the datasets or members you need to access for various
purposes.
Type in the following SQL statement as an example. It should work on all DB2 systems:
Begin with the example Execute a SQL statement. When it works place the cursor somewhere on the table name (except the dot) and press your CXU-key. CXU now displays a list of the indexes and columns in the selected table directly below the line containing the table name.
Hint: CXU does not require a table name to be located inside a SQL statement. Thus
you are able to display the columns of a DB2 table just by typing a table name, place the
cursor on it and press the CXU-key.
Read more here.
Begin with the example Execute a SQL statement. When it works then change the example to the following (remember to add the &DB2SYS-parameter in a comment, if applicable):
The example uses -- as comment. You can also use * in position 1 and 7 and /* */ as
comments. All these types of comments supported by CXU makes it possible to execute the
example and all other types of SQL statementes directly from the program source. If you
use comments in compliance with the source you can compile the program without errors using
the &-parameters in comments within the SQL statement. Read more about hostvariables
here.
Place the cursor on a dot in an existing dataset name. Press your CXU-key. A list of datasets beginning with the selected dataset name is displayed using ISPF DSLIST (ISPF 3.4). Normally only one dataset will be listed, but if other datasets begins with the name of the selected dataset name, they will appear on the list. Read more here.
Type in asteriks (*) or percent (%) in a dataset name. Place the cursor somewhere on the changed dataset name. Press your CXU-key. A list of datasets matching your dataset filter is displayed using ISPF DSLIST (ISPF 3.4). Read more here.
Type in asteriks (*) or percent (%) in the member name of a datasetname(membername). Place the cursor somewhere on the changed datasetname(membername). Press your CXU-key. A list of members matching your member filter is displayed using ISPF MEMLIST (ISPF 3.1). Read more here.