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

Adding trailer with multiple amounts


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
svlim

New User


Joined: 14 Mar 2006
Posts: 2

PostPosted: Tue Nov 03, 2009 2:23 pm
Reply with quote

I have an input file with following structure

00,02/09/2009,03/09/2009
01,ABCD,XXXX,XXX, +100.000
01,XYZZ,VBDF,DFD, +20.000
02,WDDR,DFGF,GDS, -3000.000


I need to add a trailer in the end of the file as follows
99,0005, +120.000, -3000.000

where 99 is a constant
0005 is the number of records in the files including trailer
+120.000 is total of amounts with records having 01 as the 1st 2 bytes
-3000.000 is the total of amounts with records having 02 as the 1st 2 bytes

How to add the above trailer through DFSORT.

The amount filed is of 14 bytes and file length is 80 bytes.


Thanks in Advance.
Back to top
View user's profile Send private message
svlim

New User


Joined: 14 Mar 2006
Posts: 2

PostPosted: Tue Nov 03, 2009 7:29 pm
Reply with quote

For testing purpose I changed the file structure as

00,02/09/2009,03/09/2009
01,+100.0
01, +20.0
02, -10.0

and with following sort card the output was

00,02/09/2009,03/09/2009
01,+100.0
01, +20.0
02, -10.0
99,0004, +120.0, -10.0


Code:

  OPTION COPY
  INREC IFTHEN=(WHEN=(1,2,CH,EQ,C'01'),
          PARSE=(%01=(ABSPOS=4,FIXLEN=6)),
          OVERLAY=(81:%01,SFF,TO=ZD,LENGTH=6)),
          IFTHEN=(WHEN=(1,2,CH,EQ,C'02'),
          PARSE=(%02=(ABSPOS=4,FIXLEN=6)),
          OVERLAY=(87:%01,SFF,TO=ZD,LENGTH=6))
       OUTFIL FNAMES=SORTOUT,BUILD=(1,80),REMOVECC,
        TRAILER1=(C'99',',',COUNT=(EDIT=(TTTT)),',',
                          TOT=(81,6,ZD,EDIT=SIITT.T),SIGNS=(+,-)),',',
                           TOT=(87,6,ZD,EDIT=SIITT.T),SIGNS=(+,-)))
Back to top
View user's profile Send private message
saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Tue Nov 03, 2009 9:51 pm
Reply with quote

Hi svlim,


Your sort card created return code 16. please find the updated one


Code:

  OPTION COPY                                         
  INREC IFTHEN=(WHEN=(1,2,CH,EQ,C'01'),               
          PARSE=(%01=(ABSPOS=4,FIXLEN=6)),           
          OVERLAY=(81:%01,SFF,TO=ZD,LENGTH=6)),     
          IFTHEN=(WHEN=(1,2,CH,EQ,C'02'),           
          PARSE=(%02=(ABSPOS=4,FIXLEN=6)),           
          OVERLAY=(87:%02,SFF,TO=ZD,LENGTH=6))       
  OUTFIL FNAMES=SORTOUT,BUILD=(1,92),REMOVECC,         
   TRAILER1=(C'99',',',COUNT=(EDIT=(TTTT)),',',         
     TOT=(81,6,ZD,EDIT=(SIITT.T),SIGNS=(+,-)),',',   
     TOT=(87,6,ZD,EDIT=(SIITT.T),SIGNS=(+,-)))       



Sai
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
Search our Forums:

Back to Top