Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us