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
 

 

Signed Zone Decimal Summing

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

Active User


Joined: 03 Aug 2005
Posts: 306

PostPosted: Mon Aug 14, 2006 5:10 pm    Post subject: Signed Zone Decimal Summing
Reply with quote

Hi,

I am having a file which has records in the following format

Code:

12345-333
123450444
12345-444
12345-555
21345-333
213450444


Here the first five bytes can leave it as it is ,and from the 6 byte till 9 byte i have to add and produce the output as follows

Code:

12345-888
213450111


-888 is(-333+444-444-555)

Could you please share your thoughts on this ?

Thanks
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: Mon Aug 14, 2006 9:32 pm    Post subject:
Reply with quote

-888 and 0111 is a rather strange format. What do you do if the negative value has 4 digits? Assuming that the more usual -888 and b111 (b for blank) is ok, here's a DFSORT job that will do what you want:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
12345-333
123450444
12345-444
12345-555
21345-333
213450444
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REMOVECC,NODETAIL,
   SECTIONS=(1,5,
     TRAILER3=(1,5,TOT=(6,4,FS,TO=FS,LENGTH=4)))
/*


SORTOUT will have:

Code:

12345-888 
21345 111 
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 Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts Summing on Mixed Case Literals Roy Ware SYNCSORT 3 Tue Jan 03, 2017 10:18 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Consolidating and summing file contents Kevin Lindsley SYNCSORT 14 Thu Jun 09, 2016 5:24 am


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