SAVE

The SAVE command saves in the database at the current location objects that are currently in QMF temporary storage.

TSO with ISPF TSO without ISPF CICS®
X X X

SAVE a QMF profile in the database

Read syntax diagramSkip visual syntax diagramSAvepanelname1PROFILE
Notes:
  • 1 The name of the QMF object panel currently displayed, if appropriate, is used.

SAVE a QMF query or procedure in the database

Read syntax diagramSkip visual syntax diagramSAvepanelname1QUERYPROCobjectname2As objectname (,CONfirm=profile3YesNoSHare=dsqec_share4YesNoCOMment=valueFOLder=dsqec_curr_folder5ALLNONEobjectname)
Notes:
  • 1 The name of the QMF object panel currently displayed, if appropriate, is used.
  • 2 The name of the object currently in QMF temporary storage, if any, is used.
  • 3 The value set in your profile is used.
  • 4 For an object being replaced, the current value is left unchanged. Otherwise, the value set in this global variable is used.
  • 5 The value set in this global variable is used.

SAVE a QMF form in the database

Read syntax diagramSkip visual syntax diagramSAvepanelname1FORMobjectname2As objectname (,Language=dsqec_form_lang3EnglishSessionCONfirm=profile4YesNoSHare=dsqec_share5YesNoCOMment=valueFOLder=dsqec_curr_folder6ALLNONEobjectname)
Notes:
  • 1 The name of the QMF object panel currently displayed, if appropriate, is used.
  • 2 The name of the object currently in QMF temporary storage, if any, is used.
  • 3 The value set in this global variable is used.
  • 4 The value set in your profile is used.
  • 5 For an object being replaced, the current value is left unchanged. Otherwise, the value set in this global variable is used.
  • 6 The value set in this global variable is used.

SAVE QMF data in the database

Read syntax diagramSkip visual syntax diagramSAveDATAAs tablename (,ACTion=ReplaceAppendCONfirm=profile1YesNoCOMment=valueSPace=profile2valueblankstringACCelerator=dsqec_sav_accelnm3value)
Notes:
  • 1 The value set in your profile is used.
  • 2 The value set in your profile is used.
  • 3 The value set in this global variable is used.

Description

objectname
The name for the QMF object in the database. The maximum length of the object name is dependent on the database to which you are currently connected.
If the object name is too long to fit on the QMF command line, issue the command from a command prompt panel. The name does not need to be delimited by quotation marks when continued on multiple lines on the panel.To display the panel, issue the following command:
SAVE objecttype AS ?
where objecttype is the type of object you want to save. For example, to display a prompt panel for saving a query, enter:
SAVE QUERY AS ?
tablename
The name of a table, view, synonym, or alias.
If the object name is too long to fit on the QMF command line, issue the command from a command prompt panel. The name does not need to be delimited by quotation marks when continued on multiple lines on the panel.To display the panel, issue the following command:
SAVE TABLE AS ?
ACTION
Indicates whether to replace the entire database table with the saved data or to append the saved data to the existing table.
LANGUAGE
Indicates whether QMF keywords contained within the saved form are recorded in English or in the current NLF session language.

A QMF form that contains QMF keywords in English can be used in any QMF session. A QMF form that contains QMF keywords in any other national language that is supported by QMF can be used only in a session of that same QMF national language.

CONFIRM
Indicates whether a confirmation panel is displayed when this command will replace an existing object in the database.
SHARE
Determines whether other QMF users can access the saved object.
SPACE
Names a storage space to hold tables created by the SAVE DATA command. A blank value specifies that the default storage space will be will be determined by the database at the current location.
ACCELERATOR
Specifies the name of the accelerator in which the table will be created.
COMMENT
Stores a comment with the saved object. A comment is a remark or note that you can create when you save the object. The purpose of creating a comment is to provide descriptive information about the object. Users with whom the object is shared can then view this information by pressing the Comments key when the object is displayed in a list.

You cannot replace a comment on a table you do not own or on a remote table that uses a three-part name.

value
The character string that makes up the content of the comment.

A value that contains blank characters must be surrounded with delimiters. Valid delimiters for a comment value are single quotation marks, parentheses, and double quotation marks. If you are using the SAVE command from the QMF command line or in a procedure to store a comment with the object, the comment text can be up to 78 single-byte characters. If you are using the SAVE Command Prompt panel to enter the comment, the comment can be up to 57 single-byte characters.

When the comment itself contains a delimiter character (a single quotation mark, double quotation mark, or parentheses), surround the entire comment with one of the other types of delimiters so that QMF saves the entire comment.

FOLDER
The name of the QMF folder object to use with the SAVE command.

You can add a QMF object to a folder by using the FOLDER keyword with the SAVE command. When a folder name is specified with the SAVE command, the QMF object is saved and is also included in the folder.

You can specify a folder name either by including the FOLDER keyword in the SAVE command or by setting the DSQEC_CURR_FOLDER global variable:
  • If the FOLDER keyword is specified with the SAVE command, that folder name overrides the folder name that is set in DSQEC_CURR_FOLDER.
  • If the FOLDER keyword is not specified with the SAVE command and DSQEC_CURR_FOLDER is set to a folder name, the object is saved and the object is added to the folder name that is specified by DSQEC_CURR_FOLDER.
  • If the FOLDER keyword is not specified and DSQEC_CURR_FOLDER is not set, the object is saved but is not added to a folder.

The folder does not need to exist in the database when the SAVE command is run.

The folder name must be a valid QMF object name. The folder name cannot be a QMF object type, such as QUERY, PROC, FORM, ANALYTIC, or FOLDER. Wildcards '%' and '_' are not valid in a folder name. If the folder name includes a blank, the folder name must be enclosed in double quotation marks.

The FOLDER keyword in not valid with the SAVE DATA or SAVE PROFILE commands. The FOLDER keyword is not valid when you are connected to a DB2® Server for VSE and VM database.

Usage notes

  • If you save a QBE query that was created in a QMF Version 11.1 or earlier system, the query is saved with long-name characteristics and is longer be usable in QMF Version 11.1 or earlier systems. If you want to avoid converting and replacing an old query, rename the query when you save it.
  • You cannot issue the SAVE command to save an ANALYTICS object. To save a QMF Analytics for TSO chart or statistics specification, use the Save function key in QMF Analytics for TSO.
  • A QMF administrator can save a QMF object for another user.
  • When you save an object and an object exists with the same name, QMF replaces or appends the object (according to the value of the ACTION parameter), subject to these conditions:
    • A query can replace only a query.
    • A procedure can replace only a procedure.
    • A form can replace only a form.
    • Data can replace or append only a similar table object.

      A similar table is one with the same number of columns, with corresponding columns each having the same data type and length. If corresponding columns do not have the same data type or length, they might be automatically converted from one data type or length to another, depending on the level of support that your database management software offers for implicit casting.

      Column names and labels do not have to match.

      If the data that is to be saved contains XML columns, the data that is to be saved and the existing table must have:
      • The same number of XML columns in the same positions.
      • The same null characteristics defined for the XML columns.
  • When you save into an existing table, the column names and labels remain unchanged. If the table does not exist, a new table is created that uses the column names and labels that are recorded within the QMF data object.
  • Objects can be saved to a remote location. Use the QMF CONNECT command to make the remote location your current location first, followed by the SAVE command.

    If your current location is a Db2® for z/OS® database, you can save to an existing table at a remote location by specifying a three-part name for the table. You cannot save a new table or any QMF objects this way. If your database administrator set up QMF to use the multirow fetch feature, both databases you are working with (local and remote) must be Db2 for z/OS if you are using three-part names; otherwise, your command fails. Your database administrator can turn off multirow fetch.

    QMF commands with three-part names cannot be directed to DB2 for VSE and VM databases, nor can data be saved remotely if you started QMF as a stored procedure.

  • To use the SAVE DATA command with columns that contain DECFLOAT data, the processor on which QMF is running must support decimal floating-point instructions.
  • Db2 stores records within pages that are 4 KB, 8 KB, 16 KB, or 32 KB in size. Because you cannot create a table with a maximum record size that is greater than the page size, the maximum length of a data row that can be saved with the SAVE DATA command is limited to 32 KB even when the QMF report displays rows longer than this limit. When you save data that contains an XML column, each data row contains a pointer that references the location of the data; the data itself is not stored as part of the record and therefore does not count toward the 32 KB limit.
  • Operations with XML or LOB data typically require larger amounts of storage. Therefore, saving data or tables that contain XML or LOB data might be limited by the amount of storage that you have available.
    • To save an object with XML data, you must be connected to a database release that supports the XML data type.
    • The ability to save a table that contains LOB data is controlled by the DSQEC_LOB_SAVE global variable. If saving of LOB data is enabled and the DSQEC_LOB_RETRV global variable is set to 1 or 3, the SAVE DATA command saves all LOB data in the table. If the DSQEC_LOB_RETRV global variable is set to 2, LOB data cannot be saved regardless of the DSQEC_LOB_SAVE global variable setting because LOB data is not retrieved.
  • When you save into an existing table, the column names and labels remain unchanged. If you replace or append data in an existing temporal table, the table remains temporal. However, you cannot save data into a new temporal table. If the specified table does not exist, a new table is created using the column names and labels in the QMF data object. When you save data into a new or existing table, new values are created for columns that were defined with the GENERATED ALWAYS attribute.
  • QMF updates the Last Used field for the object when you use this command. This field appears on object list panels that are displayed by the LIST command. You can change the list of commands that cause the field to be updated by setting the DSQEC_LAST_RUN global variable.
  • When you issue a SAVE DATA command that references an unqualified table or view name, QMF sends the unqualified name to Db2 for resolution. Db2 uses the value in the CURRENT SCHEMA register to qualify the table or view name. You can set the value of this register by using the SET CURRENT SCHEMA statement.
  • When you issue the SAVE DATA command with the ACTION=REPLACE parameter and the data to be saved contains column label information, QMF creates labels on the new table if the database supports the LABEL ON statement. If the database does not support the LABEL ON statement, the new table is created without column labels.
  • The maximum length of a query that can be run by the RUN QUERY command depends on the type of database to which the command is directed.
  • You cannot specify both the SPACE and the ACCELERATOR parameter in the same command.
  • If the SPACE or ACCELERATOR parameter is used in the command and the table already exists, SPACE or ACCELERATOR is ignored. The table is re-created at the original location.
  • The value of the DSQEC_SAV_ALLOWED global variable determines the default behavior of the SPACE and ACCELERATOR parameters:
    • When the global variable is set to 0, the SAVE DATA command cannot not be used.
    • When the global variable is set to 1, tables are saved only to the database, and only the SPACE parameter is allowed. If the SPACE parameter is not specified, the value is taken from the QMF profile.
    • When the global variable is set to 2, tables are saved only to the accelerator, and only the ACCELERATOR parameter is allowed. If the ACCELERATOR parameter is not specified, the accelerator name that is specified in the DSQEC_SAV_ACCELNM global variable is used.
    • When the global variable is set to 3, tables are saved by default to the database and are saved to the accelerator only when the ACCELERATOR parameter is specified. If neither the SPACE parameter nor the ACCELERATOR parameter is specified, the value of the SPACE setting from the QMF profile is used.
    • When the global variable is set to 4, tables are saved by default to the accelerator and are saved to the database only when the SPACE parameter is specified. If neither the SPACE parameter nor the ACCELERATOR parameter is specified, the accelerator name that is specified in the DSQEC_SAV_ACCELNM global variable is used.
  • Accelerator-only tables are created in the database defined in the DSQEC_SAV_ACCELDB global variable. The Q.PROFILES.SPACE value is not used when defining accelerator-only tables.

Examples

  1. To display a prompt panel for saving a form:
      SAVE FORM ?
  2. To include a comment with a saved query:
      SAVE QUERY AS STAFFQ2 (COMMENT=(Staff report for departments))
  3. To save a query in QMF temporary storage into the database at the current location:
      SAVE QUERY AS HAZEL.QUERY3
  4. To save a QMF object to a remote database server (MADRID), first connect to that location:
      CONNECT TO MADRID
    Then save the object:
      SAVE FORM AS FORMAT2

    You cannot connect to a remote database if you started QMF as a stored procedure.

  5. If your current location is Db2 for z/OS and you want to save your data to an existing table (HAZEL.STATUS) at a remote database location (BILLINGS):
      SAVE DATA AS BILLINGS.HAZEL.STATUS

    QMF commands with three-part names cannot be directed to DB2 for VSE and VM databases, nor can data be accessed remotely if you started QMF as a stored procedure.

  6. QMF administrator (QMFADM) saving a procedure for another user (HAZEL):
    SAVE PROC AS HAZEL.MONTHLY (COMMENT=(MONTHLY PROCESS)
  7. To save a QMF query object called YR2014 and include that object in a FOLDER named SALES:
    AVE QUERY AS YR2014 (FOLDER = SALES