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

Convert PD(9,2) to PD(13,4)


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ursvmg

New User


Joined: 24 May 2007
Posts: 52
Location: Chennai

PostPosted: Fri Oct 23, 2009 7:39 pm
Reply with quote

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
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Oct 23, 2009 9:04 pm
Reply with quote

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.
Back to top
View user's profile Send private message
ursvmg

New User


Joined: 24 May 2007
Posts: 52
Location: Chennai

PostPosted: Tue Oct 27, 2009 10:27 am
Reply with quote

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
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Oct 27, 2009 7:52 pm
Reply with quote

Hello,

You might multiply the PD value by 100 and then use the proper mask to show the "output" as you want it.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
No new posts convert file from VB to FB and use tr... DFSORT/ICETOOL 8
No new posts Convert HEX to Numeric DB2 3
Search our Forums:

Back to Top