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
 

 

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 Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm


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