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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Convert PD(9,2) to PD(13,4)
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

Site Director


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

PostPosted: Fri Oct 23, 2009 9:04 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue Oct 27, 2009 7:52 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts convert PD to ZD ram_vizag DFSORT/ICETOOL 5 Sat Nov 05, 2016 3:06 am
No new posts help: convert C'00AB' to X'00AB' alan_gu DFSORT/ICETOOL 1 Thu Sep 29, 2016 12:22 pm


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