Flag formats: Using available formats for flag field input and output

For your convenience this section includes some overviews of the varying flag formats. In addition the concept of input and output formats is explained here.

When a flag field is read by the program, its value is translated to one of the logical values true, false, missing or in error. This translation generally varies with the (database) field; an internal knowledge base takes care of this.

The following table lists how the various output formats print these logical values. To see the default format for a field, use the FIELD primary command.

Table 1. Flag output formats
Output format TRUE FALSE MISSING ERROR (or value 3)
BLANK$HDR blank header blank = FALSE
BLANK$NO blank "No" blank = FALSE
BLANK$STR blank string blank = FALSE
BOOLEAN_HEX x'01' x'00' = FALSE = FALSE
FLAG "YES" blank blank "???"
FLAG2NICE "Yes" "No" blank "?"
HDR$BLANK header blank blank = FALSE
OPERUND "YES" "NO" blank "?"
SF "Success" "Failure" blank = FALSE
STR$BLANK string blank blank = FALSE
YESNO "Yes" "No" blank = FALSE
$CASE "ASIS" "UPPER" blank = FALSE
$DOM "NORMAL" "ALL" blank "NONE"
$LOGCMDR "SYSTEM" "NO" blank = FALSE
$NO blank "no" blank = FALSE
$XRFSOFS "FORCE" "NOFORCE" blank = FALSE
$YESNO "YES" "NO" blank = FALSE

Note that BOOLEAN_HEX is the only flag output format that does not print blank for missing, but a zero-valued byte, because the format is intended to produce machine readable output.

Occasionally you might want to display a flag field that the program does not recognize as such. For example, an SMF_FIELD that you defined. When that happens the program uses an input format (translation of input values to logical values) depending on the specified output format. (At this time it is not supported to change the input format independently of the output format).

The following table lists what input values are interpreted as what logical values in this case.

Table 2. Logical values as translated from input values if the input is not a flag field, depending on the effective output format
Output format TRUE FALSE MISSING ERROR (or value 3)
BLANK$HDR first byte x'80' first byte not x'80 input length 0 -
BLANK$NO first byte x'80' or x'01' first byte not (x'80 or x'01') input length 0 -
BLANK$STR first byte x'80' first byte not x'80' input length 0 -
BOOLEAN_HEX first byte x'80' or x'01' first byte not (x'80' or x'01') input length 0 -
FLAG first byte x'80' or x'01' first byte x'00' or x'40' input length 0, or first byte x'FF' first byte anything else
FLAG2NICE first byte x'80' first byte x'40' input length 0, or first byte x'00' first byte anything else
HDR$BLANK first byte x'80' first byte not x'80 input length 0 -
OPERUND first byte x'80' first byte x'40' input length 0, or first byte x'00' or x'10' first byte anything else
SF first byte x'80' first byte not x'80' input length 0 -
STR$BLANK first byte x'80' first byte not x'80' input length 0 -
YESNO first byte x'80' first byte not x'80' input length 0 -
$CASE first byte x'80' first byte not x'80' input length 0 -
$DOM first byte x'80' first byte x'40' input length 0, or first byte anything else first byte x'20'
$LOGCMDR first byte x'80' first byte not x'80' input length 0 -
$NO first byte x'80' or x'01' first byte not (x'80' or x'01') input length 0 -
$XRFSOFS first byte x'80' first byte not x'80' input length 0 -
$YESNO first byte x'80' or x'01' first byte not (x'80' or x'01') input length 0 -

Note that x'80' is always seen as true, x'40' is always seen as false, and a field that is not present is always missing, so if this is appropriate, there is nothing to worry about. Further note that FLAG sees x'FF' as an 'undefined' value (as is usual in e.g. the RACF database).