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 Data replication from multiple Db2 ta... kishpra DB2 0 Mon Mar 27, 2017 9:58 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm


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