|
View previous topic :: View next topic
|
| Author |
Message |
vsrao_2k
New User
Joined: 12 Dec 2005 Posts: 13
|
|
|
|
Hi Frank,
I am having a flat file of length 80(LRECL). I am having Header,Trailer and detailed records in the file of same length. I want the date from header record + No.of records from the trailer record. How to do this using ICETOOL?
I have included INCLUDE COND(1,3,CH,EQ,C'PID',OR,
1,3,CH,EQ,C'TRL') which will filter Header and trailer records.
But I want header record date which is at 10,6 + Total no.of records from trailer record 10,6 in the same record in the output file.
Please suggest me.
Thanks
Sreenivas. |
|
| Back to top |
|
 |
CICS Guy
Senior Member

Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Please post a sample of your input and what you want the output to look like.
Please post lrecl and recfm of the input and output. |
|
| Back to top |
|
 |
vsrao_2k
New User
Joined: 12 Dec 2005 Posts: 13
|
|
|
|
Input file: LRECL=80 and RECFM=FB
| Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+-
PID=STCA 100122 START 3.0.0 -->header record
S0000990390011350006 428418102 ASUPVS4111111111111111
S0000990390011350006 428418102 ASUPVS4111111111111111
S0000990390017580002 968189005 ASUPVS5111111111111111
S0000990390001780000 132618703 ASUPVS8111111111111111
S0000990390011350006 528418102 ASUPVS4111111111111111
S0000990390017580002 111189005 ASUPVS5111111111111111
S0000990390001780000 132618703 ASUPVS7111111111111111
S0000990390011350006 428434321 AsUPVS4111111111111111
S0000990390017580002 968189005 ASUPVS5111111111111111 S0000990390001780000 192618703 AsUPVS6111111111111111--->detailed records
TRL=ENDS 000010 ------------->trailer record |
OUTPUT file: LRECL=80 and RECFM=FB
| Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+-
100122 000010 |
|
|
| Back to top |
|
 |
CICS Guy
Senior Member

Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
| Will there be multiple sets of HDR/DETAIL/TRL groups in a single input? |
|
| Back to top |
|
 |
vsrao_2k
New User
Joined: 12 Dec 2005 Posts: 13
|
|
|
|
| No. There is be always only header and one trailer record will be available in the file. But Detailed records will be N. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for:
| Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//SORTOUT DD DSN=... output file (FB/80)
//SYSIN DD *
OPTION COPY
INCLUDE COND=(1,3,SS,EQ,C'PID,TRL')
INREC IFOUTLEN=80,
IFTHEN=(WHEN=(1,3,CH,EQ,C'PID'),
BUILD=(10,6)),
IFTHEN=(WHEN=NONE,BUILD=(8:10,6))
OUTREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(1:1,6))
OUTFIL STARTREC=2,ENDREC=2
/*
|
|
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Even this sort card will do too
| Code: |
//SYSIN DD *
OPTION COPY
INCLUDE COND=(1,3,SS,EQ,C'PID,TRL')
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'PID'),PUSH=(81:10,6))
OUTFIL BUILD=(81,6,X,10,6),INCLUDE=(1,3,CH,EQ,C'TRL')
/*
|
|
|
| Back to top |
|
 |
vsrao_2k
New User
Joined: 12 Dec 2005 Posts: 13
|
|
|
|
| Thank you. Both solutions are working good. Thanks once again. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|