CAPTURE (Capture Rows)


The CAPTURE primary command captures the rows of a table into a data set. This command is valid in any window.

image2021-4-27_16-3-44.png

dsname

Specifies the name of the data set (and member name where applicable) to which the rows should be saved.

Capture Limits

When the CAPTURE command is issued, the rows in the window are saved to the data set specified. Providing your profile does not specify a limit on the number of rows you can capture, the entire table of rows is saved, even if only 20 are displayed. If your profile specifies a capture limit of 10, for example, only the first 10 rows in the window will be saved. (See User Profile Display and Edit Window for information on the CAPTURE LIMIT value in your user profile.)

For example, in the database display in the following figure there is a total of 60 rows in the table, with only 20 rows displayed in the window. If your capture limit is 0 (no limit), all 60 rows will be saved in the data set. If your capture limit is 10, only the first 10 rows are saved. See the next figure for an example of the captured rows in a data set.

Success

Tip

If you exclude rows in the window, they will be excluded from the capture as well.

Capture Limit Example

image2021-4-27_16-5-0.png

Captured Rows in a Data set

Row       DBNAME     DBCREATOR   STOGROUP  BPOOL      DBID   IBMR  CREATEDBY   ROSHARE
----+-   ----+---   ----+----   ----+---   ----+---   ----   ----  ----+----   ----+--
     1   AAD701DB   FFHRFJ0     STG004     BP0        319    N     FFHRFJ0
     2   AA940DB    DFHBJS0     STG004     BP0        415    N     DFHBJS0
     3   AA941DB    DFHBJS0     STG004     BP0        424    N     DFHBJS0
     4   ASCIIDB    HCRGCL0     STG003     BP16K0     432    H     PFHTXH0
     5   BFHDJSDB   BFHDJS0     STG006     BP0        275    N     BFHDJS0
     6   BFHDS0DB   BFHDJS0     STG001     BP0        427    N     BFHDJS1
     7   BFHRLCDB   BFHRLC0     STG001     BP0        333    N     BFHRLC0
     8   BFHRLCDX   BFHRLC0     STG001     BP0        358    N     BFHRLC0
     9   BFHRWADB   PFHCZK1     STG001     BP0        359    N     PFHCZK1
    10   BIGOTTE    HFRDXB0     SYSDEFLT   BP0        443    N     HFRDXB0
    11   BMWWCLDB   PFHJRS0     STG032     BP0        426    N     PFHJRS0
    12   CAPDB57    DFHCAP1     STG002     BP0        399    N     DFHCAP1
    13   CAP1D71A   DFHCAP1     STG002     BP0        269    N     DFHCAP1
    14   CAP1D71P   DFHCAP1     STG002     BP0        270    N     DFHCAP1
    15   CAP2D61L   DFHCAP1     STG002     BP0        286    N     DFHCAP1
    16   CAP3D71P   DFHCAP1     STG002     BP0        375    N     DFHCAP1
    17   CFHJADDB   BFHDJS1     STG001     BP0        313    N     BFHDJS1
    18   CUSTOMER   SUSJDL0     GROUP1     BP0        332    N     SUSJDL0
    19   DBCAPDB    DFHCAP1     STG002     BP0        309    N     DFHCAP1
    20   DBCAP0DB   DFHPJS0     STG002     BP0        267    N     DFHPJS0
    21   DBCAP1DB   DFHCAP1     STG002     BP0        323    N     DFHCAP1
    22   DBCOLUMN   DFHCAP1     STG002     BP0        315    N     DFHCAP1
    23   DBCZKDB    PFHCZK0     STG002     BP0        296    N     PFHCZK0
    24   DBGCODB    PFHCZK0     STG001     BP0        356    N     PFHCZK0
    25   DBGODB     PFHCZK0     STG002     BP0        349    N     PFHCZK1
    26   DBIAD      HCRGCL0     STG002     BP0        401    N     HCRGCL0
    27   DBJAGDB    DFHPJS0     STG002     BP0        265    N     DFHPJS0
    28   DBJDDB     PFHCZK0     STG002     BP0        351    N     PFHCZK0
    29   DBJGDDB    PFHJGD0     STG001     BP0        347    N     PFHJGD0
    30   DBJGDEMO   DFHJAG0     STG002     BP0        302    N     DFHJAG0
    31   DBJGDEM2   DFHJAG0     STG002     BP0        439    N     DFHJAG0
    32   DBJG8K0    DFHJAG0     STG002     BP8K0      406    N     DFHJAG0
    33   DBJMBDB    PFHJMB0     STG002     BP0        348    N     PFHJMB0
    34   DBMXSDB    DFHMXS0     STG002     BP0        264    N     DFHMXS0
    35   DBPAM71U   DFHCAP0     STG002     BP0        442    N     DFHPJS0
    36   DBPJSDB    DFHPJS0     STG002     BP0        261    N     DFHPJS0
    37   DBPSDBA    DFHPJS0     STG002     BP0        288    N     DFHPJS0
    38   DBPSDBAN   DFHPJS0     STG002     BP0        386    N     DFHPJS0
    39   DBPSDBX    DFHPJS0     STG002     BP0        354    N     DFHPJS0
    40   DBPSDB1    DFHPJS0     STG002     BP0        303    N     DFHPJS0
    41   DBPSD71A   DFHPJS0     STG002     BP0        420    N     DFHPJS0
    42   DBPSTDB1   DFHPJS0     STG002     BP0        440    N     DFHPJS0
    43   DBPS1DB1   DFHPJS1     STG002     BP0        298    N     DFHPJS1
    44   DBQAD71A   DFHCAP0     STG002     BP0        393    N     DFHCAP0
    45   DBQAD71E   DFHCAP0     STG002     BP0        395    K     DFHCAP0
    46   DBQAD71L   DFHCAP0     STG002     BP0        397    N     DFHCAP0
    47   DBQAD71P   DFHCAP0     STG002     BP0        394    N     DFHCAP0
    48   DBQAD71U   DFHCAP0     STG002     BP0        396    N     DFHCAP0
    49   DBRLCDB    PFHCZK0     STG002     BP0        361    N     PFHCZK1
    50   DBTJDB     PFHTJJ0     STG001     BP0        352    N     PFHTJJ0
    51   DBTONYA    PFHTXH0     STG002     BP0        334    N     PFHTXH0
    52   DBWPKDB    DFHPJS0     STG002     BP0        266    N     DFHPJS0
    53   DBXPSDB    DFHPJS1     STG002     BP0        305    N     DFHPJS1
    54   DBXPSDB1   DFHPJS1     STG002     BP0        419    N     DFHPJS1
    55   DB563DB    PFHJRS0     STG002     BP0        271    N     PFHJRS0
    56   DB570D     DFHCAP0     STG002     BP0        260    N     DFHCAP0
    57   DB570DB    PFHJRS0     STG002     BP0        263    N     PFHJRS0
    58   DB571DB    PFHCZK0     STG002     BP0        337    N     PFHCZK0
    59   DB572DB    PFHCZK0     STG002     BP0        343    N     PFHCZK0
    60   DB573DB    PFHCZK0     STG002     BP0        381    N     PFHCZK0
    61   DB580DB    PFHCZK0     STG002     BP0        425    N     PFHCZK0
    62   DFHEJKDB   DFHEJK0     STG003     BP0        403    N     DFHEJK0
    63   DFHJAG1    DFHJAG0     STG002     BP0        327    N     DFHJAG0
    64   DJSXPLDB   BFHDJS1     STG001     BP0        282    N     BFHDJS1
    65   DSN#JMB    FADBTST     DSN8G710   BP0        291    N     PFHJMB0
    66   DSNDB04    SYSIBM      SYSDEFLT   BP0          4    Y     SYSIBM
    67   DSNDB06    SYSIBM                              6    Y     SYSIBM
    68   DSNDB07    MFHCWW0     SYSDEFLT   BP0          7    N     MFHCWW0
    69   DSNRGFDB   MFHCWW0     SYSDEFLT   BP0        257    N     MFHCWW0
    70   DSNRLST    MFHCWW0     SYSDEFLT   BP0        256    N     MFHCWW0
    71   DSNRTSDB   MFHEFS0     SYSDEFLT   BP0        408    N     MFHEFS0
    72   DSNSWAN    PFHJRS0     STG002     BP0        306    N     PFHJRS0
    73   DSNTEST    PFHCZK0     DSN8G610   BP0        301    N     PFHCZK0
    74   DSN8D71A   PFHJMB0     DSN8G710   BP0        299    N     PFHJMB0
    75   DSN8D71P   PFHJMB0     DSN8G710   BP0        300    N     PFHJMB0
    76   DSQDBCTL   MFHCWW0     DSQSGCTL   BP0        277    N     MFHCWW0
    77   DSQDBDEF   MFHCWW0     DSQSGDEF   BP0        278    N     MFHCWW0
    78   DSQ1STBB   MFHCWW0     DSQ1STBG   BP0        279    N     MFHCWW0
    79   EAB710DB   FFHRFJ0     STG004     BP0        321    N     FFHRFJ0

Too Many Columns

If your table has multiple columns, it may be too wide to be saved to a data set. In Capture Limit Example, the last column is TIMESTAMP in the previous figure. This column doesn’t appear in the data set in Captured Rows in a Data set because the line length was too long. You can, however, hide some of the left-most columns in order to display ones on the right.

In order to save the TIMESTAMP column, hide some of the first few columns so that TIMESTAMP displays in the window (see the following figure). Then, issue the CAPTURE command. (See HIDE-Hide-Column for information on using the HIDE command.)

Window with Hidden Columns. Six of the first seven columns (2-7) have been hidden in order to bring the TIMESTAMP column into view.

image2021-4-27_16-51-46.png



 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI DevX File-AID for Db2 23.01