Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Adding trailer with multiple amounts

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Adding trailer with multiple amounts
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    Post subject:
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    Post subject:
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    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 Sum the fields in particular format f... sharana64 DFSORT/ICETOOL 9 Fri Jan 05, 2018 1:11 am
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm
No new posts Updating multiple counts in trailer!! Vignesh Sid SYNCSORT 4 Mon Nov 06, 2017 1:04 pm
No new posts Selecting a row from multiple tables! Vignesh Sid DB2 2 Thu Oct 26, 2017 6:09 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us