Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

9.29 CONVERTDATE_NUMERIC

Note
titleNote: Built-In Function Rules     Usage Options

Converts format of numeric date.

Arguments

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

N

Req

Date that is to be converted

4

8

0

0

2

A

Req

Format of date to be converted

1

1



3

A

Req

Format required of date in return value

1

1



Valid Date Formats

  • Valid formats of the date to be converted: A, B, D, F, H, J, L, V, W, X, Y, Z and 1.

  • Valid formats of the date to be returned: A, B, D, F, H, J, L, V, W, X, Y, Z and 1.

  • Refer to Date Formats

Return Values

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

N

Req

Returned converted date

4

8

0

0

2

A

Opt

Return code (Y or N) for successful conversion

1

1



Technical Notes

All dates must have a four digit year

...

For example if you have a DATE field called DATEFL1, and you want to use it in the Built-In Function as the first argument, you must do a conversion like this:

     DATEFL1.AsNumber(DDMMCCYY)

Please refer to the Intrinsic Function for other formats

...

When using date formats P, Q, R, S, T, U, the date is returned in the format specified in messages BIF0101 and BIF0102 in DC@M01. To have the date returned in a language other than English you should ensure these messages are translated into the appropriate language.

If LANG is something other than ENG or NAT, you will need to ensure the messages exist in the message file for the language you are executing in.

Example RDMLX only:

Use CONVERTDATE_NUMERIC with DATE field type only.

     USE  BUILTIN(CONVERTDATE_NUMERIC) WITH_ARGS(#DATEFL1.AsNumber(DDMMCCYY) H J)TO_GET(#NUM80 )

The following code must be used for a better programming style:

     #NUM80 := #DATEFL1. AsNumber (CCYYMMDD)
#NUM80 is a numeric signed 8 bytes long ,0 decimal .

Example RDML

Convert a date field #YMD in date format YYMMDD (D) to date format DDMMYY (B) in field #DMY:

     USE        BUILTIN(CONVERTDATE_NUMERIC) WITH_ARGS(#YMD D B) TO_GET(#DMY