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
 

 

Sum the data with decimal using SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
cvadlamudi

New User


Joined: 19 Apr 2007
Posts: 68
Location: India

PostPosted: Tue Jul 22, 2008 10:20 am    Post subject: Sum the data with decimal using SORT
Reply with quote

Hi,

Please someone throw light on this
I have a inputfile in the below format

Input file

AA0001.75
AA0000.25
AA0000.15
BB0000.50
BB0000.75
CC0000.25

Output file

AA0002.15
BB0001.25
CC0000.25

I have to sumup the data of AA in 1 record, BB in 1 record and CC in 1 record.

Regards,
Mouli
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 Jul 22, 2008 9:09 pm    Post subject:
Reply with quote

Hello,

You can use the technique described in the "Sum a number with a decimal point" Smart DFSORT Trick at:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
Back to top
View user's profile Send private message
sudhakar84

New User


Joined: 20 Jun 2008
Posts: 21
Location: chennai

PostPosted: Tue Jul 22, 2008 10:21 pm    Post subject: Reply to: Sum the data with decimal using SORT
Reply with quote

have u tried giving PD instead of ZD
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Jul 22, 2008 11:03 pm    Post subject:
Reply with quote

Quote:
have u tried giving PD instead of ZD


Have you? If you did, you'd have found out that it results in an S0C7 abend.

Why would you possibly think that PD would work for a value of the form 'dddd.dd'? That is NOT a PD value (or even a ZD value). A positive 7-byte PD value looks like this in hex:

Code:

dddddddddddddC 


'dddd.dd' looks like this in hex:

Code:

FdFdFdFd4BFdFd


Do those look the same to you?

The internal representation of a PD value cannot have a decimal point. (The decimal point can be implied and added for external display.)

Dick has given a link to the correct Smart DFSORT Trick to handle this situation.

Posting misinformation without testing your "theory" really doesn't help anyone. We have two DFSORT developers answering questions in this Forum (myself and Kolusu) so we really don't need your "help".
Back to top
View user's profile Send private message
cvadlamudi

New User


Joined: 19 Apr 2007
Posts: 68
Location: India

PostPosted: Fri Jul 25, 2008 10:16 am    Post subject: Reply to: Sum the data with decimal using SORT
Reply with quote

Thanks a lot dick, it works fine for me.
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 Jul 25, 2008 7:19 pm    Post subject: Reply to: Sum the data with decimal using SORT
Reply with quote

Good to hear it is working - thank you for letting us know icon_smile.gif

d
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am


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