z/OS DFSORT Application Programming Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


OCCUR operator

z/OS DFSORT Application Programming Guide
SC23-6878-00

Read syntax diagramSkip visual syntax diagram
                           .---------------------------.   
                           V                           |   
>>-+-OCCUR--+--FROM(indd)----+-ON(p,m,f)-------------+-+-------->
   '-OCCURS-'                +-ON(p,m,f,formatting)--+     
                             +-ON(p,m,HEX)-----------+     
                             +-ON(VLEN)--------------+     
                             +-ON(VLEN,formatting)---+     
                             +-ON(VALCNT)------------+     
                             '-ON(VALCNT,formatting)-'     

                 .------------------------------------------.   
                 V                                          |   
>--LIST(listdd)----+-TITLE('string1')---------------------+-+--->
                   +-TITLE('string1','string2')-----------+     
                   '-TITLE('string1','string2','string3')-'     

>--+-------+--+--------+--+------+--+-------------+------------->
   '-TLEFT-'  '-TFIRST-'  '-PAGE-'  +-DATE--------+   
                                    +-DATE(abcd)--+   
                                    +-DATENS(abc)-+   
                                    +-YDDD(abc)---+   
                                    '-YDDDNS(ab)--'   

>--+------------+--+-------+--+------+-------------------------->
   +-TIME-------+  +-BLANK-+  '-NOCC-'   
   +-TIME(abc)--+  '-PLUS--'             
   '-TIMENS(ab)-'                        

   .-------------------------------------------.   
   V                                           |   
>----+---------------------------------------+-+---------------->
     +-HEADER('string1')---------------------+     
     +-HEADER('string1','string2')-----------+     
     +-HEADER('string1','string2','string3')-+     
     +-HEADER(NONE)--------------------------+     
     '-NOHEADER------------------------------'     

>--+----------+--+-----------+--+------------+--+-----------+--->
   '-LINES(n)-'  '-INDENT(n)-'  '-BETWEEN(n)-'  +-ALLDUPS---+   
                                                +-NODUPS----+   
                                                +-HIGHER(x)-+   
                                                +-LOWER(y)--+   
                                                '-EQUAL(v)--'   

>--+-------------+--+----------+--+----------+--+-------+------->
   '-VSAMTYPE(x)-'  '-WIDTH(n)-'  '-LONGLINE-'  '-UZERO-'   

>--+-------------+--+-----------+------------------------------><
   '-TBETWEEN(n)-'  +-LISTSDB---+   
                    '-LISTNOSDB-'   

Prints each unique value for specified numeric fields (including SMF, TOD, and ETOD date and time) or character fields, and how many times it occurs, in a separate list data set. Simple or tailored reports can be produced. The values printed can be limited to those for which the value count meets specified criteria.

From 1 to 10 fields can be specified, but the resulting list data set line length must not exceed the limit specified by the WIDTH operand or 8192 bytes if LONGLINE is specified and WIDTH is not specified, or 2048 bytes if LONGLINE and WIDTH are not specified. At least one ON(VLEN) or ON(p,m,f) field must be specified; all such ON fields specified are used to determine whether a record contains a unique value. A single list data set record is printed for each unique value. If ON(VALCNT) is specified, the "value count" (that is, the number of times the ON values occur) is printed in the list data set record along with the other ON values.

Specifying formatting items or the PLUS or BLANK operand, which can "compress" the columns of output data, can enable you to include more fields in your report, up to a maximum of 10, if your line length is limited by the character width your printer or display supports.

ALLDUPS, NODUPS, HIGHER(x), LOWER(y) or EQUAL(v) can be specified to limit the ON values printed to those for which the value count meets the specified criteria (for example, ALLDUPS for duplicate values only). The default criteria is HIGHER(0) resulting in the ON values being printed for each unique value.

DFSORT is called to sort the indd data set to ICETOOL's E35 user exit. ICETOOL uses its E35 exit to print appropriate titles, headings and data in the list data set.

You must not supply your own DFSORT MODS, INREC, OUTREC, SUM, or RECORD statement, because they override the DFSORT statements passed by ICETOOL for this operator.

The DYNALLOC option is passed to DFSORT to ensure that work space is available for the sort. If your installation defaults for dynamic allocation are inappropriate for an OCCUR operator, you can take one of the following actions:
  1. Override the DYNALLOC option using an OPTION control statement such as:
       OPTION DYNALLOC=(,8)

    in the DFSPARM data set.

  2. Use SORTWKdd DD statements to override the use of dynamic allocation. Refer to SORTWKdd DD statement for details.

Attention: Either of these actions affects the work data sets used for a UNIQUE operator, or for a SELECT or SPLICE operator for which USING(xxxx) is not specified.

Tape work data sets cannot be used with ICETOOL.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014