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: 1771
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: 10274
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: 1771
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 Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts DSNACCOX (can it be run on 1 db/ts, t... SRICOBSAS DB2 5 Sat May 06, 2017 12:59 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am


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