DSNAME
Unload data sets
You can use any of the symbolic variables in the Symbolic variables for output data set names table to construct names for your unload data sets.
When UNLOAD PLUS resolves the dynamic allocation specification for all of your SELECT statements, the utility generates data set names. UNLOAD PLUS uses the DSNAME value for an assigned output descriptor to determine the number of data sets that UNLOAD PLUS dynamically allocates for a specific SELECT statement. If you allow multiple SELECT statements to share the same output descriptor whose DSNAME value results in a single data set, UNLOAD PLUS creates a dynamically allocated default data set.
Referenced files
For a referenced file, you must specify the fully qualified data set or file system name with the DSNAME option. You can use a pattern with DSNAME as follows:
For DSNTYPE PDS or LIBRARY, you can use a pattern to create your data set names.
For DSNTYPE HFS when you specify DIRECT YES, you can use a pattern to have UNLOAD PLUS create additional subdirectories in your file system path. In the following example, the root portion of the path (/home/rdacxb) already exists and is the mount point for the file system. UNLOAD PLUS adds subdirectories to this path for the subsystem ID and partition number based on the two variables in the DSNAME pattern.
OUTPUT CLOB01 DSNAME('/home/rdacxb/&SSID/p&PART') DSNTYPE(HFS)
Important
When you specify DIRECT NO, specifying a pattern does not result in additional subdirectories in your file system path. UNLOAD PLUS terminates if it cannot find a file system path that uses the name that resolves from your pattern.
Note the following considerations about the name that you specify:
For DSNTYPE PDS or LIBRARY, you cannot specify an existing data set.
You cannot specify a PDS member name or HFS file name. UNLOAD PLUS generates PDS members and HFS files.
Specifying the default
You can specify the default for the DSNAME command option in your installation options module by using the DSNAME installation option. UNLOAD PLUS was shipped with one of the following values for this option:
&USERID.&JOBNAME.&TS.&TYPE.S&SELNUM (for unload data sets)
&USREID.&JOBNAME.&TYPE.S&SELNUM.P&POSNUM (for referenced files)
The command option overrides the default that is in the installation options module.
Using symbolic variables
The Symbolic variables for output data set names table describes the symbolic variables that you can use to construct names for your output data sets.
The maximum total length that UNLOAD PLUS allows for a data set name is 44 bytes. UNLOAD PLUS removes any trailing blanks that result from resolution of a symbolic variable.
Symbolic variables for output data set names
Variable | Definition | Length (bytes) |
---|---|---|
&ATTACH | Db2 group attachment name or subsystem ID | 4 maximum |
Current date (in the format YYMMDD) | 6 | |
Current day (in the format DD) | 2 | |
&DB | Database | 8 |
Current hour (in the format HH) | 2 | |
Current Julian date (in the format YYDDD) | 5 | |
Current Julian day (in the format DDD) | 3 | |
&JOBNAME | Job name | 8 maximum |
Current minute (in the format MM) | 2 | |
Current minute (in the format MM) | 2 | |
Current month (in the format MM) | 2 | |
&OBID1 | OBID of the table that UNLOAD PLUS is unloading | 4 bytes maximum |
Data set or partition that UNLOAD PLUS is unloading Important Note the following information about &PART:
| 3 bytes in either of the following circumstances:
4 bytes for partitions 1000 through 4096 when unloading from a partitioned table space | |
&POSNUM1 | Position number of the XML or LOB column within the select list (valid only for referenced file data sets) | 3 |
Current second (in the format SS) | 2 | |
Current second (in the format SS) | 2 | |
&SELNUM1 | SELECT statement number | 3 |
&SSID | Db2 subsystem ID | 4 |
&STEPNAME | Step name UNLOAD PLUS ignores PROC names. | 8 maximum |
Current time (in the format HHMMSS) | 6 | |
&TS | Table space | 8 maximum |
&TYPE | Data set type that UNLOAD PLUS is allocating This symbol resolves to a value of SYSREC, SYSRED, or SYSREF (where SYSREF indicates a referenced file). | 6 |
&USERID | Job or TSO user | 7 maximum |
&UTIL | Utility ID Important Note the following information about &UTIL:
| 8 maximum |
Current year (in the format YY) | 2 |
1 You must prefix symbols with a numeric result with one or more alphabetic characters.
2 UNLOAD PLUS assigns values for these variables when the utility allocates the output data set. All dynamically allocated data sets have the same value.
When you specify DIRECT NO and you are using dynamic allocation, UNLOAD PLUS accepts all symbolic variables, but externalizes &OBID and &PART differently from the form in which it externalizes them when you specify DIRECT YES. The resolution of symbolic variables when using DIRECT No table shows resolutions that UNLOAD PLUS provides when you specify DIRECT NO and include these specific symbolic variables in your output descriptor. The example that follows this table illustrates a sample output descriptor.
Resolution of symbolic variables when using DIRECT NO
Symbolic variable | Resolution of variable |
---|---|
&OBID | 000 |
&PART | 000 |
Example of symbolic variables when using DIRECT NO
When you specify DIRECT NO, UNLOAD PLUS resolves the symbolic variables in the following output descriptor
OUTPUT SYSREC DSNAME 'ADU.&DB.&TS.X&OBID.P&PART'
to the following data set name
ADU.DBNAME.TSNAME.X000.P000
Comments
Log in or register to comment.