In converting some very old RPG:
... to free-format RPG/ILE (using a tool), I'm getting a (justifiable) error on the converted code:
Of course, you can't have an 80-byte zoned numeric. But could the original have compiled many years ago? Did the compiler accept the @NN definition, assuming from the DIM(10) keyword that it defined ten equal-sized sub-fields (ZONED(8:0))? Is this how RPG worked when using the starting-and-ending-position notation? I find this fascinating!
And I'm assuming the following would work with the original code? Yes?
Code:
[FONT=courier new]D DS D @NN 1 80 0 DIM(10) D NNN001 1 8 0 D NNN002 9 16 0 D NNN003 17 24 0 D NNN004 25 32 0 D NNN005 33 40 0 D NNN006 41 48 0 D NNN007 49 56 0 D NNN008 57 64 0 D NNN009 65 72 0 D NNN010 73 80 0[/FONT]
Code:
// Free-format: [FONT=courier new]DCL-DS *n; @NN ZONED(80) DIM(10) POS(1); // RNF0503. Length of numeric item is greater than 63 digits NNN001 ZONED(8) POS(1); NNN002 ZONED(8) POS(9); NNN003 ZONED(8) POS(17); NNN004 ZONED(8) POS(25); NNN005 ZONED(8) POS(33); NNN006 ZONED(8) POS(41); NNN007 ZONED(8) POS(49); NNN008 ZONED(8) POS(57); NNN009 ZONED(8) POS(65); NNN010 ZONED(8) POS(73); END-DS;[/FONT]
And I'm assuming the following would work with the original code? Yes?
Code:
[FONT=courier new]DCL-DS *n; @NN ZONED(8) DIM(10); NNN001 ZONED(8) POS(1); NNN002 ZONED(8) POS(9); NNN003 ZONED(8) POS(17); NNN004 ZONED(8) POS(25); NNN005 ZONED(8) POS(33); NNN006 ZONED(8) POS(41); NNN007 ZONED(8) POS(49); NNN008 ZONED(8) POS(57); NNN009 ZONED(8) POS(65); NNN010 ZONED(8) POS(73); END-DS;[/FONT]
Comment