HP COBOL II/XL Quick Reference Guide (31500-90015)

E- 1
Appendix E COBOL Functions
The following tables lists and briefly describes each COBOL function.
The syntax for each function follows.
Table E-1. Date Functions
--------------------------------------------------------------------
- Function - Type - Value Returned -
--------------------------------------------------------------------
| CURRENT-DATE | Alphanumeric | Current date and time and |
| | | difference from Greenwich Mean |
| | | Time. |
--------------------------------------------------------------------
| DATE-OF- | Integer | Standard date equivalent |
| INTEGER | | (YYYYMMDD) of integer date. |
--------------------------------------------------------------------
| DAY-OF-INTEGER | Integer | Julian date equivalent (YYYYDDD) |
| | | of integer date. |
--------------------------------------------------------------------
| INTEGER-OF- | Integer | Integer date equivalent of |
| DATE | | standard date (YYYYMMDDD). |
--------------------------------------------------------------------
| INTEGER-OF-DAY | Integer | Integer date equivalent of |
| | | Julian date (YYYYDDD). |
--------------------------------------------------------------------
| WHEN-COMPILED | Alphanumeric | Date and time program was |
| | | compiled. |
--------------------------------------------------------------------
Table E-2. String Functions
--------------------------------------------------------------------
- Function - Type - Value Returned -
--------------------------------------------------------------------
| CHAR | Alphanumeric | The character in a specified |
| | | position of the program |
| | | collating sequence. |
--------------------------------------------------------------------
| LENGTH | Integer | Length, in character positions, |
| | | of the parameter. |
--------------------------------------------------------------------
| LOWER-CASE | Alphanumeric | The same parameter with all |
| | | uppercase letters replaced by |
| | | lowercase letters. |
--------------------------------------------------------------------
| NUMVAL | Numeric | Numeric value of a simple |
| | | numeric string. |
--------------------------------------------------------------------
| NUMVAL-C | Numeric | Numeric value of a numeric |
| | | string with optional commas and |
| | | currency sign. |
--------------------------------------------------------------------
| ORD | Integer | Ordinal position of the |
| | | parameter in collating sequence. |
--------------------------------------------------------------------
| REVERSE | Alphanumeric | Same parameter with characters |
| | | in reverse order. |
--------------------------------------------------------------------
| UPPER-CASE | Alphanumeric | Same parameter with all |
| | | lowercase letters replaced by |
| | | uppercase letters. |
--------------------------------------------------------------------