Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
ursvmg

New User

Joined: 24 May 2007
Posts: 52
Location: Chennai

 Posted: Fri Oct 23, 2009 7:39 pm    Post subject: Convert PD(9,2) to PD(13,4) Dear all, I have a requirement in which i need to sum up all the records and output only one record showing the total sum. The field in the input record to summed up is of Packed decimal type with 2 decimal places(length = 5). The output file should contain the total value in PD, length = 7 with 4 decimal places. Say for example, i have 100 records in the input file, each having value 1.11 (in PD format). The field in the input record to be summed up is 10,5 My output record should contain the value 110.0000(in PD format) Note: My shop has only SYNCSORT. Please let me know if you need any other information. Regards, Ursvmg

dick scherrer

Site Director

Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

Posted: Fri Oct 23, 2009 9:04 pm    Post subject:

Hello,

 Quote: My output record should contain the value 110.0000(in PD format)
It can't. . . 110.0000 is not a valid PD value. Leading zeros cannot be suppressed in a packed-decimal field - there will be leading zeros. There can be no decimal-point in a PD field.

 Quote: Please let me know if you need any other information.
Yes, we need to know what you really want.
ursvmg

New User

Joined: 24 May 2007
Posts: 52
Location: Chennai

 Posted: Tue Oct 27, 2009 10:27 am    Post subject: Dear d.sch, Yeah I understand that there will be leading zeroes and no decimal as such in a PD field. Here I'm (I hope) simplifying my question.... I need to convert a PD field like 00000770 0000010C (Value displayed using layout mapped to FIXED DEC(9,2)) = 717.00) to 000007700 00000100C (Value displayed using layout mapped to FIXED DEC(13,4)) = 717.0000) Regards, Ursvmg
dick scherrer

Site Director

Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

 Posted: Tue Oct 27, 2009 7:52 pm    Post subject: Hello, You might multiply the PD value by 100 and then use the proper mask to show the "output" as you want it.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Can EDCICONV convert EBCDIC to ASCII... natt.sut IBM Tools 3 Fri Nov 17, 2017 8:46 pm Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm Convert CLIST to REXX cvnlynn CLIST & REXX 12 Tue Jun 27, 2017 2:06 am Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us