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

Author Message

New User

Joined: 19 Apr 2007
Posts: 68
Location: India

 Posted: Tue Jul 22, 2008 10:20 am    Post subject: Sum the data with decimal using SORT 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

dick scherrer

Site Director

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

 Posted: Tue Jul 22, 2008 9:09 pm    Post subject: 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/
sudhakar84

New User

Joined: 20 Jun 2008
Posts: 21
Location: chennai

 Posted: Tue Jul 22, 2008 10:21 pm    Post subject: Reply to: Sum the data with decimal using SORT have u tried giving PD instead of ZD
Frank Yaeger

DFSORT Moderator

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

Posted: Tue Jul 22, 2008 11:03 pm    Post subject:

 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".

New User

Joined: 19 Apr 2007
Posts: 68
Location: India

 Posted: Fri Jul 25, 2008 10:16 am    Post subject: Reply to: Sum the data with decimal using SORT Thanks a lot dick, it works fine for me.
dick scherrer

Site Director

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

 Posted: Fri Jul 25, 2008 7:19 pm    Post subject: Reply to: Sum the data with decimal using SORT Good to hear it is working - thank you for letting us know d
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am

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