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
 

 

Problem with signed zoned decimal

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

New User


Joined: 09 Sep 2010
Posts: 2
Location: Chennai

PostPosted: Thu Jul 26, 2012 12:36 am    Post subject: Reply to: Signed decimal sum using DFSORT
Reply with quote

Hi All,

I have a similar req, so thought to post it here itself. I have a PS which has amount field s9(6)v9(2) in below format

Code:
0000400}
0000375G
0000375P


0000375G means 000037.57

I need to sum up those and use that in trailer record. I have tried to use below sysin:
Code:
SORT FIELDS=(1,1,CH,A)                     
INREC BUILD=(45:21,08,SFF,TO=ZD,LENGTH=08)
SUM FIELDS=(45,8,ZD)                       


say the field starts at position 21. This is giving wrong data and not in input format.
Back to top
View user's profile Send private message

anky.1987

New User


Joined: 09 Sep 2010
Posts: 2
Location: Chennai

PostPosted: Thu Jul 26, 2012 12:53 am    Post subject:
Reply with quote

I just had it correct using below:

SORT FIELDS=(1,1,CH,A)
INREC BUILD=(45:21,08)
SUM FIELDS=(45,8,ZD)
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Jul 26, 2012 2:03 am    Post subject: Reply to: Problem with signed zoned decimal
Reply with quote

anky.1987

Your input is already a zoned decimal number with sign overpunch. Why are you treating it as an Signed Free format and then converting it to ZD? By doing so you are actually loosing the sign. The over punch in hex format looks like this
Code:

{ABCDEFGHI}JKLMNOPQR
01234567890123456789 


Hex C0 thru C9 are positive numbers and D0 thru D9 are negative numbers. The number on top represents the sign overpunch and the lower number represents the readable decimal number

so change your control cards to the following
Code:

//SYSIN    DD *
  OPTION ZDPRINT
  SORT FIELDS=(1,1,CH,A)                     
  SUM FIELDS=(21,8,ZD)
//*


Check this link which explains ZDPRINT effect on SUM statement
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 Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 11 Thu Mar 30, 2017 10:34 am
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm


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