Field Edit Formats

CA Telon-generated programs perform field edits:

Standard field edit routines and modules

CA Telon supplies a number of standard field edit routines. This appendix documents these routines, the parameters they pass, and the processing they perform.

Customized field edit routines

You can also code your customized edit routines for use at your installation.

Specifying a field edit

In the TDF, you can specify a field edit when you create a panel definition. The value of the FLDTYPE field, appearing on TDF panel field update screens, defines the data type of the application screen field (date, dollar, state code, and so on) and determines the corresponding field edit logic called to validate or format the field.

Standard Field Edit Routines

The following identify valid FLDTYPE values associated with standard field edit routines. In these tables, the data type processed Alpha is defined as PIC X for COBOL and CHAR for PL/I. The data type Numeric is defined as PIC 9 for COBOL and PIC BINARY, or FLOAT for PL/I.

CA Telon Output Edit Routines

FLDTYPE Value

Module Name

Type

Output Edit Action

CAR

OCAR

Alpha

Replaces unprintable characters with a period.

CART

OCART

Alpha

Replaces unprintable characters with a period.

CJULIAN

OCJULIAN

OINTCJUL

Numeric

 

(INTDATE=U ) Converts a date stored in ccyyddd format to the U.S. format of mm/dd/ccyy or mmddccyy, depending on the output field length.

(INTDATE=I) Generates a call to OINTCJUL that converts a date stored in ccyyddd format to the international format of dd/mm/ccyy or ddmmccyy, depending on the output field length.

Note: INTDATE is a parameter in TLNIIS, and the default is U.

CDATE

OCDATE

Numeric

(INTDATE=U ) Converts a date stored in ccyymmdd format to the U.S. format of mm/dd/ccyy or mmddccyy, depending on the output field length.

(INTDATE=I) Generates a call to OINTCDT that converts a date stored in ccyymmdd format to the international format of dd/mm/ccyy or ddmmccyy, depending on the output field length.

Note: INTDATE is a parameter in TLNIIS, and the default is U.

DATE

ODATE

OINTLDT

 

Numeric

(INTDATE=U ) Converts a date stored in yymmdd format to the U.S. format of mm/dd/yy or mmddyy, depending on the output field length.

(INTDATE=I) Generates a call to OINTLDT that converts a date stored in yymmdd format to the international format of dd/mm/yy or ddmmyy, depending on the output field length.

Note: INTDATE is a parameter in TLNIIS, and the default is U.

FLNULL

OFLNULL

SQLNULL

If the field is null, spaces are moved to TPO-FLDNAME. Otherwise, the data is processed as the OFLOAT field edit does.

FLOAT

OFLOAT

OFORMAT

Numeric

Right-justifies a floating-point or signed-numeric field with an implied decimal point, using the smallest character representation possible with no loss of digits to the left of the (implied) decimal point.

HEX

OHEX

Alpha

Converts an EBCDIC character format item to hexadecimal.

HEXA

OHEXA

Alpha

Converts an EBCDIC character format item to hexadecimal.

HEXP

OHEXP

Alpha

Converts an EBCDIC character format item to hexadecimal.

HEXT

OHEXT

Alpha

Converts an EBCDIC character format item to hexadecimal.

JULIAN

OJULIAN

OINTJUL

Numeric

(INTDATE=U) Converts a date stored in yyddd format to the U.S. format of mm/dd/yy or mmddyy, depending on the output field length.

(INTDATE=I) Generates a call to OINTLJUL that converts a date stored in yyddd format to the international formats dd/mm/yy or ddmmyy, depending on the output field length.

Note: INTDATE is a parameter in TLNIIS, and the default is U.

NULL

ONULL

SQLNULL

If the field is null, spaces are moved to TPO-FLDNAME. Otherwise, the output field name is moved to TPO-FLDNAME.

NUMNULL

OFLNULL

ONUMNULL

If the field is null, spaces are moved to TPO-FLDNAME. Otherwise, TPO-FLDNAME is formatted using the output fieldname integers, and they are right-justified and blank-filled.

SSA

OSSA

Alpha

(DL/I processing only.) Parses an IMS SSA to determine the input SSA length. Returns both the SSA length and the SSA itself. Specified in the PIC field of the Update Output/Input/Outin Field screen.

VCHAR

OVCHAR

Variable character

Maps data from DBNAME hvname to TPO-fldname, where hvname is defined for the SQL VARCHAR column.

VNULL

OVNULL

SQLNULL

If the field is null, spaces are moved to TPO-FLDNAME. Otherwise, the data is mapped from DBNAME hvname to TPO-FLDNAME, where hvname is defined for SQL VARCHAR column.

CA Telon Input Edit Routines

FLDTYPE Name

Module Value

Type

Input Edit Action

CDATE

ICDATE

IINTCDT

Numeric

(Set INTDATE=U) Edits a date field for a valid U.S. format of mm/dd/ccyy, mm-dd-ccyy, or mmddccyy, depending on the input field length; then converts it to ccyymmdd format.

(INTDATE=I) Generates a call to IINTCDT that edits a date field for a valid International format of dd/mm/ccyy, dd-mm-ccyy, or ddmmccyy, depending on the input field length; then converts it to ccyymmdd format.

Note: INTDATE is a parameter in TLNIIS and the default is U.

CJULIAN

ICJULIAN

IINTCJUL

Numeric

(Set INTDATE=U) Edits a date field for a valid U.S. format of mm/dd/ccyy, mm-dd-ccyy, or mmddccyy, depending on the input field length; then converts it to ccyyddd format.

(INTDATE=I) Generates a call to IINTCJUL that edits a date field for a valid International format of dd/mm/ccyy, dd-mm-ccyy, or ddmmccyy, depending on the input field length; then converts it to ccyyddd format.

Note: INTDATE is a parameter in TLNIIS and the default is U.

DATE

IDATE

IINTLDT

Numeric

(Set INTDATE=U) Edits a date field for a valid U.S. format of mm/dd/yy, mm-dd-yy or mmddyy, depending on the input field length; then converts it to yymmdd format.

(INTDATE=I) Generates a call to IINTLDT that edits a date field for a valid International format of dd/mm/yy, dd-mm-yy, or ddmmyy, depending on the input field length; then converts it to yymmdd format.

Note: INTDATE is a parameter in TLNIIS and the default is U.

DOLLAR

IDOLLAR

IBDOL

ICURRNCY

Numeric

(INTDATE=U) Edits a field for a valid U.S. dollar and cents format (that is, two decimal places preceded by a period). This field does not accept negatives.

(INTDATE=I) Generates a call to ICURRNCY that edits a field for a valid International currency format (that is, two decimal places preceded by a comma).

INTDATE is a parameter in TLNIIS and the default is U.

FLNULL

IFLNULL

SQLNULL

If completely blank on input, FLNULL sets the null indicator. Otherwise, FLNULL edits a field for numeric format, allowing for a decimal point and a leading sign.

FLOAT

IFLOAT

Numeric

Edits a field for valid numeric format, allowing for a decimal point and leading sign.

FULLCAR

IFULLCAR

Alpha

Edits an input field to ensure there are no blanks in the field.

FULLNUM

IFULLNUM

Numeric

Edits a numeric field to ensure that all characters are numeric.

JULIAN

IJULIAN

Numeric

(INTDATE=U) Edits a date field for a valid U.S. format of mm/dd/yy, mm-dd-yy, or mmddyy, depending on the input field length; then converts it to yyddd format.

(INTDATE=I) Generates a call to IINTLJUL that edits a date field for a valid International format of dd/mm/yy, dd-mm-yy, or ddmmyy, depending on the input field length; then converts it to yyddd format.

Note: INTDATE is a parameter in TLNIIS and the default is U.

LALPHA

ILALPHA

Alpha

Left-justifies a character field.

LNULL

ILNULL

SQLNULL

If blank on input, LNULL sets the null indicator. Otherwise, LNULL left-justifies a character field.

LVCHAR

ILVCHAR

Variable character

Left-justifies a character field (hvname is defined for SQL VARCHAR column).

LVNULL

ILVNULL

SQLNULL

If blank on input, LVNULL sets the null indicator. Otherwise, LVNULL left-justifies a variable-length character field into DBNAME hvname (hvname is defined for the SQL VARCHAR column).

NBALPHA

INBALPHA

Alpha

Edits a field to ensure there are no embedded blanks. NBALPHA allows leading and/or trailing blanks; FULLCAR does not.

NBNULL

INBNULL

SQLNULL

If blank on input, NBNULL sets the null indicator. Otherwise, NBNULL edits a field to ensure there are no embedded blanks.

NBVCHAR

INBVCHAR

Variable character

Edits a field to ensure there are no embedded blanks. (hvname is defined for SQL VARCHAR column.)

NBVNULL

INBVNULL

SQLNULL

If blank on input, NBVNULL sets the null indicator. Otherwise, NBVNULL edits a variable-length character field to ensure there are no embedded blanks.

NULL

INULL

SQLNULL

If blank on input, NULL sets the null indicator. Otherwise, NULL maps data from TPI-FLDNAME to DBNAME.

NUMERIC

INUMERIC

Numeric

Edits a field for valid numeric format, allowing for leading or trailing blanks (or both).

NUMNULL

INUMNULL

SQLNULL

If blank on input, NUMNULL sets the null indicator. Otherwise, NUMNULL edits a field for valid numeric format, allowing for leading and/or trailing spaces.

TATE

ISTATE

Alpha

Edits a field for valid two-character postal state code.

VCHAR

IVCHAR

Variable character

Maps data from TPO-fldname to DBNAME hvname (hvname is defined for SQL VARCHAR column).

VNULL

IVNULL

SQLNULL

If blank on input, VNULL sets the null indicator. Otherwise, VNULL maps data from TPI-fldname to DBNAME hvname (hvname is defined for the SQL VARCHAR column.)

Standard Field Edit Modules

The following table lists standard field edit modules provided by CA Telon and summarizes the edit function associated with each module.

Detailed documentation of each call module is provided after the table that includes:

See 1 for more information about edit processing.

Module Name

Edit Function

OCAR

Replace unprintable characters with periods

OCART

Replace unprintable characters with periods

OCDATE

Format century date

OCJULIAN

Convert century Julian date to mm/dd/ccyy

ODATE

Format date

OFLNULL

Format a floating-point field that may be null

OFLOAT

Format a floating-point field

OFORMAT

Reformat for output

OHEX

Convert character to hex

OHEXA

Convert characters to hex representation

OHEXP

Convert characters to hex representation

OHEXT

Convert characters to hex representation

OINTCDT

Format century date (international)

OINTCJUL

Format century Julian date (international)

OINTLDT

Format date (international)

OINTLJUL

Format Julian date (international)

OJULIAN

Convert Julian date to mm/dd/yy

ONULL

Format field based on null indicator

ONUMNULL

Format integer field based on null indicator

OSSA

Determine length of SSA

OVCHAR

Alphanumeric move from variable-length character field

OVNULL

Alphanumeric move from variable-length character field

IBDOL

Validate dollar entry

IBCURR

Validate international currency entry

ICURRNCY

Validate international currency entry

IBNUM

Validate numeric entry

ICDATE

Check for valid century date

ICJULIAN

Convert century date to century Julian

IDATE

Check for valid date

IDOLLAR

Check for dollar/currency entry

IFLNULL

Validate floating-point entry and set null indicator

IFLOAT

Check for floating-point number

IFULLCAR

Check for blanks

IFORMAT

Validate and reformat on input

IFULLNUM

Check for all numeric characters

IHEX

Convert hex representation to hex characters

IHEXA

Convert hex representation to hex characters

IINTCDT

Validate century date (international)

IINTCJUL

Convert century date to century Julian (international)

IINTLDT

Validate date (international)

IINTLJUL

Validate date (international)

IJULIAN

Convert date to Julian

ILALPHA

Left-justify a character field

ILNULL

Set null indicator and left-justify character field

ILVCHAR

Left-justify a variable-length character field

ILVNULL

Left-justify a variable-length length field and set null indicator

INBALPHA

Check for imbedded blanks

INBNULL

Check for imbedded blanks and set null indicator

INBVCHAR

Check for imbedded blanks

INBVNULL

Check blanks for variable-length field and set null indicator

INULL

Set null indicator

INUMERIC

Check for valid integer

INUMNULL

Check for valid integer and set null indicator

ISTATE

Check for valid state code

IVCHAR

Alphanumeric move to variable-length character field

IVNULL

Set null indicator for variable-length field

OCAR

Function

Replaces unprintable characters with periods.

Parameters

Type

Name

Description

Input

TPO-fieldname-LTH

Length of the edited field. This must be between 1 and 256.

Input

output-fieldname

Field to be edited by this routine.

Output

TPO-fieldname

Edited output of the routine that is returned to the TPO buffer.

Edit processing

  1. Search the output field for unprintable characters.
  2. Translate unprintable characters to periods (X'4B').

OCART

Function

Replaces unprintable characters with periods. The difference between this field edit and IHEX is that this edit is passed the address of the field to be converted, rather than the value of the field itself.

Parameters

Type

Name

Description

Input

TPO-fieldname-LTH

Length of the edited field. This must be between 1 and 256.

Input

output-fieldname

Field to be edited by this routine.

Output

TPO-fieldname

Edited output of the routine that is returned to the TPO buffer.

Edit processing

  1. Search output-fieldname for unprintable characters.
  2. Translate unprintable characters to periods (X'4B').

OCDATE

Function

Format a date stored as ccyymmdd for output as either mm/dd/cc/yy (if TPO-datefield-LTH is 10) or mmddccyy (if the TPO-datefield-LTH is 8).

Note: If the INTDATE parameter in the TLNIIS macro is set to I, a call to OINTCDT is generated in place of a call to ODATE. For more information, refer to OINTCDT.

Parameters

Type

Name

Description

Input

WORKFLD-NUMERIC

Date to be edited. In a COBOL PIC S9(11)V9(7) field, the date is laid out as 000ccyymmdd0000000. In a PL/I PIC 10(9)V(4)9T field, it is laid out as 00ccyymmdd00000.

Input

TPO-datefield-LTH

Length of the output field.

Output

TPO-datefield

Edited date returned to the TPO buffer.

Edit processing

  1. Move ccyy in WORKFILED-NUMERIC to make the result mmddccyy.
  2. For 10-character output, insert the slashes.
  3. Move the edited form to the output field.

OCJULIAN

Function

Formats a date stored in ccyyddd for output as mm/dd/ccyy (if TPO-datefield-LTH is 10) or mmddccyy (if TPO-datefield-LTH is 8).

Note: If the INTDATE parameter in the TLNIIS macro is set to 'I,' a call to OINTCJUL is generated in place of a call to OCJULIAN. See OINTCJUL for more information.

Parameters

Type

Name

Description

Input

WORKFLD-NUMERIC

Date to be edited. In a COBOL PIC S9(11)V9(7) field, the date is laid out as 0000ccyyddd0000000. In a PL/I PIC (10)9V(4)9T field, it is laid out as 000ccyyddd00000.

Input

TPO-fieldname-LTH

Length of the output field.

Output

TPO-fieldname

Converted output of the routine that is returned to the TPO buffer.

Edit processing

  1. Convert ddd from the ccyyddd of WORKFLD-NUMERIC to mmdd.

    Note: If ddd is greater than 365 (366 for leap year), yy is adjusted one year for each additional 365 (366) days.

  2. If TPO-fieldname-LTH is 10, insert slashes (/) into the mmddccyy to create the mm/dd/ccyy format.
  3. Move the reformatted value to TPO-fieldname.

ODATE

Function

Formats a date stored as yymmdd for output as either mm/dd/yy (if TPO-datefield-LTH is 8) or mmddyy (if the TPO-datefield-LTH is 6).

Note: If the INTDATE parameter in the TLNIIS macro is set to 'I', a call to OINTLDT is generated in place of a call to ODATE. For more information, see 33.

Parameters

Type

Name

Description

Input

WORKFLD-NUMERIC

Date to be edited. In a COBOL PIC S9(11)V9(7) field, the date is laid out as 00000yymmdd0000000. In a PL/I (10)9V(4)9T field, it is laid out as 0000yymmdd00000.

Input

TPO-datefield-LTH

Length of the output field.

Output

TPO-datefield

Edited date returned to the TPO buffer.

Edit processing

  1. Move yy in WORKFLD-NUMERIC to make the result mmddyy.
  2. For eight-character output, insert the slashes.
  3. Move the edited form to the output field.

OFLNULL

Function

Right-justifies a floating-point or signed-numeric field.

If the null indicator is set, the output field is set to spaces. The edit uses the minimum number of characters required to include all significant digits to the left of the implied decimal point. Then, given the output field length, it formats as many significant digits to the right of the decimal point as possible. Extra digits to the right of the decimal are truncated, not rounded.

The routine signifies an overflow condition (the output field is too small to contain the whole number) by filling the output field with all asterisks (*).

Parameters

Type

Name

Description

Input

WORKFLD-NUMERIC

Numeric value from the DBNAME field to be edited. In COBOL, PIC S9(11)V9(7); in PL/I, PIC (10)9V(7)9T.

Input

TPO-fieldname-LTH

Length of the output field. It must be 1 to 18 bytes for COBOL, 1 to 15 for PL/I.

Input

WK-fieldname-NV

Null indicator variable, set to -1 by SQL when the DBNAME is null.

Output

TPO-fieldname

Edited field returned to the TPO output buffer.

Edit processing

  1. Determine if the field is null by checking the null indicator.
  2. If the field is null, move spaces to the TPO buffer field. Otherwise, if WORKFLD-NUMERIC is negative, store a minus sign in the first position of TEMP-OUT-FIELD, a temporary, internal, alphanumeric work area.
  3. Bypass any leading zeros encountered before the implied decimal.
  4. Find any significant digits to the right of the decimal point and store them in TEMP-OUT-FIELD after any minus sign.
  5. If the significant positions after the implied decimal are all zeros, exit the edit processing. Otherwise, store a decimal point in TEMP-OUT-FIELD following the digits already there.
  6. Check to see if there are more significant characters in the TEMP-OUT-FIELD than specified by TPO-fieldname-LTH. If so, fill TPO-fieldname with all asterisks (*). Then exit the edit processing.
  7. Find all remaining digits after the decimal and up to the last group of all zeros. Store these digits in TEMP-OUT-FIELD after the decimal point.
  8. Right-justify the TEMP-OUT-FIELD value in TPO-fieldname and end the routine.

OFLOAT

Function

Right-justify a floating-point or signed-numeric field.

The edit uses the minimum number of characters required to include all significant digits to the left of the implied decimal point. Then, given the output field length, it formats as many significant digits right of the decimal point as possible. Extra digits right of the decimal are truncated, not rounded.

The routine signifies an overflow condition by filling the output field with all plus (+) or minus (-) signs, depending on the sign of the input value.

Parameters

Type

Name

Description

Input

WORKFLD-NUMERIC

Value to be edited. Before editing, the value is moved to this field from the DBNAME field to be output. In COBOL, PIC S9(11)V9(7); in PL/I, PIC (10)9V(4)9T.

Input

TPO-fieldname-LTH

Length of the edited field. It must be from one to 18 bytes.

Output

TPO-fieldname

Edited field returned to the TPO output buffer.

Edit processing

  1. If WORKFLD-NUMERIC is negative, store a minus sign in the first position of TEMP-OUT-FIELD, a temporary, internal, alphanumeric work area.
  2. Bypass any leading zeros encountered before the implied decimal.
  3. Find any significant digits right of the decimal point and store them in TEMP-OUT-FIELD after any minus sign.
  4. If the significant positions after the implied decimal are all zeros, exit the edit processing. Otherwise, store a decimal point in TEMP-OUT-FIELD following the digits already there.
  5. Check to see if there are more significant characters in TEMP-OUT-FIELD than specified by TPO-fieldname-LTH. If so, fill TPO-fieldname with all plus (+) or all minus (-) signs, depending on the sign of the input field. Then exit the edit processing.
  6. Find all remaining digits after the decimal up to the last group of all zeros and store these in TEMP-OUT-FIELD after the decimal point.
  7. Right-justify TEMP-OUT-FIELD value in TPO-fieldname and end the routine.

OFORMAT

Function

Reformats output.

Specification for this special edit is made by entering the FORMAT command in the SPEC field on the Update Output/Input/Outin Field screen or the Update Batch Output Fields screen. See Update Output/Input/Outin Field for more information.

OHEX

Converts a character string to the hexadecimal equivalent for each character.

Parameters

Type

Name

Description

Input

output-fieldname

Field holding the characters to be converted to hex.

Input

TPO-fieldname-LTH

Length of the edited field. It can be from 2 to 256 bytes long.

Output

TPO-fieldname

Edited field returned to the TPO buffer.

Edit processing

  1. Determine the output field length.
  2. Use the assembly language TRANSLATE instruction and convert the input in eight-byte pieces.
  3. If fewer than eight characters remain, convert the last bytes individually.

OHEXA

Function

Converts a one- to four-character string to the hexadecimal equivalent for each character (for example, 'AB12' converts to 'C1C2F1F2'). This field edit is designed specifically for converting addresses.

Parameters

Type

Name

Description

Input

TPO-fieldname-LTH

Length of the edited field. This must be between 1 and 256.

Input

output-fieldname

Field to be converted by this routine.

Output

TPO-fieldname

Converted output of the routine that is returned to the TPO buffer.

Edit processing

  1. Determine the output field length.
  2. Use the assembler language TRANSLATE instruction to convert the output.
  3. If the output length is not equal to 8, the first byte of input is ignored, and bytes 2 through 4 are converted (with the assumption that the input is a 24-bit address). Otherwise, all four bytes are converted.

OHEXP

Function

Converts a one- to four-character string to the hexadecimal equivalent for each character (for example, 'AB12' converts to 'C1C2F1F2'). The difference between this field edit and OHEX is that this edit is passed the address of the field to be converted, rather than the value of the field itself.

Parameters

Type

Name

Description

Input

TPO-fieldname-LTH

Length of the edited field. This must be between 1 and 256.

Input

output-fieldname

Field to be converted by this routine.

Output

TPO-fieldname

Converted output of the routine that is returned to the TPO buffer.

Edit processing

  1. Determine the output field length.
  2. Use the assembler language TRANSLATE instruction to convert the output.
  3. Move the output to TPO-fieldname.

OHEXT

Function

Converts a one- to four-character string to the hexadecimal equivalent for each character (for example, 'AB12' converts to 'C1C2F1F2'). The difference between this field edit and OHEX is that this edit is passed the address of the field to be converted, rather than the value of the field itself.

Parameters

Type

Name

Description

Input

TPO-fieldname-LTH

Length of the edited field. This must be between 1 and 256.

Input

output-fieldname

Field to be converted by this routine.

Output

TPO-fieldname

Converted output of the routine that is returned to the TPO buffer.

Edit processing

  1. Determine the output field length.
  2. Use the assembler language TRANSLATE instruction to convert the output.
  3. Move the output to TPO-fieldname.

OINTCDT

Function

Reformats a date stored in ccyymmdd to dd/mm/ccyy (if TPO-datefield-LTH is 10) or to ddmmccyy (if the TPO-datefield-LTH is 8).

A call to this field is generated in either of the following cases:

Parameters

Type

Name

Description

Input

WORKFLD-NUMERIC

Date to be edited. In a COBOL PIC S9(11)V9(7) field, the date is laid out as 000ccyymmdd0000000. In a PL/I PIC (10)9V(4)9T field, it is laid out as 00ccyymmdd00000.

Input

TPO-datefield-LTH

Length of the output field.

Output

TPO-datefield

Converted output of the routine that is returned to the TPO buffer.

Edit processing

  1. Determine the output field length.
  2. Reformat the WORKFLD-NUMERIC date value from ccyymmdd to ddmmccyy. If TPO-datefield-LTH is 10, insert slashes (/) to produce dd/mm/ccyy.
  3. Move the reformatted value to TPO-datefield.

OINTCJUL

Function

Reformats a date stored in ccyyddd format to dd/mm/ccyy (if TPO-datefield-LTH is 10) or ddmmccyy (if TPO-datefield-LTH is 8).

A call to this field edit is generated in either of these cases:

Parameters

Type

Name

Description

Input

WORKFLD-NUMERIC

Date to be edited. In a COBOL PIC S9(11)V9(7) field, the date is laid out as 0000ccyyddd0000000. In a PL/I PIC (10)9V(4)9T field, it is laid out as 000ccyyddd00000.

Input

TPO-datefield-LTH

Length of the output field.

Output

TPO-datefield

Converted output of the routine that is returned to the TPO buffer.

Edit processing

  1. Determine the output field length.
  2. Reformat the WORKFLD-NUMERIC date value from ccyyddd to ddmmccyy. If TPO-datefield-LTH is 10, insert slashes (/) to produce dd/mm/ccyy.
  3. Move the reformatted value to TPO-datefield.

Note: If ddd is greater than 365 (366 for leap year), yy is adjusted one year for each additional 365 (366) days.

OINTLDT

Function

Reformats a date stored in yymmdd format to dd/mm/yy (if TPO-datefield-LTH is 8) or ddmmyy (if TPO-datefield-LTH is 6).

A call to this field edit is generated in either of these cases:

Parameters

Type

Name

Description

Input

WORKFLD-NUMERIC

Date to be edited. In a COBOL PIC S9(11)V9(7) field, the date is laid out as 00000yymmdd0000000. In a PL/I PIC(10)9V(4)9T field, the date is laid out as 0000yymmdd00000.

Input

TPO-datefield-LTH

Length of the output field.

Output

TPO-datefield

Converted output of the routine that is returned to the TPO buffer.

Edit processing

  1. Determine the output field length.
  2. Reformat the WORKFLD-NUMERIC date value from yymmdd to ddmmyy. If TPO-datefield-LTH is 8, insert slashes to produce dd/mm/yy.
  3. Move the reformatted value to TPO-datefield.

OINTLJUL

Function

Reformat a date stored in yyddd format to dd/mm/yy (if the TPO-datefield-LTH is 8) or ddmmyy (if the TPO-datefield-LTH is 6).

A call to this field edit is generated in either of these cases:

Parameters

Type

Name

Description

Input

WORKFLD-NUMERIC

Date to be edited. In a COBOL PIC S9(11)V9(7) field, the date is laid out as 000000yyddd0000000. In a PL/I PIC (10)9V(4)9T field, the date is laid out as 00000yyddd00000.

Input

TPO-datefield-LTH

Length of the output field.

Output

TPO-datefield

Converted output of the routine that is returned to the TPO buffer.

Edit processing

  1. Determine the output field length.
  2. Reformat the WORKFLD-NUMERIC date value from yyddd to ddmmyy. If TPO-datefield-LTH is 8, insert slashes to produce dd/mm/yy.
  3. Move the reformatted value to TPO-datefield.

    Note: If ddd is greater than 365 (366 for leap year), yy is adjusted one year for each additional 365 (366) days.

OJULIAN

Function

Formats a date stored as yyddd for output as mm/dd/yy (if TPO-datefield-LTH is 8) or mmddyy (if TPO-datefield-LTH is 6).

Note: If the INTDATE parameter in the macro TLNIIS is set to 'I', a call to OINTLJUL is generated in place of a call to OJULIAN. For more information, see OINTLJUL.

Parameters

Type

Name

Description

Input

WORKFLD-NUMERIC

Date to be edited. It is the numeric value moved from the DBDNAME field. In a COBOL PIC S9(11)V9(7) field the date is last out as 000000yyddd0000000. In a PL/I as 00000yyddd00000.

Input

TPO-fieldname-LTH

Length of the output field.

Output

TPO-fieldname

Edited field returned to the TPO output buffer.

Edit processing

  1. Convert ddd from the yyddd of WORKFLD-NUMERIC to mmdd.

    Note: If ddd is greater than 365 (366 for leap year), yy is adjusted up one year for each additional 365 (or 366) days.

  2. Insert slashes into the mmddyy to create the mm/dd/yy format.

ONULL

Function

Formats an output character field based on the null indicator.

Parameters

Type

Name

Description

Input

OUTPUT-fieldname

Field containing the characters to be output.

The length of OUTPUT-fieldname (DBNAME) must be at least as long as TPO-fieldname.

Input

TPO-fieldname-LTH

Length of the output field.

Input

WK-fieldname-NN

Null indicator variable, set to -1 by SQL when OUTPUT-fieldname is null.

Output

TPO-fieldname

Edited field returned to the TPO output buffer.

Edit processing

  1. Determine if the field is null by checking the null indicator.
  2. If the field is null, move spaces to TPO-fieldname. Otherwise, OUTPUT-fieldname is moved to TPO-fieldname.

ONUMNULL

Function

Right-justify an output integer to conform with a length specified by a PIC parameter on a Field statement.

If the null indicator is set, the output field is set to spaces. Otherwise, this edit right-justifies a numeric field.

The routine signifies an overflow condition by filling the output field with asterisks (*).

Parameters

Type

Name

Description

Input

WORKFLD-NUMERIC

Numeric value from the DBNAME field to be edited. In COBOL, PIC S9(11)V9(7); in PL/I, PIC(10)9V(4)9T.

Input

TPO-fieldname-LTH

Length of the output field.

Input

WK-fieldname-NN

Null indicator variable, set to -1 by SQL when the DBNAME is null.

Output

TPO-fieldname

Edited field returned to the TPO output buffer.

Edit processing

  1. Determine if the field is null by checking the null indicator.
  2. If the field is null, move spaces to TPO-FIELDNAME. Otherwise, the numeric value from the DBNAME field (WORKFLD-NUMERIC) is right-justified, blank-filled into TPO-fieldname.

OSSA

Function

Determines the length of an input SSA.

Parameters

Type

Name

Description

Input

segmentname-SSA

IMS SSA.

Output

TPO-ssaname

The SSA moved to the TPO output buffer.

Output

TPO-ssaname-LTH

Length of the SSA, to a maximum of 256.

Edit processing

  1. Search through the SSA to check for qualification.
  2. If a space is found during the search, process the SSA as qualified, then branch to compute the length below.

    If, instead, a left paren is found, process the SSA as unqualified. Search until an equal number of right and left parentheses is found, or until the maximum TPO-ssaname-LTH (256) is reached.

  3. Compute the length of the SSA and move the length to TPO-ssaname-LTH.
  4. Move the SSA to TPO-ssaname.

OVCHAR

Function

Returns a variable-length character field and length.

Parameters

Type

Name

Description

Input

output-fieldname

Variable-length character field containing the characters to be output.

Input

TPO-fieldname-LTH

Length of the edited field.

Output

TPO-fieldname

Edited field returned to the TPO buffer.

Edit processing

  1. Determine the output field length (the lesser of the variable-length character field length and TPO-fieldname-LTH).
  2. Move the character portion of the variable-length character field to the output buffer (TPO-fieldname).

OVNULL

Function

Returns a variable-length character field and length by performing an alphanumeric move from a variable-length character field based on the null indicator.

If the null indicator is set, the output field is set to spaces. Otherwise, the character portion of the variable-length character field is moved to the output buffer.

Parameters

Type

Name

Description

Input

OUTPUT-fieldname

Variable-length character field containing the characters to be output.

Input

TPO-fieldname-LTH

Length of the output field.

Input

WK-fieldname-NN

Null indicator variable, set to -1 by SQL when DBNAME is null.

Output

TPO-fieldname

Edited field returned to the TPO output buffer.

Edit processing

  1. Determine if the field is null by checking the null indicator.
  2. If the field is null, move spaces to TPO-fieldname. Otherwise, determine the output length (the lesser of the variable-length character field length and TPO-fieldname-LTH).
  3. Move the character portion of the variable-length character field to the output buffer.

IBDOL

Function

Checks input for valid dollar format, with a period (.) separating dollars and cents.

The difference between this field edit and IDOLLAR is that it allows larger numbers to be validated because the WORKFLD-NUMERIC-1 field in which the validated entry is returned is defined as PIC S9(16)V9(2) for COBOL, PIC (13)9V9T for PL/I.

Note: If the INTDATE parameter in the macro TLNIIS is set to 'I', a call to IBCURR is generated in place of a call to IBDOL. For more information, see IBCURR.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the output field.

Input

TPI-fieldname

Value to be edited for valid dollar amount, from the TP input buffer.

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected
  • G121— An error was detected during the edit

Output

WORKFLD-NUMERIC-1

Validated value, in format PIC S9(16)V9(2) for COBOL, PIC (13)9V9T for PL/I.

Edit processing

  1. Strip incoming TPI field of leading and trailing blanks.
  2. Test the antipenultimate position for a decimal point.
  3. Strip the decimal point and move the justified number to WORKFLD-NUMERIC-1.
  4. Zero-fill the value in WORKFLD-NUMERIC-1.
  5. Test WORKFLD-NUMERIC-1 for valid numeric value.
  6. Assign FIELD-EDIT-ERROR, based on outcome of decimal point placement test and numeric validation.

IBCURR

Function

Checks for valid international currency entry (that is, with a comma separating the last two digits of the numeric entry). The difference between this field edit and ICURRNCY is that it allows larger numbers to be validated because the WORKFLD-NUMERIC-1 field in which the validated entry is returned is defined as PIC S9(16)V9(2) for COBOL, PIC (13)9V9T for PL/I.

A call to this field edit is generated in either of these cases:

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the output field.

Input

TPI-fieldname

Value to be edited for valid currency amount, from the TP input buffer.

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected
  • G121— An error was detected during the edit

Output

WORKFLD-NUMERIC-1

Validated value, in format PIC S9(16)V9(2) for COBOL, PIC (13)9V9T for PL/I.

Edit processing

  1. Strip incoming TPI field of leading and trailing blanks.
  2. Test the antipenultimate position for a comma.
  3. Strip the comma and move the justified number to WORKFLD-NUMERIC.
  4. Zero-fill the value in WORKFLD-NUMERIC-1.
  5. Test WORKFLD-NUMERIC-1 for valid numeric value.
  6. Assign FIELD-EDIT-ERROR, based on outcome of decimal point placement test and numeric validation.

IBNUM

Function

Checks a field for valid integer characteristics. The difference between this field edit and ICURRNCY is that it allows larger numbers to be validated because the WORKFLD-NUMERIC-1 field in which the validated entry is returned is defined as PIC 9(16)V9(2)T for COBOL, PIC (13)9V9T for PL/I.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the output field.

Input

TPI-fieldname

Value to be edited for valid integer amount, from the TP input buffer.

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected
  • G121— An error was detected during the edit

Output

WORKFLD-NUMERIC-1

Validated value, in format PIC 9(16)V9(2) for COBOL, PIC (13)9V9T for PL/I.

Edit processing

  1. Strip incoming TPI field of leading and trailing blanks.
  2. Justify the input entry and move it to WORKFLD-NUMERIC-1.
  3. Zero-fill the value in WORKFLD-NUMERIC-1.
  4. Test WORKFLD-NUMERIC-1 for valid numeric value.
  5. Assign FIELD-EDIT-ERROR, based on outcome of decimal point placement test and numeric validation.

ICDATE

Function

Checks input for valid date format, mm/dd/ccyy or mm-dd-ccyy (if TPO-datefield-LTH is 10) or mmddccyy (if TPO-datefield-Lth is 6), and stores it as ccyymmdd.

Note: If the INTDATE parameter in the TLNIIS macro is set to 'I,' a call to IINTCDT is generated in place of a call to IDATE. See 1.

Parameters

Type

Name

Description

Input

TPI-datefield-LTH

Length of the input field. It must be a halfword binary with a value of 8 or 10.

Input

TPI-datefield

Contents of the TP input buffer (the date to be edited).

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected
  • ERR1— Length error
  • G123— An error was detected during processing of an eight-byte date
  • G130— An error occurred during processing of a ten-byte date

Output

WORKFLD-NUMERIC

Result of the edit, in a COBOL PIC S9(11)V9(7)9 field, the date is laid out as 000ccyymmdd0000000 for COBOL or 00ccyymmdd00000. The program moves this to the appropriate storage area after return from the edit routine.

Edit processing

  1. If the field length is ten bytes, check for valid delimiters. If invalid delimiters are found, exit with error code G130.
  2. Move the date to WORKFLD-NUMERIC and test for valid month, day, and year. If invalid, return appropriate error code. Otherwise, return edited date in WORKFLD-NUMERIC.

Note: The characters cc and yy are tested for only valid numeric characters. The characters dd and mm are edited for valid characters.

ICURRNCY

Function

Checks for valid international currency entry (that is, with a comma separating the last two digits of the numeric entry).

A call to this field edit is generated in either of these cases:

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the output field.

Input

TPI-fieldname

Value to be edited for valid currency amount, from the TP input buffer.

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected
  • G121— An error was detected during the edit

Output

WORKFLD-NUMERIC

Validated value, in format PIC S9(11)V9(7) for COBOL, PIC (10)9V(4)9T for PL/I.

Edit processing

  1. Strip incoming TPI field of leading and trailing blanks.
  2. Test the antipenultimate position for a comma.
  3. Strip the comma and move the justified number to WORKFLD-NUMERIC.
  4. Zero-fill the value in WORKFLD-NUMERIC.
  5. Test WORKFLD-NUMERIC for valid numeric value.
  6. Assign FIELD-EDIT-ERROR, based on outcome of decimal point placement test and numeric validation.

IDATE

Function

Checks input for valid date format, mm/dd/yy or mm-dd-yy (if TPI-datefield-LTH is 8) or mmddyy (if TPI-datefield-LTH is 6), and stores it as yymmdd.

Note: If the INTDATE parameter in the macro TLNIIS is set to 'I,' a call to IINTLDT is generated in place of a call to IDATE. For more information, see IINTLDT.

Parameters

Type

Name

Description

Input

TPI-datefield-LTH

Length of the input field. It must be a halfword binary with a value of 6 or 8.

Input

TPI-datefield

Contents of the TP input buffer (the date to be edited).

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected.
  • G123—An error was detected during processing of an item in mmddyy or ddmmyy format.
  • G130— An error occurred during processing of an item in mm/dd/yy, dd/mm/yy, mm-dd-yy, or dd-mm-yy format.

Output

WORKFLD-NUMERIC

Result of the edit in a COBOL PIC S9(11)V9(7) field, the date is laid out as 00000yymmdd0000000. For PL/I PIC (10)9V(4)9T field, the date is laid out as or 0000yymmdd00000. The program moves this to the appropriate storage area after return from the edit routine.

Edit processing

  1. If the field length is eight, check for valid delimiters. If invalid delimiters are found, exit with error code G130.
  2. Move date to WORKFLD-NUMERIC and test for valid month, day, and year. If invalid, return appropriate error code. Otherwise, return edited date in WORKFLD-NUMERIC.

    Note: Yy is tested for only valid numeric characters. Dd and mm are edited for valid characters.

IDOLLAR

Function

Checks input for valid dollar format, with a period (.) separating dollars and cents.

Note: If the INTDATE parameter in the macro TLNIIS is set to 'I', a call to ICURRNCY is generated in place of a call to IDOLLAR. For more information, see ICURRNCY.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the input field.

Input

TPI-fieldname

Contents of the TP input buffer (the dollar amount to be edited).

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected
  • G121— An error was detected during the edit

Output

WORKFLD-NUMERIC

Result of the edit in the COBOL PIC S9(11)V9(7) format or PL/I PIC (10)9V(4)9T format.

Edit processing

  1. Strip incoming TPI field of leading and trailing blanks.
  2. Test the third from the last position for a valid decimal point (when INTDATE=U) or comma (when INTDATE=I).
  3. Strip the decimal point or comma and move the justified number to WORKFLD-NUMERIC.
  4. Zero-fill the value in WORKFLD-NUMERIC.
  5. Test WORKFLD-NUMERIC for a valid numeric value.

IFLNULL

Function

Checks a field for a valid number. This allows for a leading sign and an optional decimal point.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the input field.

Input

TPI-fieldname

Contents of the TP input buffer (the number to be edited).

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected
  • NXXX— An error was detected during the edit

Output

WORKFLD-NUMERIC

Result of the edit in the COBOL S9(11)V9(7) format or PL/I PIC (10)9V(4)9T format.

Output

WK-fieldname-NN

Null indicator variable.

Edit processing

If the input field is blank, set the null indicator to -1. Otherwise, set the null indicator to 0 and:

  1. Skip leading blanks.
  2. Check to see if the next character is a plus (+) or minus (-) sign.
  3. Move all remaining characters, up to the decimal point, or a space, to a temporary work area DIGIT-GROUP.
  4. If DIGIT-GROUP has more than 11 digits in a COBOL program or more than 10 digits in a PL/I program, exit with error code NXXX. Otherwise, move the contents of DIGIT-GROUP to a second temporary work area WS-FIELD-NUM.
  5. If a decimal was found, place all numeric characters following the decimal point into DIGIT-GROUP.
  6. If the resulting DIGIT-GROUP has more than seven digits in a COBOL program or more than five digits in a PL/I program, exit with error code NXXX. Otherwise, move DIGIT-GROUP to WS-FIELD-NUM following the original digits and a decimal point.
  7. If the remaining unprocessed characters are blank, perform the following calculation to obtain the correct sign:
    WORKFLD-NUMERIC = 0 +│- WS-FIELD-NUM
    

    +│- is the sign stored as the first nonblank character from the input field. If no character is found, plus (+) is assumed.

  8. If any of the remaining unprocessed characters are not blanks, exit with error code NXXX.

IFLOAT

Function

Checks a field for a valid number. This allows for a leading sign and optional decimal point.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the input field.

Input

TPI-fieldname

Contents of the TP input buffer (the number to be edited).

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected
  • G122— An error was detected during the edit

Output

WORKFLD-NUMERIC

Result of the edit in the COBOL S9(11)V9(7) format or PL/I PIC (10)9V(4)9T format.

Edit processing

  1. Skip leading blanks.
  2. Check to see if the next character is a plus (+) or minus (-) sign.
  3. Move all remaining characters, up to the decimal point, or a space, in a temporary work area DIGIT-GROUP.
  4. If DIGIT-GROUP has more than eleven digits in a COBOL program or more than nine digits in a PL/I program, exit with error code G122. Otherwise, move the contents of DIGIT-GROUP to a second temporary work area WS-FIELD-NUM.
  5. If a decimal was found, place all the following numeric characters in DIGIT-GROUP.
  6. If there are more than seven digits in the resulting DIGIT-GROUP value, exit with error code G122. Otherwise, move DIGIT-GROUP to WS-FIELD-NUM following the original digits and a decimal point.
  7. If the remaining unprocessed characters are blank, perform the following calculation to obtain the correct sign:
    WORKFLD-NUMERIC = 0 {+│-} ES-FIELD-NUM.
    

    +│- is the sign stored as the first nonblank character from the input field. If no character is found, plus (+) is assumed.

    If any of the remaining unprocessed characters are not blanks, exit with error code G122.

IFULLCAR

Function

Verify that there are no blanks in an input field. The difference between IFULLCAR and INBALPHA is that IFULLCAR allows no blanks at all. INBALPHA allows leading and trailing blanks.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the input field.

Input

TPI-fieldname

Contents of the TP input buffer (the character field being checked for blanks).

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected
  • G122— An error was detected during the edit

Output

WORKFLD-ALPHA

Edited field. It is a 256-byte alphanumeric field.

Edit processing

  1. Scan for blanks.
  2. Return an error code of G122 if any blanks are found. Otherwise, move the field to WORKFLD-ALPHA and exit.

IFORMAT

Function

Reformats input.

Specification for this special edit is made by entering the FORMAT command in the SPEC field on the Update Output/Input/Outin Field screen.

See Update Output/Input/Outin Field or Update Batch Output Fields for more information.

IFULLNUM

Verify that all input characters in the field are numeric.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the input field.

Input

TPI-fieldname

Contents of the TP input buffer (the number being checked).

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected
  • G124— An error was detected during the edit

Output

WORKFLD-NUMERIC

Edited field in the COBOL S9(11)V9(7) format or the PL/I PIC (10)9V(4)9T format.

Edit processing

  1. Test all positions for valid numeric characters.
  2. If any non-numeric characters are found, exit with error code G124.
  3. Right-justify and zero-fill the input value and move it to WORKFLD-NUMERIC.

IHEX

Function

Converts a hex-character string to the hexadecimal equivalent for each pair of hex-character representations (for example, 'C1F2' converts to 'A1').

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the edited field. This must be between 1 and 256.

Input

TPI-fieldname

Field to be converted by this routine, from the TP input buffer.

Output

FIELD-EDIT-ERROR

Error status of the edit.

Output

WORKFLD-ALPHA

Converted value.

Edit processing

  1. Determine the length of the input field.
  2. Use the assembler language TRANSLATE instruction to convert the output from hex-representation to its character equivalent.
  3. Assign FIELD-EDIT-ERROR.

IHEXA

Function

Converts a hex-character string of one to eight bytes to the hexadecimal equivalent for each pair of hex-character representations (for example, 'C1F2' converts to 'A1'). This field edit is designed specifically for converting addresses.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the edited field. This must be between 1 and 256.

Input

TPI-fieldname

Field to be converted by this routine, from the TP input buffer.

Output

FIELD-EDIT-ERROR

Error status of the edit.

Output

WORKFLD-ALPHA

Converted value.

Edit processing

  1. Determine the length of the input field.
  2. Use the assembly language TRANSLATE instruction to convert the output from hex-representation to hexadecimal.
  3. Right-justify the input into the full-word output field.
  4. Assign FIELD-EDIT-ERROR.

IINTCDT

Function

Validates a date entered as dd/mm/ccyy or dd-mm-ccyy (if TPI-datefield-LTH is 10) and stores it in ccyymmdd format.

A call to this field edit is generated in either of these cases:

Parameters

Type

Name

Description

Input

TPI-datefield-LTH

Length of the input field. It must be eight or ten bytes.

Input

TPI-datefield

Field to be validated by this routine, from the TP input buffer.

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected
  • ERR1— Length error
  • G123— An error was detected during validation of an eight-byte date
  • G130— An error was detected during validation of a ten-byte date

Output

WORKFLD-NUMERIC

Converted date. In a COBOL PIC S9 (11) V9 (7) field, the date is laid out as 000ccyymmdd0000000. In a PL/I PIC (10)9V (4)9T field, the date is laid out as 00ccyymmdd00000.

Edit processing

  1. Determine the input field length.
  2. If 10, check for valid delimiters ('/' or '-'). If invalid delimiters are found, set FIELD-EDIT-ERROR to G130.
  3. Move date to WORKFLD-NUMERIC and test for valid day, month, century, and year.
  4. If invalid, set FIELD-EDIT-ERROR to the appropriate error code. Otherwise, return edited date in WORKFLD-NUMERIC.

    Note: Cc and yy are tested only for valid numeric characters. Dd and mm are edited for both numeric and valid month-day combinations.

IINTCJUL

Function

Validates a date entered as dd/mm/ccyy or dd-mm-ccyy (if TPI-datefield-LTH is 10) and stores it in ccyyddd format.

A call to this field edit is generated in either of these cases:

Parameters

Type

Name

Description

Input

TPI-datefield-LTH

Length of the input field. It must be eight or ten bytes.

Input

TPI-datefield

Field to be validated by this routine, from the TP input buffer.

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected
  • ERR1— Length error

Output

WORKFLD-NUMERIC

Converted date. In a COBOL PIC S9(11)V9(7) field, the date is laid out as 0000ccyyddd0000000. In a PL/I PIC (10)9V(4)9T field, the date is laid out as 000ccyyddd00000.

Edit processing

  1. Determine the input field length.
  2. If 10, check for valid delimiters ('/' or '-'). If invalid delimiters are found, set FIELD-EDIT-ERROR to ERR1.
  3. Test for valid day, month, and year. If invalid, set FIELD-EDIT-ERROR to the ERR1 error code. Otherwise, convert the edited date to ccyyddd and move it to WORKFLD-NUMERIC.

    Note: Cc and yy are tested only for valid numeric characters. Dd and mm are edited for both numeric and valid month-day combinations.

ICJULIAN

Function

Checks input for a valid date format, mm/dd/ccyy or mmd-dd-ccyy (if TPI-datefield-LTH is 10) or mmddccyy (if TPI-datefield-LTH is 8).

Note: If the INTDATE parameter in TLNIIS is set to 'I,' a call to IINTCJUL is generated in place of a call to ICJULIAN. See IINTCJUL later in this appendix.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the input field. It must be eight or ten bytes.

Input

TPI-fieldname

Field to be validated by this routine, from the TP input buffer (the date to be edited).

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected
  • ERR1— Length error

Output

WORKFLD-NUMERIC

Julian date in a COBOL PIC S9(11)V9(7) format laid out as 0000ccyyddd0000000 or a PL/I PIC (10)9V(4)9T format laid out as 000ccyyddd00000 in PL/I.

Edit processing

  1. If the length is 10, test for valid delimiters ('/' or '-'). Exit with error code ERR1 if they are not found.
  2. Test for valid day, month, and year (cc is checked simply for valid numeric value). Exit with error code ERR1 if anyone is invalid.
  3. Convert the date to Julian format (ccyyddd) and move the results to WORKFLD-NUMERIC.

IINTLDT

Function

Validates a date entered as dd/mm/yy or dd-mm-yy (if TPI-datefield-LTH is 8), or ddmmyy (if TPI-datefield-LTH is 6), and stores it in yymmdd format

A call to this field edit is generated in either of these cases:

Parameters

Type

Name

Description

Input

TPI-datefield-LTH

Length of the input field. It must be six or eight bytes.

Input

TPI-datefield

Field to be validated by this routine, from the TP input buffer.

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected
  • G123— An error was detected during validation of a six-byte date
  • G130— An error was detected during validation of an eight-byte date

Output

WORKFLD-NUMERIC

Converted date. In a COBOL PIC S9(11)V9(7) field, the date is laid out as 00000yymmdd0000000. In a PL/I PIC (10)9V(4)9T field, the date is laid out as 0000yymmdd00000.

Edit processing

  1. Determine the input field length.
  2. If 8, check for valid delimiters ('/' or '-'). If invalid delimiters are found, set FIELD-EDIT-ERROR to G130.
  3. Move date to WORKFLD-NUMERIC and test for valid day, month, and year.
  4. If invalid, set FIELD-EDIT-ERROR to the appropriate error code. Otherwise, return edited date in WORKFLD-NUMERIC.

    Note: Yy is tested only for valid numeric characters. Dd and mm are edited for both numeric and valid month-day combinations.

IINTLJUL

Function

Validates a date entered as dd/mm/yy or dd-mm-yy (if TPI-datefield-LTH is 8) or ddmmyy (if TPI-datefield-LTH is 6), and store it in yyddd format.

A call to this field edit is generated in either of these cases:

Parameters

Type

Name

Description

Input

TPI-datefield-LTH

Length of the input field. It must be six or eight bytes.

Input

TPI-datefield

Field to be validated by this routine, from the TP input buffer.

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected.
  • ERR1— An error was detected during validation.

Output

WORKFLD-NUMERIC

Converted date. In a COBOL PIC S9(11)V9(7) field, the date is laid out as 000000yyddd0000000. In a PL/I PIC (10)9V(4)9T field, the date is laid out as 00000yyddd00000.

Edit processing

  1. Determine the input field length.
  2. If 8, check for valid delimiters ('/' or '-'). If invalid delimiters are found, set FIELD-EDIT-ERROR to ERR1.
  3. Test for valid day, month, and year. If invalid, set FIELD-EDIT-ERROR to ERR1. Otherwise, convert edited date to yyddd and move it to WORKFLD-NUMERIC.

    Note: Yy is tested only for valid numeric characters. Dd and mm are edited for both numeric and valid month-day combinations.

IJULIAN

Function

Checks input for a valid date format, mm/dd/yy or mm-dd-yy (if TPI-datefield-LTH is 8) or mmddyy (if TPI-datefield-LTH is 6).

Note: If the INTDATE parameter in the macro TLNIIS is set to 'I', a call to IINTLJUL is generated in place of a call to IJULIAN. For more information, see IINTLJUL.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the input field. This must be 6 or 8.

Input

TPI-fieldname

Contents of the TP input buffer (the date to be edited).

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected.
  • ERR1— An error was detected during validation.
  •  

Output

WORKFLD-NUMERIC

Returns the Julian date in a COBOL PIC S9(11)V9(7) field, the date is laid out as 000000yyddd0000000 in a PL/I PIC (10)9V(4)9T field, the date is laid out as 00000yyddd00000.

Edit processing

  1. If the field length is 8, test for valid delimiters (/ or -). Exit with error code ERR1 if they are not found.
  2. Test for valid day, month, and year. (Yy is checked simply for valid numeric value.) Exit with error code ERR1 if any one is invalid.
  3. Convert the date to Julian format of yyddd and move the results to WORKFLD-NUMERIC.

ILALPHA

Function

Left-justifies a character field.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the input fields.

Input

TPI-fieldname

Contents of the TP input buffer (the field to be left-justified).

Output

WORKFLD-ALPHA

Edited field as a 256-byte alphanumeric field.

Edit processing

  1. Start on left and search for the first nonblank character.
  2. Compute length of remaining field.
  3. Use the result to left-justify the result in WORKFLD-ALPHA.

ILNULL

Function

Left-justifies a character field.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the input field.

Input

TPI-fieldname

Contents of the TP input buffer (the field to be left-justified).

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected

Output

WORKFLD-ALPHA

Result of the edit as a 256-byte alphanumeric field.

Output

WK-fieldname-NN

Null indicator variable.

Edit processing

If the input field is blank, set the null indicator to -1. Otherwise, set the null indicator to 0 and:

  1. Start on the left and search for the first nonblank character.
  2. Compute length of remaining field.
  3. Use the result to left-justify the remaining characters into WORKFLD-ALPHA.

ILVCHAR

Function

Left-justifies a variable-length character field.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the input fields.

Input

TPI-fieldname

Contents of the TP input buffer (the variable length field to be left-justified).

Output

WORKFLD-VCHAR

Edited field as a 256-byte alphanumeric variable-length field.

Edit processing

  1. Start on left and search for the first nonblank variable-length character.
  2. Search for the last nonblank variable-length character.
  3. Compute length of remaining field.
  4. Use the result to left-justify the result in WORKFLD-VCHAR.
  5. Move the length to the length part of WORKFLD-VCHAR.

ILVNULL

Function

Left-justifies a variable-length character field.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the input field.

Input

TPI-fieldname

Contents of the TP input buffer (the variable-length field to be left-justified).

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected

Output

WORKFLD-VCHAR

Result of the edit as a 256-byte variable-length alphanumeric field.

Output

WK-fieldname-NN

Null indicator variable.

Edit processing

If the input field is blank, set the null indicator to -1. Otherwise, set the null indicator to 0, and:

  1. Start on the left and search for the first nonblank character.
  2. Search for the last nonblank character.
  3. Compute length of remaining field.
  4. Use the result to left-justify the remaining characters into WORKFLD-VCHAR.
  5. Move the length of the remaining field to the length portion of the WORKFLD-VCHAR.

INBALPHA

Function

Checks for imbedded blanks. INBALPHA differs from IFULLCAR because it allows leading and trailing blanks. IFULLCAR allows neither.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the input field.

Input

TPI-fieldname

Contents of the TP input buffer (the character field being checked for imbedded blanks).

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected
  • G122— An error was detected during the edit

Output

WORKFLD-ALPHA

Edited field in a 256-byte alphanumeric field.

Edit processing

  1. Search for the first nonblank character.
  2. Search for the next nonblank character or end-of-field.
  3. If end-of-field is reached before the next nonblank, move the input field to WORKFLD-ALPHA and exit without an error code.
  4. If a blank is found, make sure all remaining characters are blank. If they are, move the input field to WORKFLD-ALPHA and exit without an error code. If another nonblank is found, exit with error code G122.

INBNULL

Function

Checks for imbedded blanks. This edit allows for leading and trailing blanks.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the input field.

Input

TPI-fieldname

Contents of the TP input buffer (the field being checked for imbedded blanks).

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected
  • N122— An error was detected during the edit

Output

WORKFLD-ALPHA

Result of the edit as a 256-byte alphanumeric field.

Output

WK-fieldname-NN

Null indicator variable.

Edit processing

If the input field is blank, set the null indicator to -1. Otherwise, set the null indicator to 0, and:

  1. Search for the first nonblank character.
  2. Search for the next nonblank character or end-of-field.
  3. If end-of-field is reached before the next nonblank character, move the input field to WORKFLD-ALPHA and exit without an error code.
  4. If a blank is found, make sure all remaining characters are blank. If they are, move the input field to WORKFLD-ALPHA and exit without an error code. If another nonblank character is found, exit with error code N122.

INBVCHAR

Function

Checks for imbedded blanks. This edit allows leading and trailing blanks.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the input fields.

Input

TPI-fieldname

Contents of the TP input buffer (the variable-length character field being checked for imbedded blanks).

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected
  • G122— An error was detected during the edit

Output

WORKFLD-VCHAR

Edited field in a 256-byte alphanumeric variable-length field.

Edit processing

  1. Search for the first nonblank character.
  2. Search for the next nonblank character or end-of-field.
  3. If end-of-field is reached before the next nonblank, move the input field to WORKFLD-VCHAR and exit without an error code.
  4. If a blank is found, make sure all remaining variable-length characters are blank. If they are, move the input field to the character part of WORKFLD-VCHAR, move the length to the length part of WORKFLD-VCHAR and exit without an error code. If another nonblank is found, exit with error code G122.

INBVNULL

Function

Checks for imbedded blanks in a variable-length character field. This edit allows for leading and trailing blanks.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the input field.

Input

TPI-fieldname

Contents of the TP input buffer (the variable-length field being checked for imbedded blanks).

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected
  • N122— An error was detected during the edit

Output

WORKFLD-VCHAR

Result of the edit as a 256-byte variable-length alphanumeric field.

Output

WK-fieldname-NN

Null indicator variable.

Edit processing

If the input field is blank, set the null indicator to -1. Otherwise, set the null indicator to 0, and:

  1. Search for the first nonblank character.
  2. Search for the next nonblank character or end-of-field.
  3. If end-of-field is reached before the next nonblank character, move the input field to the character portion of WORKFLD-VCHAR, move the length to the length portion of WORKFLD-VCHAR, and exit without an error code.
  4. If a blank is found, make sure all remaining variable-length characters are blank. If they are, move the input field to the character portion of the WORKFLD-VCHAR, move the length to the length portion of WORKFLD-VCHAR, and exit without an error code. If another nonblank character is found, exit with error code N122.

INULL

Function

Checks for a completely blank field.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the input field.

Input

TPI-fieldname

Contents of the TP input buffer (the field to be checked).

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected

Output

WORKFLD-ALPHA

Returns the result of the edit as a 256-byte alphanumeric field.

Output

WK-fieldname-NN

Null indicator variable.

Edit processing

If the input field is blank, set the null indicator to -1. Otherwise, set the null indicator to 0, and move the contents of TPI-fieldname to WORKFLD-ALPHA.

INUMERIC

Function

Checks for a valid integer. This field edit allows for leading and trailing blanks, but not imbedded blanks and non-numeric characters.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the input field.

Input

TPI-fieldname

Contents of the TP input buffer (the number to be edited).

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected
  • G122— An error was detected during the edit

Output

WORKFLD-NUMERIC

Edited field in the COBOL S9(11)V9(7) format or the PL/I (10)9V(4)9T format.

Edit processing

  1. Search for the first nonblank character. Make sure it is numeric.
  2. Search for the earlier of the next nonblank or the end-of-field. Make sure there are no imbedded blanks and that all characters are numeric.
  3. If no imbedded blanks or non-numeric characters are found, right-justify and zero-fill the field in WORKFLD-NUMERIC and exit. Otherwise, exit with error code G122.

INUMNULL

Function

Checks for a valid integer. This edit allows leading and trailing blanks, but not imbedded blanks and non-numeric characters.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the input field.

Input

TPI-fieldname

Contents of the TP input buffer (the field being edited).

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected
  • N122— An error was detected during the edit

Output

WORKFLD-NUMERIC

Result of the edit in the COBOL S9(11)V9(7) format or PL/I (10)9V(4)9T format.

Output

WK-fieldname-NN

Null indicator variable.

Edit processing

If the input field is blank, set the null indicator to -1. Otherwise, set the null indicator to 0, and:

  1. Search for the first nonblank character. Make sure it is numeric.
  2. Search for the earlier of the next nonblank character or end-of-field. Make sure there are no imbedded blanks and that all characters are numeric.
  3. If no imbedded blanks or non-numeric characters are found, right-justify and zero-fill the field in WORKFLD-NUMERIC, and exit the edit. Otherwise, exit the edit with an error code of N122.

ISTATE

Function

Verify that a valid two-character postal state code is entered.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the input field. It must always be 2.

Input

TPI-fieldname

Contents of the TP input buffer (the state code to be checked).

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected
  • G133— An error was detected during the edit

Output

WORKFLD-ALPHA

Returns the edited field in a 256-byte alphanumeric field.

Edit processing

  1. Move TPI-fieldname to WORKFLD-ALPHA.
  2. Verify the contents of WORKFLD-ALPHA against a state-code table that includes the 50 states, the District of Columbia, and Puerto Rico.
  3. If there is a match, exit with no error. Otherwise, exit with error code G133.

IVCHAR

Function

Moves a variable-length character field.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the input field.

Input

TPI-fieldname

Contents of the TP input buffer (the variable-length character field to be moved).

Output

WORKFLD-VCHAR

Edited field in a 256-byte (maximum) alphanumeric variable-length character field and the length of the variable-length character field.

Edit processing

  1. Search for the last nonblank character.
  2. Determine remaining length of field.
  3. Move the input field to the character part of WORKFLD-VCHAR.
  4. Move the length to the length part of WORKFLD-VCHAR.

IVNULL

Function

Sets a null indicator based on the contents of a variable-length character field. This edit can be used to check for a blank input field.

Parameters

Type

Name

Description

Input

TPI-fieldname-LTH

Length of the input field.

Input

TPI-fieldname

Contents of the TP input buffer (the variable-length field to be checked).

Output

FIELD-EDIT-ERROR

Error status of the edit. Possible values are:

  • Spaces— No error was detected

Output

WORKFLD-VCHAR

Result of the edit as a 256-byte variable-length alphanumeric field.

Output

WK-fieldname-NN

Null indicator variable.

Edit processing

If the input field is blank, set the null indicator to -1. Otherwise, set the null indicator to 0, and:

  1. Search for the first nonblank character.
  2. Determine the remaining length of field.
  3. Move the input field to the character portion of WORKFLD-VCHAR.
  4. Move the length to the length portion of WORKFLD-VCHAR.

Calls to Field Edit Modules

Automatic calls to input or output edits, whether CA Telon- or user-supplied, always pass parameters in the order shown in the examples below.

Output edit processing

The following code shows an automatic call to an output edit, the CA Telon-supplied DATE output edit routine. DAY is the screen field to receive the edited output.

COBOL

CALL 'ODATE   '  USING TPO-DAY
    TPO-DAY-LTH,
    WORKFLD-NUMERIC.

PL/I

CALL ODATE (TPO_DAY,
    TPO_DAY_LTH,
    WORKFLD_NUMERIC);

Input edit processing

The following code shows the automatic call to an input edit, the CA Telon-supplied DATE input edit routine. DAY is the screen field holding the input to be edited. The edited data is returned to WORKFLD-NUMERIC.

COBOL

CALL 'IDATE   '  USING FIELD-EDIT-ERROR  TPI-DAY-LTH
    TPI-DAY
    WORKFLD-NUMERIC.

PL/I

CALL  IDATE (FIELD_EDIT_ERROR,
    TPI_DAY_LTH,
    TPI_DAY,
    WORKFLD_NUMERIC);


Copyright © 2010 CA. All rights reserved. Email CA about this topic