Syntax and options of the TEMPLATE control statement

The TEMPLATE utility control statement, with its multiple options, defines the function that the utility job performs.

You can create a control statement with the ISPF/PDF edit function. After creating it, save it in a sequential or partitioned data set. When you create the JCL for running the job, use the SYSIN DD statement to specify the name of the data set that contains the utility control statement.

Syntax diagram

>>-TEMPLATE--template-name-------------------------------------->

>--+---DSN--| name-expression |----+--------------------+--+------------------+--+-------------+-+-><
   |                               '-| common-options |-'  +-| disk-options |-+  '-SUBSYS-spec-' |   
   |                                                       '-| tape-options |-'                  |   
   '-path-expression-----------------------------------------------------------------------------'   

name-expression:

   .-.------------------------.   
   V                          |   
>>---| qualifier-expression |-+--------------------------------->

                                  (1)   
>--+----------------------------+------------------------------><
   '-(parenthetical-expression)-'       

Notes:
  1. The entire name-expression represents one character string and cannot contain any blanks.

qualifier-expression:

   .--------------------------------------------------.   
   V                                                  |   
>>---+-character-expression-------------------------+-+--------><
     |                                          (2) |     
     '-&variable-+--------------------------+-.-----'     
                 |                      (1) |             
                 '-(start-+---------+-)-----'             
                          '-,length-'                     

Notes:
  1. If you use substring notation, the entire DSN operand must be enclosed in single quotation marks. For example, the DSN operand 'P&PA(4,2).' uses substring notation, so it is enclosed in single quotation marks.
  2. The &PA. variable cannot be used more than once.

common-options:

   .-UNIT--SYSALLDA-.                         
>>-+----------------+--+------------------+--------------------->
   '-UNIT--name-----'  '-MODELDCB--dsname-'   

   .-BUFNO--30------.                                           
>--+----------------+--+----------------+--+----------------+--->
   '-BUFNO--integer-'  '-DATACLAS--name-'  '-MGMTCLAS--name-'   

>--+----------------+--+---------------+------------------------>
   '-STORCLAS--name-'  +-RETPD integer +   
                       '-EXPDL' date'--'   

>--+-------------------------+--+-----------------+------------->
   |            .-,------.   |  '-VOLCNT--integer-'   
   |            V        |   |                        
   '-VOLUMES--(---volser-+-)-'                        

                       .-GDGLIMIT--99------.   
>--+----------------+--+-------------------+-------------------->
   '-UNCNT--integer-'  '-GDGLIMIT--integer-'   

>--+-----------------------------------------------------+------>
   '-DISP--(--+-NEW-+--,--+-DELETE--+--,--+-DELETE--+--)-'   
              +-OLD-+     +-KEEP----+     +-KEEP----+        
              +-SHR-+     +-CATLG---+     +-CATLG---+        
              '-MOD-'     '-UNCATLG-'     '-UNCATLG-'        

>--+--------------------------------+--+----------------+------><
   '-LIMIT(n-+-CYL-+-,new_template)-'  '-TIME-+-LOCAL-+-'   
             +-GB--+                          '-UTC---'     
             '-MB--'                                        

disk-options:

   .-SPACE--CYL------------------------------.   
>>-+-----------------------------------------+------------------>
   '-SPACE--+---------------------+--+-CYL-+-'   
            '-(primary,secondary)-'  +-TRK-+     
                                     '-MB--'     

   .-PCTPRIME--100-----.                          
>--+-------------------+--+-------------------+----------------->
   '-PCTPRIME--integer-'  '-MAXPRIME--integer-'   

   .-NBRSECND--10------.                     
>--+-------------------+--+--------------+---------------------->
   '-NBRSECND--integer-'  '-DIR--integer-'   

>--+----------------------+--+-------+-------------------------><
   '-DSNTYPE--+-LIBRARY-+-'  '-EATTR-'   
              +-PDS-----+                
              +-HFS-----+                
              '-NULL----'                

tape-options:

   .-STACK--NO--.  .-TRTCH--NONE-------.   
>>-+------------+--+-------------------+-----------------------><
   '-STACK--YES-'  '-TRTCH--+-COMP---+-'   
                            '-NOCOMP-'     

SUBSYS-spec

>>-SUBSYS--name--LRECL--int--RECFM--+-F--+---------------------><
                                    +-FB-+   
                                    +-V--+   
                                    '-VB-'   

path-expression

>>-PATH--pathname----------------------------------------------->

   .-FILEDATA--RECORD--RECFM--VB--LRECL--32756-------.   
>--+-------------------------------------------------+---------->
   '-FILEDATA--+-TEXT---+--RECFM--+-VB-+--LRECL--int-'   
               '-BINARY-'         +-V--+                 
                                  +-FB-+                 
                                  '-F--'                 

                            (1)                 
   .-PATHOPTS--(--+-ORDONLY------------+--)-.   
   |              |                (2) |    |   
   |              '-OCREAT,OWRONLY-----'    |   
>--+----------------------------------------+------------------->
   |              .-,-------------.         |   
   |              V .-ORDONLY---. |         |   
   '-PATHOPTS--(----+-OCREAT----+-+--)------'   
                    +-OWRONLY---+               
                    '-ONONBLOCK-'               

   .-PATHMODE--(SIRUSR)-------------.   
>--+--------------------------------+--------------------------->
   |              .-,----------.    |   
   |              V            |    |   
   '-PATHMODE--(----+-SIRUSR-+-+--)-'   
                    +-SIWUSR-+          
                    +-SIXUSR-+          
                    +-SIRWXU-+          
                    +-SIRGRP-+          
                    +-SIWGRP-+          
                    +-SIXGRP +          
                    +-SIRWXG-+          
                    +-SIROTH-+          
                    +-SIWOTH-+          
                    +-SIXOTH-+          
                    '-SIRWXO-'          

   .-PATHDISP--(KEEP,KEEP)---------------------.   
>--+-------------------------------------------+---------------><
   '-PATHDISP--(--+-KEEP---+--,--+-KEEP---+--)-'   
                  '-DELETE-'     '-DELETE-'        

Notes:
  1. For LOAD, the default is PATHOPTS(ORDONLY).
  2. For UNLOAD, the default is PATHOPTS(OCREAT,OWRONLY).

Option descriptions

TEMPLATE template-name
Defines a data set allocation template and assigns to the template a name, template-name, for subsequent reference on a DB2® utility control statement. The template-name can have up to eight alphanumeric characters and must begin with an alphabetic character.

Start of changetemplate-name cannot be UTPRINT or SORTLIB, and cannot begin with SORTWK or SYS.End of change

The template-name is followed by keywords that control the allocation of tape and disk data sets. A single TEMPLATE statement cannot have both disk options and tape options. The UNIT keyword specifies a generic unit name that is defined on your system. This value is used to determine if a disk or tape data set is being allocated. All other keywords specified on the TEMPLATE control statement must be consistent with the specified unit type.

DSN name-expression
Specifies the template for the z/OS® data set name. You can specify the data set name, name-expression, by using symbolic variables, non-variable alphanumeric, or national characters, or any combination of these characters. The resulting name must adhere to the z/OS data set naming rules, including those rules about name length, valid characters, name structure and qualifier length. You must specify a DSN expression that is unique for each data set allocated by the utility and to each invocation of the utility.

Start of changeTemplates for FlashCopy® image copies should specify only DSN name-expression. DB2 does not use any other options in a TEMPLATE control statement for FlashCopy image copies.End of change

Data set names consists of a series of qualifiers, qualifier-expression, that are separated by a period (.) and an optional parenthetical expression. No imbedded blanks are allowed. A partitioned data set (PDS) cannot be defined by TEMPLATE for use as an input data set.

If the DSN name operand contains any special characters, it must be enclosed in single quotation marks. For example, in the following TEMPLATE statement, the DSN operand contains the parentheses special character, so the entire operand is enclosed in single quotation marks:

TEMPLATE X DSN 'A.GDG.VERSION(+1)'

Parentheses around the DSN name operand are optional. They are used in the following DSN specification:

DSN(&DB..&TS..D&DATE.)
character-expression
Specifies the data set name or part of the data set name by using non-variable alphanumeric or national characters.
parenthetical-expression
Specifies part of the data set name by using non-variable alphanumeric or national characters that are enclosed in parentheses. For example, the expressions Q1.Q2.Q3(member) and Q1.Q2.Q3(+1) use valid parenthetical expressions. No variable substitution is performed within the parenthetical expression.
&variable.
Specifies the data set name or part of the data set name by using symbolic variables. See the following tables for a list of variables that can be used.

Each symbolic variable is substituted with its related value at execution time to form a specific data set name. When used in a DSN expression, substitution variables begin with an ampersand sign (&) and end with a period (.), as in the following example:

DSN &DB..&TS..D&JDATE..COPY&ICTYPE.

Using numeric variables alone generates an invalid data set qualifier for all numeric-type variables (all date or time-type variables, and others, such as &SEQ. or &PART.). These variables must be preceded by character constants to form valid DSN qualifiers. The following examples are valid specifications:

P&PART.
D&DATE.

Some substitution variables are invalid if you use TEMPLATE with an incompatible utility. For example, ICTYPE is not meaningful if the TEMPLATE statement is used with LOAD SYSDISC. Other variables assume default values when their values are not known. For example, &PART. becomes 00000 for non-partitioned objects.

You can also use substring notation for data set name variables. This notation can help you keep the data set name from exceeding the 44 character maximum. If you use substring notation, the entire DSN operand must be enclosed in single quotation marks. To specify a substring, use the form &variable(start). or &variable(start,length).

start
Specifies the substring's starting byte location within the current variable base value at the time of execution. start must be an integer from 1 to 128.
length
Specifies the length of the substring. If you specify start but do not specify length, length, by default, is the number of characters from the start character to the last character of the variable value at the time of execution. For example, given a five-digit base value, &PART(4). specifies the fourth and fifth digits of the value. length must be an integer that does not cause the substring to extend beyond the end of the base value.

Start of changeFor UNLOAD on a partitioned table space, if you use substring notation for the partition variable (&PART. or &PA.) in the DSN argument, the data set name might not be unique for all partitions, so DB2 cannot do parallel UNLOAD operations for the partitions. Therefore, DB2 sets the value of &PA to '00000', and uses a single UNLDDN data set for all partitions. This action might cause duplicate data set errors on subsequent UNLOAD jobs for other partitions of the same table space.End of change

The following table contains a list of JOB variables and their descriptions.

Table 1. JOB variables
Variable Description
&JOBNAME. or &JO. The z/OS job name.
&STEPNAME. or &ST. The z/OS step name. This variable might be needed if data set names from two different job steps conflict.
&USERID. or &US. The user ID of the person that is running the utility. The value is 1 to 8 characters long.
&UTILID. or &UT. The utility ID truncated to eight characters and checked for invalid DSN characters.
&SSID. or &SS. Start of changeSubsystem ID (non-data sharing) or group attachment name (data sharing).End of change

The following table contains a list of UTILITY variables and their descriptions.

Table 2. UTILITY variables
Variable Description
&ICTYPE. or &IC. Single-character image copy type. This variable is valid only for image copy templates. The substitution is governed by whether a full image copy (F), an incremental image copy (I), or a CHANGELIMIT image copy (C) is specified by the user.
&UTILNAME. or &UN. Special values are assigned to some utilities: CHECKD for CHECK DATA, CHECKI for CHECK INDEX, CHECKL for CHECK LOB, REORGI for REORG INDEX, and REORGT for REORG TABLESPACE. Utility names that are longer than eight characters are truncated to eight characters.
&SEQ. or &SQ. Start of changeSequence number of the LISTDEF list item being processed.End of change
&LOCREM. or &LR. Indicator of whether ddname is for the local site (COPYDDN) or the recovery site (RECOVERYDDN). Single character L is used when the utility defines a COPYDDN ddname. The single character R is used when the utility defines a RECOVERYDDN ddname. You can replicate the SYSCOPY ICBACKUP column information by using both the &LOCREM. and &PRIBAC. variables. This variable is valid only for image copy templates.
&PRIBAC. or &PB. Indicator of whether ddname is for the primary (ddname1) or backup (ddname2) copy data set. Single character P is used when the utility defines a ddname1. The single character B is used when the utility defines a ddname2. You can replicate the SYSCOPY ICBACKUP column information by using both the &LOCREM. and &PRIBAC. variables. This variable is valid only for image copy templates.

The following table contains a list of OBJECT variables and their descriptions.

Table 3. OBJECT variables
Variable Description
&LIST. or &LI. The name of the list that is defined by using the LISTDEF control statement and that is referenced on the same control statement as this TEMPLATE. This variable is used with COPY FILTERDDN templates. All objects in the list are copied to one data set, which makes &TS. and &IS. meaningless.
&DB. Database name.
&TS.1 Table space name.
&IS. 1 Index space name.
&SN.1 Space name (table space or index space).
Start of change&PART. or &PA.2, 3, 4End of change Five-digit partition number, padded with leading zeros.
Start of change&DSNUM3, 4End of change Five-digit partition number for partitioned objects, or five-digit piece number for linear objects, padded with leading zeroes.
Note:
  1. When you specify the &TS., &IS., or &SN. variables in a template that is used by an UNLOAD statement with BLOBF, CLOBF, or DBCLOBF, DB2 substitutes the name of the table space that stores the LOB column value, not the base table space name. This substitution enables DB2 to generate unique data set names for each LOB column with partitioned table spaces.
  2. Use the &PA. variable when processing LISTDEF lists with the PARTLEVEL keyword or data-partitioned secondary indexes. Otherwise, DB2 could generate duplicate data set names.
  3. Start of changeTemplates for FlashCopy image copies can contain either &PART or &DSNUM. If you are copying both partitioned and linear objects, use &DSNUM. End of change
  4. Start of changeFlashCopy image copies are always made at the partition or piece level. This behavior occurs even if you request FlashCopy image copies with DSNUM ALL on your COPY utility statement or include them in a LISTDEF list without the PARTLEVEL keyword. Therefore, for templates with the &PART., &PA., or &DSNUM. variables for FlashCopy image copies, the number and names of data sets that result might differ from the result when the same templates are used by other utilities. The result might also differ from the data set names that are displayed when you preview the templates. (For information about previewing templates, see Key TEMPLATE operations.)End of change

The following table contains a list of DATE and TIME variables. and their descriptions.

Table 4. DATE and TIME variables
Variable Description
&DATE. or &DT. YYYYDDD
&TIME. or &TI. HHMMSS
&JDATE. or &JU. YYYYDDD
&YEAR. or &YE. YYYY portion of &DATE.
&MONTH. or &MO. MM
&DAY. or &DA. DD
&JDAY. or &JD. DDD portion of &DATE.
&HOUR. or &HO. HH portion of &TIME.
&MINUTE. or &MI. MM portion of &TIME.
&SECOND. or &SC. SS portion of &TIME.
&UNIQ. or &UQ. Unique eight characters that DB2 derives from the system clock at the time of allocation. This set of characters begins with an alphabetical character and is followed by seven alphabetical or numeric characters.
Note: Start of changeDate and time values are set with the STCK instruction. The value is in local time or Coordinated Universal Time (UTC) depending on the TIME option or TEMPLATE_TIME subsystem parameter. Except for the&UNIQ. and &UQ. variables, DATE and TIME values are captured in the UTILINIT phase of each utility and remain constant until the utility terminates. &UNIQ. and &UQ. are assigned a unique value for each allocation.End of change
SUBSYS name
Specifies the MVS™ BATCHPIPES SUBSYSTEM name. The SUBSYS operand must be a valid BATCHPIPES SUBSYSTEM name and must not exceed eight characters in length. When SUBSYS is specified, LRECL and RECFM are required. When SUBSYS is specified, TEMPLATE keywords that are not compatible with SUBSYS (such as UNIT) are ignored.
Restriction: When using BATCHPIPES, TEMPLATE with the SUBSYS keyword, the utility cannot be restarted and the LOAD DISCARDDN keyword is not supported.
LRECL int
Specifies the record length of the MVS BATCHPIPES SUBSYSTEM file or z/OS UNIX file. You must specify LRECL if you specify SUBSYS.

LRECL does not have a default value except in the following situation: If you specify TEMPLATE PATH and accept the default value FILEDATA RECORD, the default value for LRECL is 32756.

RECFM
Specifies the record format of the MVS BATCHPIPES SUBSYSTEM file or z/OS UNIX file. You must specify RECFM if you specify SUBSYS.

Valid values for RECFM are F, FB, V, or VB

RECFM does not have a default value except in the following situation: If you specify TEMPLATE PATH and accept the default value FILEDATA RECORD, the default value for RECFM is VB.

UNIT
Specifies the device-number, device-type (generic), or group-name for the data set. All other TEMPLATE keywords are validated based on the specified type of unit (disk or tape).

The default value is SYSALLDA.

MODELDCB dsname
Specifies the name of the data set on which the template is based. DCB information is read from this model data set.
BUFNO integer
Specifies the number of BSAM buffers. The specified value must be in the range from 0 to 99.

The default value is 30.

DATACLAS name
Specifies the SMS data class. The name value must be a valid SMS data class and must not exceed eight characters in length.

The data set is cataloged if DATACLAS is specified. If this option is omitted, no DATACLAS is specified to SMS.

MGMTCLAS name
Specifies the SMS management class. The name value must be a valid SMS management class and must not exceed eight characters in length.

The data set is cataloged if MGMTCLAS is specified. If this option is omitted, no MGMTCLAS is specified to SMS.

STORCLAS name
Specifies the SMS storage class. The name value must be a valid SMS storage class and must not exceed eight characters in length.

The data set is cataloged if STORCLAS is specified. If this option is omitted, no STORCLAS is specified to SMS.

RETPD integer
Specifies the retention period in days for the data set. The integer value must be in the range from 0 to 9999.

If DATACLAS, MGMTCLAS, or STORCLAS is specified, the class definition might control the retention. RETPD cannot be specified with EXPDL.

EXPDL 'date'
Specifies the expiration date for the data set, in the form YYYYDDD, where YYYY is the four-digit year, and DDD is the three-digit Julian day. The 'date' value must be enclosed by single quotation marks.

If DATACLAS, MGMTCLAS, or STORCLAS is specified, the class definition might control the retention. EXPDL cannot be specified with RETPD.

VOLUMES (vol1,vol2,...)
Specifies a list of volume serial numbers for this allocation. If the data set is not cataloged the list is truncated, if necessary, when it is stored in SYSIBM.SYSCOPY. The specified number of volumes cannot exceed the specified or default value of VOLCNT.

The first volume must contain enough space for the primary space allocation.

If an individual volume serial-number contains leading zeros, it must be enclosed in single quotation marks.

VOLCNT (integer)
Specifies the maximum number of volumes that an output data set might require. The specified value must be between 0 and 255.

The default value for tape templates is 95. For disk templates, the utility does not set a default value. Operating system defaults apply.

UNCNT integer
Specifies the number of devices that are to be allocated. The specified value must in the range from 0 to 59.

If UNIT specifies a specific device number, the value of UNCNT must either be 1 or be omitted.

GDGLIMIT (integer)
Specifies the number of entries that are to be created in a GDG base if a GDG DSN is specified and the base does not already exist. If a GDG base does not already exist and you do not want to define one, specify a GDGLIMIT of zero (0).

Start of changeThe default value is 99. The minimum value is 0. The maximum value depends on the z/OS release on which the subsystem is being executed. For z/OS V2R1 or earlier, the maximum value is 255. For z/OS V2R2 or later, the maximum value is 999. Before using values that are greater than 255, check with your database administrator or system programmer to ensure that GDGEXTENDED(YES) is specified in SYS1.PARMLIB(IGGCATxx). Otherwise, values that are greater than 255 will fail during allocation.End of change

DISP (status, normal-termination, abnormal-termination)
Specifies the data set disposition by using three positional parameters: status, normal-termination, and abnormal-termination. All three parameters must be specified.
status
Standard z/OS values are allowed: NEW, OLD, SHR, MOD.
normal-termination
Standard z/OS values are allowed: DELETE, KEEP, CATLG, UNCATLG.
abnormal-termination
Standard z/OS values are allowed: DELETE, KEEP, CATLG, UNCATLG.

Default values for DISP vary, depending on the utility and the data set that is being allocated. Defaults for restarted utilities also differ from default values for new utility executions. Default values are shown in the following tables.

The following table shows the data dispositions for dynamically allocated data sets for new utility executions.

Note: It is possible that output from utilities that use piped data would not be dynamically allocated for new utility executions.
Table 5. Data dispositions for dynamically allocated data sets for new utility executions
ddname CHECK DATA CHECK INDEX or CHECK LOB COPY COPY- TOCOPY LOAD MERGE- COPY REBUILD INDEX REORG INDEX REORG TABLE- SPACE UNLOAD
SYSREC Ignored Ignored Ignored Ignored OLD KEEP KEEP Ignored Ignored Ignored NEW CATLG CATLG NEW CATLG CATLG
SYSDISC Ignored Ignored Ignored Ignored NEW CATLG CATLG Ignored Ignored Ignored NEW CATLG CATLG Ignored
SYSPUNCH Ignored Ignored Ignored Ignored Ignored Ignored Ignored Ignored NEW CATLG CATLG NEW CATLG CATLG
SYSCOPY Ignored Ignored NEW CATLG CATLG Ignored NEW CATLG CATLG NEW CATLG CATLG Ignored Ignored NEW CATLG CATLG Ignored
SYSCOPY2 Ignored Ignored NEW CATLG CATLG Ignored NEW CATLG CATLG NEW CATLG CATLG Ignored Ignored NEW CATLG CATLG Ignored
SYSRCPY1 Ignored Ignored NEW CATLG CATLG Ignored NEW CATLG CATLG NEW CATLG CATLG Ignored Ignored NEW CATLG CATLG Ignored
SYSRCPY2 Ignored Ignored NEW CATLG CATLG Ignored NEW CATLG CATLG NEW CATLG CATLG Ignored Ignored NEW CATLG CATLG Ignored
SYSUT1 NEW DELETE CATLG NEW DELETE CATLG Ignored Ignored NEW DELETE CATLG Ignored NEW DELETE CATLG NEW CATLG CATLG NEW DELETE CATLG Ignored
SORTOUT NEW DELETE CATLG Ignored Ignored Ignored NEW DELETE CATLG Ignored Ignored NEW DELETE CATLG NEW DELETE CATLG Ignored
SYSMAP Ignored Ignored Ignored Ignored NEW CATLG CATLG Ignored Ignored Ignored Ignored Ignored
SYSERR NEW CATLG CATLG Ignored Ignored Ignored NEW CATLG CATLG Ignored Ignored Ignored Ignored Ignored
FILTERDDS Ignored Ignored NEW DELETE DELETE Ignored Ignored Ignored Ignored Ignored Ignored Ignored

The following table shows data dispositions for dynamically allocated data sets on RESTART.

Table 6. Data dispositions for dynamically allocated data sets on RESTART
ddname CHECK DATA CHECK INDEX or CHECK LOB COPY COPY- TOCOPY LOAD MERGE- COPY REBUILD INDEX REORG INDEX REORG TABLE- SPACE UNLOAD
SYSREC Ignored Ignored Ignored Ignored OLD KEEP KEEP Ignored Ignored Ignored MOD CATLG CATLG MOD CATLG CATLG
SYSDISC Ignored Ignored Ignored Ignored MOD CATLG CATLG Ignored Ignored Ignored MOD CATLG CATLG Ignored
SYSPUNCH Ignored Ignored Ignored Ignored Ignored Ignored Ignored Ignored MOD CATLG CATLG MOD CATLG CATLG
SYSCOPY Ignored Ignored MOD CATLG CATLG Ignored MOD CATLG CATLG MOD CATLG CATLG Ignored Ignored MOD CATLG CATLG Ignored
SYSCOPY2 Ignored Ignored MOD CATLG CATLG Ignored MOD CATLG CATLG MOD CATLG CATLG Ignored Ignored MOD CATLG CATLG Ignored
SYSRCPY1 Ignored Ignored MOD CATLG CATLG Ignored MOD CATLG CATLG MOD CATLG CATLG Ignored Ignored MOD CATLG CATLG Ignored
SYSRCPY2 Ignored Ignored MOD CATLG CATLG Ignored MOD CATLG CATLG MOD CATLG CATLG Ignored Ignored MOD CATLG CATLG Ignored
SYSUT1 MOD DELETE CATLG MOD DELETE CATLG Ignored Ignored MOD DELETE CATLG Ignored MOD DELETE CATLG MOD CATLG CATLG MOD DELETE CATLG Ignored
SORTOUT MOD DELETE CATLG Ignored Ignored Ignored MOD DELETE CATLG Ignored Ignored MOD DELETE CATLG MOD DELETE CATLG Ignored
SYSMAP Ignored Ignored Ignored Ignored MOD CATLG CATLG Ignored Ignored Ignored Ignored Ignored
SYSERR MOD CATLG CATLG Ignored Ignored Ignored MOD CATLG CATLG Ignored Ignored Ignored Ignored Ignored
FILTERDDS Ignored Ignored NEW DELETE DELETE Ignored Ignored Ignored Ignored Ignored Ignored Ignored
LIMIT
Specifies template switching.
n
Specifies the maximum primary allocation quantity that is permitted using this TEMPLATE.
CYL
Cylinders
GB
Gigabytes
MB
Megabytes
new_template
Specifies a character string that specifies the name of a TEMPLATE to use if the size limit is exceeded.

DB2 supports the LIMIT keyword only on TEMPLATE control statements reference by COPYDDN or RECOVERYDDN keywords on the following utilities:

  • COPY FULL YES|NO
  • COPY CONCURRENT
  • COPYTOCOPY
  • MERGECOPY
  • LOAD
  • REORG
Restriction:
  • You cannot switch to a DD card.
  • The template control statement that LIMIT references must exist in SYSIN or SYSTEMPL and it cannot refer to itself.
  • Switching can only be performed a single time per allocation. Multiple switching cannot take place.
  • The utility PREVIEW function ignores the LIMIT keyword, only the original TEMPLATE control statement is previewed. The LIMIT keyword is ignored for new templates.
Start of changeTIMEEnd of change
Start of changeSpecifies time used in expansion of date and time DSN variables. The default TIME value is determined by the TEMPLATE_TIME subsystem parameter.
Tip: Set all DB2 data sharing members to the same value.
LOCAL
Use local time at the DB2 server in the expansion of date and time in DSN variables.
UTC
Use Coordinated Universal Time (UTC) in the expansion of date and time in DSN variables.
End of change
SPACE (primary,secondary)
Specifies the z/OS disk space allocation parameters in the range from 1 to 1677215. If you specify (primary,secondary) value, these values are used instead of the DB2-calculated values. When specifying primary and secondary quantities, you must either specify both values or omit both values.

Use the MAXPRIME option to set an upper limit on the primary quantity.

CYL
Specifies that allocation quantities, if present, are to be expressed in cylinders and that allocation is to occur in cylinders. If SPACE CYL is specified, without (primary, secondary), the DB2-calculated quantities are allocated in cylinders by using 3390 device capacities for byte conversion. If TRK and MB are omitted, CYL is the default.
TRK
Specifies that allocation quantities, if present, are to be expressed in tracks and that allocation is to occur in tracks. If SPACE TRK is specified, without (primary,secondary), the DB2-calculated quantities are allocated in tracks by using 3390 device capacities for byte conversion.
MB
Specifies that allocation quantities, if present, are to be expressed in megabytes, and that allocation is to occur in records. One megabyte is 1 048 576 bytes. If SPACE MB is specified, the (primary,secondary) quantities that are specified, or the DB2-calculated quantities, might be allocated in tracks or cylinders. Data sets with a primary or secondary allocation quantity greater than 20 MB are allocated in cylinders. Smaller data sets are allocated in tracks. The 3390 device capacities are used for TRK or CYL conversion.
PCTPRIME integer
Specifies the percentage of the estimated required space that is to be obtained as the primary quantity.

The default value is 100.

Use the MAXPRIME option to set the upper limit of this value for large objects.

MAXPRIME integer
Specifies the maximum allowable primary space allocation, expressed in cylinders (CYL). This value constrains the primary space value and the PCTPRIME calculation, as well as the size of each secondary allocation.
NBRSECND integer
Start of changeSpecifies the division of secondary space allocations. After the primary space is allocated, an amount of space equal to the estimated required space is divided into the specified number of secondary allocations. Individual utilities might request larger secondary extents to compensate for localized uncertainty in the space estimations.

The integer value must be in the range from 1 to 10. The default value is 10.

End of change
DIR integer
Specifies the number of 256-byte records that are to be allocated for the directory of a new partitioned data set. You must specify this operand if you are allocating a new partitioned data set.

If the template is being used in a UNLOAD statement with BLOBF, CLOBF, or DBCLOBF and you specify a DSNTYPE of LIBRARY or PDS, but do not specify DIR, DB2 calculates the number of 256-byte records to allocate by dividing the estimated number of records by 20.

DSNTYPE

Specifies the type of data set to be allocated.

LIBRARY
Specifies that a partitioned data set extended (PDSE) is to be allocated.
PDS
Specifies that a partitioned data set (PDS) is to be allocated.
HFS
Specifies that a hierarchical file system (HFS) file is to be allocated.
NULL
Specifies a null file. Use this value for a template with UNLOAD CLOBF, BLOBF, or DBCLOBF to unload a null LOB value. In this case, the unload data set contains a null file name.

If you omit DSNTYPE, the type of data set is determined by other data set attributes, the data class for the data set, or an installation default.

EATTR
Specifies that the data set can support extended attributes.
STACK
Specifies whether output data sets are to be stacked contiguously on the same tape volumes.
NO
Specifies that output data sets are not to be stacked contiguously on tape.
YES
Specifies that similar output data sets are to be stacked as successive files on one logical tape volume, where a logical tape volume can consist of a multi-volume aggregate. Within one utility execution, output data sets are stacked on a logical tape volume of the same usage type. For example, local primary image copies are stacked separately from local backup image copies.
TRTCH
Specifies the track recording technique for magnetic tape drives that have improved data recording capability.
NONE
Specifies that the TRTCH specification is to be eliminated from dynamic allocation.
COMP
Specifies that data is to be written in compacted format.
NOCOMP
Specifies that data is to be written in standard format.
PATH
Start of changeSpecifies a z/OS UNIX file path name, which can be the name of a Unix System Services (USS) pipe, an HFS file, or a zFS file.
Restrictions:
  • If you specify PATH for a template, the utility that uses that template cannot be restarted.
  • You can use a template with PATH only for input data sets for the LOAD utility (as indicated by the INDDN option) and for output data sets for the UNLOAD utility (as indicated by the UNLDDN option). You cannot use these templates for DISCARDDN data sets for the LOAD and REORG utilities.

When you specify PATH, adhere to the following requirements:

  • Specify the path name in SBCS EBCDIC format.
  • Do not specify a path name that is longer than 255 bytes.
  • If the path name contains blanks, enclose it in single quotes.
  • If you specify PATH and do not specify FILEDATA(RECORD), specify values for LRECL and RECFM.
FILEDATA
Specifies the content type of the z/OS UNIX file that is specified for the PATH option. Valid values are TEXT, BINARY, and RECORD. RECORD indicates that the file contains both binary and text data.

The default value is RECORD.

PATHOPTS
Specifies the access and status for the z/OS UNIX file that is specified for the PATH option.

You can specify one or more of the following z/OS options for PATHOPTS:

  • ORDONLY
  • OCREAT
  • OWRONLY
  • ONONBLOCK

For information about these options, see PATHOPTS Parameter.

The default for LOAD is ORDONLY. The default for UNLOAD is OCREAT, OWRONLY.

PATHMODE
Specifies the file mode of the HFS file that is specified in the PATH option.
You can specify one or more of the following z/OS options for PATHMODE:
  • SIRUSR
  • SIWUSR
  • SIXUSR
  • SIRWXU
  • SIRGRP
  • SIWGRP
  • SIXGRP
  • SIRWXG
  • SIROTH
  • SIWOTH
  • SIXOTH
  • SIRWXO

For information about these options, see PATHMODE Parameter.

The default value is SIRUSR.

PATHDISP
Specifies the disposition of the z/OS UNIX file that is specified for the PATH option.
You must specify two parameters for the PATHDISP:
  • The first parameter specifies whether the file is to be kept or deleted when the job ends normally.
  • The second parameter specifies whether the file is to be kept or deleted when the job ends abnormally.

The valid values for each parameter are KEEP or DELETE.

The default value is KEEP, KEEP.

End of change