|
View previous topic :: View next topic
|
| Author |
Message |
seman18
New User
Joined: 08 Feb 2009 Posts: 67 Location: hz
|
|
|
|
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; |
|
| Back to top |
|
 |
PeterHolland
Global Moderator

Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
| Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
12,23.203? Sould be 3 digits to the right of th comma.
And you may, possibly, have to replace the Zs with 9s. |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10902 Location: italy
|
|
|
|
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 ******************************** |
meditate! |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|