Cast data format specifications—Data extract expressions


A cast specifies the starting location, length, and basic data type of a field or portion of a segment.

Data format specifications are an extension to casts which provide additional information to the expression processor about the value in a field. Format specifications are required when the variable being accessed contains a date or a time value.

A data format specification can be applied to:

  • Any of the decimal data types (packed, unsigned, or zoned)
  • The character data type (assuming that the value consists solely of decimal digits)
  • The fixed binary data type

The data format specification is coded as a percent sign (%) followed immediately by the format specification. There are no intervening spaces.

The data format is coded following the character identifying the basic data type in a cast. If the data type is not specified (for example, allowed to default to either character or the data type defined for a field from the DBDGEN), it can be coded following the length specification of the cast. If a cast is not coded for a field, the data format specification can be coded immediately following the field name. In any case, spaces can be coded as desired to improve readability.

The length of the field or portion of a segment identified by a cast must agree exactly with the number of decimal digits indicated by the data format specification.

Date formats

Date formats are used to tell the expression processor the structure of a date value. The following date format specifications are currently defined:

  • yyyymmdd
  • yymmdd
  • ddmmyyyy
  • ddmmyy
  • mmddyyyy
  • mmddyy
  • yyyyddd
  • yyddd

The variables have the following meanings:

  • dd (two digit day of the month)
  • ddd (three digit Julian day of the year)
  • mm (designates a two digit month)
  • yy (designates a two digit year)
  • yyyy (designates a four digit year)
Information
Example
START(1:5P %yyyymmdd)
HISTORY(17:5C %yyddd)
ENDDATE%mmddyyyy

Time formats

Time formats are used to tell the expression processor the structure of a time value. The following time format specifications are currently defined:

  • hhmmss
  • hhmm
  • hhmmssf
  • hhmmssff

The variables have the following meanings:

  • f (one digit 10th of a second)
  • ff (two digit 100th of a second)
  • hh (two digit hour)
  • mm (two digit minute)
  • ss (two digit second)
Information
Example
INTERVAL %hhmmssff
QUITTIME %hhmm

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI Online Reorg for IMS 5.2