0

How do I declare a 2 digit integer with leading zero openvms

Example:

$month = 01
$month = month + 1
$write sys$output month

I want month to now be 02.

hakre
  • 193,403
  • 52
  • 435
  • 836

1 Answers1

2

You don't. A symbol can be either a string or an integer. A string can contain zeroes or other characters wherever you want them. An integer just contains a numeric value.

You can format an integer as a string with leading zeroes using the f$fao lexical function:

$ FormattedMonth = f$fao( "!2ZB", month )

Ref: f$fao.

HABO
  • 15,314
  • 5
  • 39
  • 57