Viewing and changing LOB data and XML documents

The FM/Db2 editor handles LOB and XML data differently to the data for other columns, primarily because of the potentially very large size for LOB and XML data.

You can use the editor options (see Editor Options (8 of 8) panel) to control how much (if any) of the data in LOB or XML columns is shown in the FM/Db2 editor. By default the column name for LOB or XML data is shown in the FM/Db2 editor, but no data is shown - this minimizes the use of storage by the FM/Db2 editor.

When the Db2® object being processed contains LOB columns, you can view and change the data in a single LOB column in a separate FM/Db2 editor session, initiated using the LOBBRWS, LOBEDIT or LOBVIEW editor primary commands.

When the Db2® object being processed contains XML columns, you can view and change the data in a single XML column in a separate editor session, initiated using the XMLBRWS, XMLEDIT or XMLVIEW editor primary commands. If the size of the XML document is less than or equal to 10 MB, the ISPF editor is used. Otherwise, the File Manager editor is used.

A File Manager/Db2 editor session of the data in a LOB column has some differences when compared with a File Manager/Db2 editor session of a Db2® object, as described in LOB edit differences. In this table, the term originating session refers to the FM/Db2 editor session of the Db2® object that contains a LOB column; LOB session refers to the FM/Db2 editor session of a LOB column, this is started from the originating session.

Table 1. LOB edit differences
Action Object Edit LOB edit
Initiation From the function entry panel. EDIT, BROWSE, VIEW editor primary commands Using the LOBBRWS, LOBEDIT, LOBVIEW editor primary commands from within a File Manager/Db2 editor session of the Db2® object containing the LOB column (Originating session).
Saving Changes to rows presented to Db2® one at a time. It is possible that Db2® may reject changes to any row for many reasons. Any changes made in the LOB session are not presented to Db2® as a change to the Db2® object when the LOB session ends. Instead FM/Db2 uses a LOB locator to store any changes. When a SAVE command is issued in the originating session, any rows that have pending changes to LOB columns are presented to Db2®.
Commit A Db2® commit may be issued when a SAVE is issued from the originating session (this depends on the editor option's settings). A Db2® commit is issued at the end of the originating edit session. No Db2® commits are issued from within a LOB session.
Data Display Data is shown initially in either TABL or SNGL format, depending on the settings for the 'Initial display format' editor option. (Displayed on the Editor options (1) panel.) Data is shown initially in either TABL or SNGL format, depending on the 'LOB display format' editor option. (Displayed on the Editor options (8 of 8) panel.) When data is displayed in SNGL mode, you can use the Previous and Next PFKeys (assigned to PF10 and PF11 by default) to scroll through the LOB data.
VARCHAR The "varying length column" editor options are shown on Editor options (5 of 8) panel. The settings for these options depend on user settings. The following "varying length column" editor options are fixed:

Remove trailing spaces:      Off
Show end of string:          On
Convert spaces to Db2 null:  Off
Storage As described for "normal" or "large" mode, see Table 3. All of the data for the LOB column is loaded into the FM/Db2 editor. This may not be possible (insufficient storage) with small TSO region sizes and large LOB columns.

The following usage notes may assist in changing data within a LOB column.

  • The LOB session is similar to a File Manager/Db2 editor session of a Db2® object containing a single VARCHAR(nn) column, where nn is in the range 1000 - 4000. The values for nn are approximate and depend on the screen size and other factors.
  • The data for a single LOB column is split into pieces as it is loaded in the LOB session. This is purely for convenience, since it makes displaying and changing the LOB data easier, given the limitations of a 3270 terminal.
  • You can use the FIND editor command to locate specific text within the LOB session. However a string will not be found if it is split across two "rows" in the LOB session.
  • The LOB session initially displays the LOB data in either SNGL or TABL mode, this is determined by the current setting of the 'LOB display format' option. The amount of data shown depends on the 'LOB piece size' option, the terminal's characteristics and and the number of characters in the LOB column's name.
  • For large LOBs where the intent is to scroll through the data, consider setting the LOB display option to 'Single', combined with a LOB piece size option of 'Single display size'. This allows the maximum use of the available screen size to display the LOB data and the absolute character positions of data is also displayed. You can scroll through the data using the NEXT and PREVIOUS commands (PF11 and PF10).
  • For edit operations, consider setting the LOB display option to 'Table', combined with a LOB piece size option of 'Table display size'. In TABL display mode, all of the data for each "row" is completely visible without the need to scroll to the right.
  • You can also use Single display as the starting point for edit operations. When the insert point for edit operations is found, switch to TABL display mode and issue the SP(lit) prefix command against the row of interest. This converts the row to many smaller rows that are completely visible in TABL display format.
  • Trailing spaces at the end of a "row" are significant, and you should exercise caution in removing these using the editor. When FM/Db2 re-assembles the data for the LOB column, it uses the VARCHAR length for each "row" to determine how much data is added to the LOB column. The editor options for varying length columns (see Editor Options (5 of 8) panel) are set to prevent accidental removal of trailing spaces from a "row", when the data in that "row" is changed.

Note that the end of the row is shown using the display string delimiter for varying length columns (see Editor Options (5 of 8) panel). You may explicitly set the end for a row using the input string delimiter (see Editor Options (5 of 8) panel).