I have two picture type variable as below, and I need get the sum value of them, but I get 612 code error with following solution, how can I fix the error? thanks in advance.
DCL A PIC'ZZ,ZZZ,ZZZ,ZZ9V.999-' INIT('12,23.203-');
DCL B PIC'ZZ,ZZZ,ZZZ,ZZ9V.999-' INIT('12.203+');
DCL A1 FIXED(14,3) INIT(0);
DCL B1 FIXED(14,3) INIT(0);
DCL C FIXED(14,3) INIT(0);
A1 = A;
B1 = B;
C = A1+B1;
pli is anyway smarter than You think
it works for me
Code:
****** ***************************** Top of Data ******************************
000001 Picts:
000002 Proc Options(Main);
000003 dcl a pic'zz,zz,zz,zz,z9V.999-' init(-11111111.001)
000004 dcl b pic'zz,zz,zz,zz,z9V.999-' init(22222222.002)
000005 dcl c pic'zz,zz,zz,zz,z9V.999-' init(0)
000006 put skip list ('a :',a);
000007 put skip list ('b :',b);
000008 put skip list ('c :',c);
000009 c = a + b ;
000010 put skip list ('c +:',c);
000011 End;
****** **************************** Bottom of Data ****************************
the result
Code:
********************************* TOP OF DATA **********************************
a : 11,11,11,11.001-
b : 22,22,22,22.002
c : 0.000
c +: 11,11,11,11.001
******************************** BOTTOM OF DATA ********************************