View previous topic :: View next topic
|
Author |
Message |
mukunthg
New User
Joined: 27 Mar 2007 Posts: 10 Location: India
|
|
|
|
Hi,
Can someone help me on the following?
I need the accumulated value of certain fields. But in the sysout I need it along with the field name (a label which I can give in the sysin).
For eg:
I need the accumulated value of a field, say, premium amount. I want the sysout to be as:
Premium-amt: _____ (the value)
Thanks,
Mukunth |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Please show an example of the records in your input file (relevant fields only) and what you expect for output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of all relevant fields. |
|
Back to top |
|
|
mukunthg
New User
Joined: 27 Mar 2007 Posts: 10 Location: India
|
|
|
|
My file looks like this:
abcd 1000
bcda 2000
cdab 1500
dabc 2500
Say the field (6,4) is premium amount. I want the sysout as:
Prem-amt: 7000
(The value "Prem-amt:" to be given in the sysin itself.) Will Outrec Build achieve this? |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
mukunthg,
The following DFSORT JCL will give you the desired results
Code: |
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
----+----1----+----2----+----3----+----4----+----5--
ABCD 1000
BCDA 2000
CDAB 1500
DABC 2500
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=('PREM-AMT: ',TOT=(6,4,ZD,M10,LENGTH=8))
/* |
|
|
Back to top |
|
|
mukunthg
New User
Joined: 27 Mar 2007 Posts: 10 Location: India
|
|
|
|
Thanks a lot. It works. |
|
Back to top |
|
|
|