However, the result that you apparently want can be obtained in at least two different ways.
You can REDEFINE an area with multiple definitons. At run-time, choose which field will be the target for the data you MOVE into it.
You can also simply declare the field as PIC X(18) or however long the space is. Then use edit APIs to apply whatever edit word you want to a value and move the edited value into the field.
Or have two edit patterns and move the appropriate one to your output line.
05 DEBIT-TRUE PIC ZZZZZZZ,ZZZ,ZZ9.99.
05 DEBIT-FALSE PIC ZZZ,ZZZ,ZZZ,ZZ9.99.
10 OP-DEBIT PIC x(18).
MOVE debit-field TO DEBIT-TRUE
MOVE DEBIT-TRUE TO OP-DEBIT
MOVE debit-field TO DEBIT-FALSE
MOVE DEBIT-FALSE TO OP-DEBIT.
WRITE op-file FROM OP-LINE.
Hi Your answer is good but my program is very big so i need to change so many lines instead of that only i asked is there any possibility by using single var… Thanks for ur reply..