I want the value of +0.180 in the variable W03-FCTR. But when i put display statements i am getting an Illegal value in the variable W03-FCTR.
Should this work?
I am aware that if we declare '+' sign explicitly, then it is a special character, so i cannot store +0.180 in S9V999.
Do i need to seperate the declaration OF SIGN as below:
01 W03-Table-R REDEFINES W03-Table.
03 W03-TABLE-ENTRY OCCURS 5 TIMES INDEXED BY W03-INDEX.
05 W03-DED PIC X(6).
05 FILLER PIC X.
05 W03-SIGN PIC X.
05 W03-FCTR PIC 9V999.
You had a clue from your redefines. The field being redefined was two bytes longer. The S and the V take up no (extra) storage. The V no storage at all, the Compiler just needs it for lining-up for moves/calculations/tests, the S takes up a half-byte which is already being used for a sign, a value (F) to indicate that it is unsigned.
If you want to be able to use the number, search the forum for use of function NUMVAL, or have a look at de-editing in a post by Bill O'Boyle in the forum.