IMPORT in TSO

The IMPORT command copies the contents of a TSO data set or UNIX file into QMF temporary storage or into the database.

TSO with ISPF TSO without ISPF
X X

Syntax

IMPORT a QMF object into temporary storage

Read syntax diagramSkip visual syntax diagramIMportQUERYFORMPROCDATAFrom datasetnamepathname1 (Member=membername2)
Notes:
  • 1 QMF accepts a path name only when the object is DATA and the data is in XML format.
  • 2 Accepted only when you import from a TSO data set.

IMPORT a QMF query or procedure into the database

Read syntax diagramSkip visual syntax diagramIMportQUERYPROCobjectnameFrom  datasetname (,Member=membernameCONfirm=profile1YesNoSHare=dsqec_share2YesNoCOMment=value)
Notes:
  • 1 The value set in your profile is used.
  • 2 For an object being replaced, the current value is left unchanged. Otherwise, the value set in this global variable is used.

IMPORT a QMF form into the database

Read syntax diagramSkip visual syntax diagramIMportFORMobjectnameFrom  datasetname (,Language=dsqec_form_lang1EnglishSessionMember=membernameCONfirm=profile2YesNoSHare=dsqec_share3YesNoCOMment=value)
Notes:
  • 1 The value set in this global variable is used.
  • 2 The value set in your profile is used.
  • 3 For an object being replaced, the current value is left unchanged. Otherwise, the value set in this global variable is used.

IMPORT a table into the database

Read syntax diagramSkip visual syntax diagramIMportTABLEtablenameFrom datasetnamepathname1 (,ACTion=ReplaceAppendMember=membername2CONfirm=profile3YesNoCOMment=valueSPace=profile4valueblankstringACCelerator=dsqec_sav_accelnm5value)
Notes:
  • 1 QMF accepts a path name only when the table is in XML format.
  • 2 Accepted only when you import from a TSO data set.
  • 3 The value set in your profile is used.
  • 4 The value set in your profile is used.
  • 5 The value set in this global variable is used.

Description

datasetname
The TSO data set to copy. The data set name is specified in either of the following ways:
  • A partial TSO name without single quotation marks.

    A fully qualified data set name is generated by using your TSO prefix as the first qualifier and appending the object type as the last qualifier.

  • A fully qualified TSO data set name, where the entire name is enclosed in single quotation marks.

    Quotation marks must be used when the data set name has a prefix that is not your own.

pathname
Names the UNIX file from which to retrieve the object. Surround UNIX path names in quotes and ensure that they are 250 or fewer characters. If you do not surround the path name in quotes, QMF appends the QMF object type to the end of the path name and surrounds the path name in quotes.
objectname
The name for the QMF object in the database.

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.

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.

ACTION
Indicates whether to replace the entire database table with the imported data or to append the imported data to the existing table.
LANGUAGE
Indicates whether QMF keywords contained within the imported 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 national language.

MEMBER
Indicates that the imported object is a member in a TSO partitioned data set.
membername
The name of the member to import. Member names are limited to 8 characters. The member name is added (in parentheses) as a suffix to the data set name.
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 imported object.
COMMENT
Stores a comment with the imported object. A comment is a remark or note that you can create when you import 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 using 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 IMPORT 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 IMPORT 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.

SPACE
Names a storage space to hold any tables that are created by the SAVE DATA command. A blank value specifies that you will use the space that is chosen by the database manager program.
ACCELERATOR
Specifies the name of the accelerator in which the table will be created.

Usage notes

  • If you import a QBE query that was exported from a QMF Version 11.1 or earlier system, the query is converted in temporary storage with long-name characteristics and cannot be used if you connect to a QMF Version 11.1 or earlier system. Furthermore, if you save the imported query, it cannot be used in QMF Version 11.1 or earlier systems.
  • Data sets referenced by the IMPORT command must be either partitioned (with a data set organization, or DSORG, value of PO) or physical sequential (DSORG=PS).
  • The IMPORT command fails if the object or the database into which the object is being imported is read-only.
  • The data set must contain a single, complete QMF object before the IMPORT command is issued.
  • A QMF administrator can import a QMF object for another user.
  • When data is imported, a new form is created. Any existing form in temporary storage is replaced.
  • You cannot import reports, charts, or CSV data.
  • When you import into the database and an object exists with the same name you specify, QMF replaces or appends the object (according to the value of the ACTION parameter), subject to these conditions:
    • A form can replace only a form.
    • A procedure can replace only a procedure.
    • A query can replace only a query.
    • A table 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 to be imported contains XML columns, the data to be imported and the existing table:

      • Must have the same number of XML columns in the same positions
      • Must have the same null characteristics that are defined for the XML columns
  • When you import 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 in the imported object.
  • Objects can be imported to a remote location. Use the QMF CONNECT command to make the remote location your current location first, followed by the IMPORT command.
  • If your current location is a Db2® for z/OS® server, you can import to an existing table at a remote location by specifying a three-part name for the table. (However, you cannot import 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 accessed remotely if you start QMF as a stored procedure.
  • If you are importing a table that contains an XML column, ensure that the column contains well-formed XML documents. Ensure that all characters in the XML columns to be imported are supported by the XML parser. XML data can only be imported when you are connected to a database release that supports the XML data type.
  • When the data is in XML format, the maximum length of a data row to be imported is 2 GB.
  • The ability to import a table that contains LOB data is controlled by the DSQEC_LOB_SAVE global variable.
  • You cannot import ANALYTIC objects.
  • To use this command with columns that contain DECFLOAT data, the processor on which QMF is running must support decimal floating-point instructions.
  • 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 an IMPORT TABLE 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. QMF allows you to set the value of this register using the SET CURRENT SCHEMA statement.
  • When you issue the IMPORT TABLE command with the ACTION=REPLACE parameter and the data to be imported 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.
  • When you import into an existing table, the column names and labels remain unchanged. If you issue the IMPORT TABLE command with the ACTION=REPLACE or ACTION=APPEND parameter, and the existing table is a temporal table, the table remains temporal. When you import a table, new values are created for columns that were defined with the GENERATED ALWAYS attribute.
  • If you issue the IMPORT TABLE command and the specified table does not exist, a new table is created using the column names and labels in the imported object. You cannot import a table into a new temporal table. When you import into a new table, the table is created with new values for columns that were defined with the GENERATED ALWAYS attribute.
  • 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 the QMF IMPORT command:
      IMPORT ?
  2. If your TSO prefix is JULIA and you want to copy a member of your partitioned data set ('JULIA.LOREN.QUERY(GAMMA)') into the database and give it the name FIRSTQ:
      IMPORT QUERY FIRSTQ FROM LOREN (MEMBER=GAMMA
  3. To add data (NEW.ROWS) to a table (MYTABLE):
      IMPORT TABLE MYTABLE FROM NEW.ROWS (ACTION=APPEND
  4. To import a table to a remote database server (VENICE), first connect to that location:
      CONNECT TO VENICE
    Then import the table:
      IMPORT TABLE LARA.STATSTAB FROM YOURDATA

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

  5. If your current location is a Db2 for z/OS server, and you want to copy the data set 'G7.STATS.TABLE' from the system where QMF is executing to an existing table (OKAMOTO.STATUS) at a remote database location (TOKYO):
      IMPORT TABLE TOKYO.OKAMOTO.STATUS FROM 'G7.STATS.TABLE'

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

  6. To import a form for another user (JEAN) if you are the QMF administrator (QMFADM), issue the following command:
      IMPORT FORM JEAN.REPORT12 FROM FORMTEST (COMMENT='12 MONTH FORMAT') 
  7. To import data from the UNIX file /u/DEPTJ49/pernal/mystaff.personnel, issue the following command:
    IMPORT DATA FROM '/u/DEPTJ49/pernal/mystaff.personnel'

    Be sure that the CASE option of your QMF profile is set to STRING or MIXED to maintain the lowercase characters.