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
 

 

update total in trailer

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

New User


Joined: 27 Sep 2006
Posts: 13
Location: India

PostPosted: Thu Mar 21, 2013 2:46 pm    Post subject: update total in trailer
Reply with quote

My input is
H00000
D00020
D00030
D00025
T00000

output expected is, trailer should have sum of fields 2:5 from detail record

H00000
D00020
D00030
D00025
T00075
Back to top
View user's profile Send private message

charanmsrit

New User


Joined: 25 Oct 2007
Posts: 80
Location: Australia

PostPosted: Thu Mar 21, 2013 4:00 pm    Post subject:
Reply with quote

What are you expecting when your input is?

Code:

H00000
D99991
D00005
D00004
T00000
Back to top
View user's profile Send private message
saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Thu Mar 21, 2013 9:06 pm    Post subject:
Reply with quote

Please try below mentioned Sort Card

Code:
 SORT FIELDS=COPY                         
 OUTFIL FNAMES=SORTOUT,                   
 INCLUDE=(1,1,CH,EQ,C'D'),               
 IFTRAIL=(HD=YES,TRLID=(1,1,CH,EQ,C'T'), 
 TRLUPD=(2:TOT=(5,2,ZD,EDIT=(TTTTT))))   


Input:

Code:
H00012   
D99991   
D00005   
D00004   
T00000   


Output:

Code:
H00012     
D99991     
D00005     
D00004     
T00100     
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Thu Mar 21, 2013 10:51 pm    Post subject:
Reply with quote

And how did you come to the conclusion that that peculiar arithmetic in fact fills the requirement?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Thu Mar 21, 2013 10:54 pm    Post subject: Reply to: update total in trailer
Reply with quote

because the wrong position/lenghts were used
TRLUPD=(2:TOT=(5,2,ZD,EDIT=(TTTTT))))
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Thu Mar 21, 2013 11:16 pm    Post subject:
Reply with quote

IOW, Sai didn't actually check heesh work, just saw that it ran to CC=0 and said, "Good enough!"
Back to top
View user's profile Send private message
saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Thu Mar 21, 2013 11:20 pm    Post subject:
Reply with quote

Quote:
output expected is, trailer should have sum of fields 2:5 from detail record


Sorry i didn't notice the 2:5
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri Mar 22, 2013 2:40 am    Post subject:
Reply with quote

saiprasadh wrote:
Quote:
output expected is, trailer should have sum of fields 2:5 from detail record


Sorry i didn't notice the 2:5


Apart from that why do have an INCLUDE condition on OUTFIL? Unless I missed that there are other records(apart from the header and trailer), you don't really need the include condition.

smileseenu,

You need to expand the total field as the sum might cause an overflow with just 5 bytes.
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 -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts 2 vsam file compare and update a fiel... ABINAYATHULASI DFSORT/ICETOOL 6 Sun May 29, 2016 11:15 am
No new posts Update the Sortout file with record c... karthik_sripal SYNCSORT 8 Tue May 17, 2016 8:52 pm


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