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

Trailer Having the Record Count and summation vallue


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

New User


Joined: 21 Nov 2006
Posts: 50
Location: India

PostPosted: Mon Mar 10, 2008 9:32 pm
Reply with quote

Hi,

The File has Header and Trailer with trailer having the number of Records and summation of a Value.

I/p File:
HHHHHH
r1 001
r2 005
r3 008
TT

O/p should be
HHHHHH
r1 001
r2 005
r3 008
TT 003 0014

003--Count of records
0014-Summation of Values

Please help me on this.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Mar 10, 2008 9:45 pm
Reply with quote

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
HHHHHH
r1 001
r2 005
r3 008
TT
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  OMIT COND=(1,2,SS,EQ,C'HH,TT')
  OUTFIL REMOVECC,
    HEADER1=('HHHHHH'),
    TRAILER1=('TT',X,
        COUNT=(EDIT=(TTT)),X,
        TOT=(4,3,ZD,EDIT=(TTTT)))
/*
Back to top
View user's profile Send private message
ksathishkumar83

New User


Joined: 21 Nov 2006
Posts: 50
Location: India

PostPosted: Tue Mar 11, 2008 10:35 pm
Reply with quote

Hi,

i need the header record to be copied as in the File.The Header will be Varying for each run.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Mar 12, 2008 12:31 am
Reply with quote

What is the RECFM and LRECL of your input file?
Back to top
View user's profile Send private message
ksathishkumar83

New User


Joined: 21 Nov 2006
Posts: 50
Location: India

PostPosted: Wed Mar 12, 2008 9:48 am
Reply with quote

The length is 103 with FB RECFM
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Mar 12, 2008 10:41 pm
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/103)
//SORTOUT DD DSN=...  output file (FB/103)
//SYSIN    DD    *
  OPTION COPY
  OMIT COND=(1,2,CH,EQ,C'TT')
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(104:4,3,107:SEQNUM,8,ZD)),
    IFTHEN=(WHEN=(107,8,ZD,EQ,+1),OVERLAY=(104:C'000'))
  OUTFIL REMOVECC,
    BUILD=(1,103),
    TRAILER1=('TT',X,
        COUNT-1=(EDIT=(TTT)),X,
        TOT=(104,3,ZD,EDIT=(TTTT)))
/*
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts To get the count of rows for every 1 ... DB2 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top