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 Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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