Built-in variable


A built-in variable is a name that represents a value from data areas provided by the Fast Path/EP product or by IMS, such as the definition of the database, area, or a segment. Such values can be referenced by name and used in an expression as needed.

Related topic

Built-in variables that define a segment can optionally be qualified by using a segment name, as in the following:

     [segment-name .]variable

An example expression that includes a segment name definition, followed by a built-in variable follows:

     OUTPUT SEGMENT=SEGB,FIELDS=(SEGA.SEGMENT_CODE,3:*)

If no segment qualification is specified, a default segment is implied. The default segment is identified elsewhere, normally using the SEGMENT keyword. So if SEGA was not specified, then SEGB would be used as shown in the above example.

Built-in variables that are available for use within expressions are shown in the following table:

Important

The default for these variables is local time.


Built-in variable name

Data- type

Description

Usage availability/limitations

Common Variables

AREA_NAME

8C

Area DDname

Available for all expression types

AREA_NUMBER

1X

Area number

Available for all expression types

DBD_AREAS

2F

Number of areas defined in DBD

Available for all expression types

DBD_LEVELS

2F

Number of segment levels defined in DBD

Available for all expression types

DBD_NAME

8C

DBD member name

Available for all expression types

DBD_SEGMENTS

2F

Number of segments defined in DBD

Available for all expression types

RUNDATE1

4X

Date that the program began execution

Available for all expression types

RUNDATETIME1

12X

Date and time the program began execution

Available for all expression types

RUNTIME1

4X

Time the program began execution

Available for all expression types

TODAY1

4X

Alias of RUNDATE

Available for all expression types

Segment Definition Variable

SEGMENT_CKEY

n1C2

Concatenated key for current segment

Not available for expressions that define:

  • Database-level header records
  • Area-level header records
  • Database-level trailer records
  • Area-level trailer records





SEGMENT_CODE

1X

Segment code

SEGMENT_LEVEL

1X

Segment hierarchical level

SEGMENT_NAME

8C

Segment name

SEGMENT_LENGTH

2F

Length of segment

The DATE_TIME_FORMAT keyword does not apply to this variable.

The maximum length for a concatenated key is computed using the DBD definition. The length specified includes a 2-byte prefix containing the current length of the character string (fixed point binary). This format matches the format used by the PL/I programming language.

Format and example of RUNDATE, TODAY, RUNTIME, and RUNDATETIME built-in variables

Built-in variable name

Format

Example

RUNDATE

’yyyydddS’

X’2001163F’

TODAY

’yyyydddS’

X’2001163F’

RUNTIME

’hhmmssth’

X’17171254’

RUNDATETIME

’yyyydddShhmmssthmijuOFF’

X’200163F1717125400000000’


 

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