Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

make arithmetic picture type variable which contains comma

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: make arithmetic picture type variable which contains comma
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: 2422
Location: Netherlands, Amstelveen

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

see :

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

Global Moderator


Joined: 10 May 2007
Posts: 1722
Location: UK

PostPosted: Wed Jul 13, 2011 11:24 am    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Wed Jul 13, 2011 6:30 pm    Post subject: Reply to: make arithmetic picture type variable which contai
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Single COPY CICS TS datasets and when... Kyle Carroll CICS 2 Tue Oct 11, 2016 9:47 pm
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts Removing Extra Spaces in a comma sepa... Puspojit DFSORT/ICETOOL 3 Tue Sep 13, 2016 7:46 am
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us