IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

make arithmetic picture type variable which contains comma


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
seman18

New User


Joined: 08 Feb 2009
Posts: 67
Location: hz

PostPosted: Wed Jul 13, 2011 10:39 am
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Jul 13, 2011 11:00 am
Reply with quote

see :

ibmmainframes.com/about22565.html
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Wed Jul 13, 2011 11:24 am
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Jul 13, 2011 6:30 pm
Reply with quote

pli is anyway smarter than You think icon_biggrin.gif
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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts trying to make sense of keylists TSO/ISPF 11
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts SMF record type 30 JCL & VSAM 8
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
Search our Forums:

Back to Top