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
 

 

Trailer Having the Record Count and summation vallue

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Trailer Having the Record Count and summation vallue
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 Moderator


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

PostPosted: Mon Mar 10, 2008 9:45 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Wed Mar 12, 2008 12:31 am    Post subject:
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    Post subject:
Reply with quote

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

DFSORT Moderator


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

PostPosted: Wed Mar 12, 2008 10:41 pm    Post subject:
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    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 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
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm


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