Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 8 Managing VSAM Data Definitions : Task E: Define Fields

Task E: Define Fields
This task is used to define the external VSAM attributes and the internal TIBCO Object Service Broker attributes for the primary key fields and data fields of the table.
The Field Definition Segment
The following example illustrates the fields used to define the fields of the VSAM table:

 
------- VSAM --------|--------- Metadata Definition ------
Field Name Xsyn Xlen Xdec Offset Key Typ Syn Len Dec Ord Rqd Default
---------------- ---- ----- -- ----- - - -- ----- --- - - ----------
_ KEY B 2 0 0 P I B 2 0
_ DEPTNO B 4 0 2 I B 4 0
_ DEPTNAME C 9 0 6 S C 9 0
_

 
Considerations
Note the following when defining a VSAM table:
When defining fields you can type in external VSAM attributes and the TIBCO Object Service Broker attributes default to the external values, or vice versa.
The number of fields you can access is dependent upon the Data Object Broker parameter CTABLESIZE. You can use the ESTIMATETBLDFN tool to estimate the size of the parameter.
Specifying External VSAM Attributes
The following fields are used to specify the external VSAM attributes. Use FP1 for valid values for each field.
 
This field contains the name of the VSAM field that must be unique within the table definition. You can use a field name that already exists in any other table; if you are moving data between this table and another table, giving fields the same names simplifies the process.
This field contains the external syntax for the VSAM field. If Xsyn is not specified, it defaults to the specified TIBCO Object Service Broker syntax (Syn field). For information on external syntax, refer to Appendix A, Mapping Data Types.
This field contains the external length for the VSAM field. If Xlen is not specified, it defaults to the specified TIBCO Object Service Broker length (Len field). For information on external lengths, refer to Appendix A, Mapping Data Types.
This field indicates the external number of decimal places for the VSAM field. If Xdec is not specified, it defaults to the specified TIBCO Object Service Broker number of decimal places (Dec field).
This field specifies the offset. The offset maps to the start of the external record relative to the VSAM field. The origin is zero. Overlaps are allowed for read-only tables and you do not need to define fillers, since the offset can be used to skip undefined locations in the row. You can specify offsets in one of three ways:
If all offsets are unspecified and you want the offsets calculated from the first field, use PF3 to save the definition; this calculates the offsets.
To calculate the offset from the field where the cursor is located, press PF6 once to verify your intention by reading the message at the bottom of the screen, and a second time to calculate the offsets from that field.
Specifying Internal TIBCO Object Service Broker Attributes
The following fields are used to specify the internal TIBCO Object Service Broker attributes. For each field, use PF1 for a list of valid values. To view additional fields, use PF11.
 
This field indicates if the VSAM fields are to be used as a primary key. You can select any field as the primary key using the P line command, without respect to uniqueness of data. You can select up to 16 contiguous fields for a composite primary key, to a total maximum of 127 bytes.
This field contains the TIBCO Object Service Broker semantic data type of the field. The default is null. You can specify any valid TIBCO Object Service Broker semantic data type and syntax combination supported for the external syntax. For valid combinations, refer to TIBCO Object Service Broker Programming in Rules.
This field contains the TIBCO Object Service Broker syntax of the field. You can specify any valid TIBCO Object Service Broker semantic type and syntax combination supported for the external syntax. For valid combinations, refer to TIBCO Object Service Broker Programming in Rules. If a syntax is not specified, the Syn field defaults to an appropriate syntax based on the external syntax and length (Xsyn and Xlen fields). For more information on external syntax, refer to Appendix A, Mapping Data Types.
Syntaxes F, RD, and UN are not supported for a primary key field. For information on how primary key fields handle numeric syntaxes, refer to Behavior of Numeric Key Fields in VSAM Tables.
This field indicates the length of the VSAM field. The data is padded or truncated as necessary. If a length is not specified, the Len field defaults to an appropriate length based on the external syntax and length (Xsyn and Xlen fields).
This field specifies the number of digits to appear to the right of the decimal point. The data is padded or truncated as necessary. If not specified, the Dec field defaults to the specified external number of decimal places (Xdec field).
Depending on the syntax specified in the Syn field, define this field as follows:
For syntax P, the number of decimal places must be smaller than twice the length of the entire field.
This field indicates the order (ascending or descending) in which the occurrences in this field are sorted. The default is null (unsorted).
This field indicates if the user is required to provide a value for each occurrence in the table. The default is null (not required).
This field contains the default value for the field. If no data is available, the value provided in this field is used. For example, if you specify a dot (.) as the default, it appears for a field that has no values. If you do not specify anything, a blank space appears.
This field displays the name of the global field if you used PF14 to select a field from the @GLOBALFIELDS table.
See Also
TIBCO Object Service Broker Shareable Tools for information on the ESTIMATETBLDFN tool.
TIBCO Object Service Broker Managing Data for information on global fields.
TIBCO Object Service Broker Parameters for more information about the CTABLESIZE Data Object Broker parameter.
Behavior of Numeric Key Fields in VSAM Tables
Unexpected results can occur if a field of syntax B or P is defined as a primary or secondary key field of a VSM table. The results occur because the two numeric syntaxes represent signed values, whereas VSAM key fields are always interpreted as unsigned values. Therefore, records can be placed out of sequence if the data contains both negative and positive values for the key fields. Records are ordered correctly in the following situations:
Example
The key field has semantic type DATE and syntax B, containing dates both before and after January 1, 1980. Dates before January 1, 1980 are represented as negative integers and dates after this date are represented as positive integers. Since VSAM treats all dates as unsigned integers, the dates prior to January 1, 1980 are ordered after January 1, 1980.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved