IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

update total in trailer


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 81
Location: Australia

PostPosted: Thu Mar 21, 2013 4:00 pm
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
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: 1788
Location: Bloomington, IL

PostPosted: Thu Mar 21, 2013 10:51 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Mar 21, 2013 10:54 pm
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: 1788
Location: Bloomington, IL

PostPosted: Thu Mar 21, 2013 11:16 pm
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts Insert trailer for non empty file only DFSORT/ICETOOL 6
No new posts Comparing Header and Trailer. DFSORT/ICETOOL 7
No new posts Adding a trailer with record count an... JCL & VSAM 4
No new posts Read a flat file and update DB2 table JCL & VSAM 2
Search our Forums:

Back to Top