I use a variable as a counter that starts from zero each day, and use this variable as an input to a COBOL program.
Is there a way of defining that the variable will always be sent to the COBOL program as three characters in length, padded to the left with leading zeroes ?
As it is, when the counter contains 1 - 9 the input size is one character, when 10 - 99 it is two characters and only when over 100 is it three characters.
There is no way of automatically padding the field to always be 3 characters with leading zeroes, or forcing right-adjustment, but these PCL coding suggestions are a way of doing this:
|SET &J=L'&SIDURI - set the var to the length.
then it will test the length using IF - and pad zeros as needed
|IF &J EQ 3 SET &SIDURI=&SIDURI
|IF &J EQ 2 SET &SIDURI=0&SIDURI
|IF &J EQ 1 SET &SIDURI=00&SIDURI
|CALL $GVAR I2P2643
|TYPE &SIDURI START VALUE
|IF &SIDURI > 99
|TYPE &SIDURI OVER 100
|IF &SIDURI < 9
|TYPE &SIDURI LESS 10
|IF &SIDURI > 9 IF &SIDURI < 100
|TYPE &SIDURI BETWEEN 10/99