Syntax of the QUERY command

Read syntax diagramSkip visual syntax diagram
>>-QUERY--+-------+--+-------------------------+---------------->
          '-ABARS-'  '-ACTIVE-+--------------+-'   
                              '-(TCBADDRESS)-'     

>--+---------------------+--+--------------+-------------------->
   '-ARPOOL-+----------+-'  '-AUTOPROGRESS-'   
            '-(agname)-'                       

>--+------------------------------------+----------------------->
   '-BACKUP-+-------------------------+-'   
            '-(-+-ALL-------------+-)-'     
                +-DAILY-+-------+-+         
                |       '-(day)-' |         
                +-SPILL-----------+         
                '-UNASSIGNED------'         

>--+------------------+--+------------------------------+------->
   '-CDSVERSIONBACKUP-'  '-+-COMMONQUEUE-+-+----------+-'   
                           '-CQUEUE------' '-(RECALL)-'     

>--+-----------------+--+-----------------------+--------------->
   +-CONTROLDATASETS-+  '-+-COPYPOOL-+-(cpname)-'   
   '-CDS-------------'    '-CP-------'              

>--+-----------+--+----------------------+--+-------+----------->
   '-CSALIMITS-'  +-DATASETNAME-(dsname)-+  '-IMAGE-'   
                  +-REQUEST-+----------+-+              
                  |         '-(reqnum)-' |              
                  '-USER-+----------+----'              
                         '-(userid)-'                   

>--+-----------------+------------------------------------------>
   +-MIGRATIONLEVEL2-+   
   '-ML2-------------'   

>--+------+--+--------+--+----------+--+--------+--------------->
   '-POOL-'  '-RETAIN-'  '-SECURITY-'  '-SETSYS-'   

>--+--------------------------+--------------------------------->
   '-SPACE-+----------------+-'   
           |   .--------.   |     
           |   V        |   |     
           '-(---volser-+-)-'     

>--+---------+--+------------+--+-------+--+------------+------->
   '-STARTUP-'  '-STATISTICS-'  '-TRAPS-'  +-VOLUMEPOOL-+   
                                           '-VOLPOOL----'   

>--+---------+-------------------------------------------------><
   '-WAITING-'   

Note:
  1. You must specify at least one of the optional parameters to have anything displayed.
  2. Any QUERY command issued within the startup procedure may not always produce correct data because DFSMShsm is not yet completely initialized.
  3. The SPACE parameter is not supported for SMS-managed volumes.
  4. The QUERY command does not support sending the results of the query to an output data set; however, it does support extended consoles. Using TSO/E extended consoles, you can submit programs that can issue a console command, such as a QUERY, and get the results back for interpretation. DFSMShsm provides a sample REXX program called QUERYSET in SYS1.SAMPLIB(ARCTOOLS). For more details, refer to z/OS TSO/E REXX Reference.