I have an input file (LRECL=FB, RECFM=FB) that contains 101 records. The first is a header that contains a record counter in position 15 for a length of 7.
Code:
----+----1----+----2----+----3----+----4----+----5
********************************* Top of Data ****
.20111004XXXXX0000008
3XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
3XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
3XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
3XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
I need to create a new file that contains (from the input file)
The header file with the record counter updated
The records that contains cā3ā in first position
The result I need:
Code:
----+----1----+----2----+----3----+----4----+----5
********************************* Top of Data ****
.20111004XXXXX0000004
3XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
3XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
3XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
3XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
tuxama,
Use the following DFSORT/JCL which will give you the desired results. The trick here is to use the same file as input to joinkeys. I assumed that your input has an lrecl=80 and recfm=fb
Thank you for your answers, now the problem is solved.
Escapa
In that case the sequence does not matter.
But it is a really good remark. According to you, what is the best way of preserving the original sequence ?