I have two VB input files contains details and trailer (both are in different format) as follows, (the files are tab delimited )
file1
Code:
,,Command ===>,
----+----1----+----2----+----3----+----4----+----5----+---
********************************* Top of Data ************
153.6879450212001019212.08112008.29100.1DNBWIRE
153.6879450212001019212.09042008.15923.1DNBWIRE
153.6879450204008307195.08262008.15000.1DNBWIRE
153.6879450212002099932.09122008.146171.1DNBWIRE
153.6879450212001291167.08282008.25000.1DNBWIRE
153.6879450204010156044.08282008.70000.1DNBWIRE
153.6879450204001959489.09082008.367999.1DNBWIRE
TRAILER.7.669193...7.669193
******************************** Bottom of Data **********
file2
Code:
,Command ===>,
----+----1----+----2----+----3----+----4----+----5----+---
********************************* Top of Data ************
155.6879450212001019212.08112008.29101.1DNBWIRE
155.6879450212001019212.09042008.15924.1DNBWIRE
155.6879450204008307195.08262008.15001.1DNBWIRE
155.6879450212002099932.09122008.146181.1DNBWIRE
155.6879450212001291167.08282008.25001.1DNBWIRE
155.6879450204010156044.08282008.70001.1DNBWIRE
155.6879450204001959489.09082008.368000.1DNBWIRE
TRAILER.7.669200...7.669200
******************************** Bottom of Data **********
I need to concatenate the details (not starts with word "trailer" in first column) with sorted from 4th column to 19 length and count the trailer values and write the final trailer record as follows at the end of the concatenated details. For example, the trailer should as follows,
TRAILER.14.1338393...14.1338393
There is no common values between files and both are tab delimited files.
I am trying to do this with sort.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You need to do a better job of describing the layout of the trailer records. You show 'TRAILER' followed by a dot, a field, a dot, a field, 3 dots, a field, a dot and a field. What does the trailer record actually look like in hex. How do we find the fields you want to add? What should the output trailer look like in hex? Do you have/want a tab between each field? Does each dot represent a tab character? If so, why are there three dots after the third field in the trailer? Does that represent three tab characters?
What is the LRECL of the input file?
Show the expected output records for your example input records.
Each dot represents TAB - hex value is X'05'. Three dots represent three continuous tabs. File is variable length file and maximum length is 60 bytes. Here's my expected output,
Code:
----+----1----+----2----+----3----+----4----+----5----+---
********************************* Top of Data ************
153.6879450212001019212.08112008.29100.1DNBWIRE
153.6879450204001959489.09082008.367999.1DNBWIRE
153.6879450204008307195.08262008.15000.1DNBWIRE
153.6879450204010156044.08282008.70000.1DNBWIRE
153.6879450212001019212.09042008.15923.1DNBWIRE
153.6879450212001291167.08282008.25000.1DNBWIRE
153.6879450212002099932.09122008.146171.1DNBWIRE
155.6879450204001959489.09082008.368000.1DNBWIRE
155.6879450204008307195.08262008.15001.1DNBWIRE
155.6879450204010156044.08282008.70001.1DNBWIRE
155.6879450212001019212.08112008.29101.1DNBWIRE
155.6879450212001019212.09042008.15924.1DNBWIRE
155.6879450212001291167.08282008.25001.1DNBWIRE
155.6879450212002099932.09122008.146181.1DNBWIRE
TRAILER.14.1338393...14.1338393
I would have mentioned my sort version in my post initially. I have only SYNCSORT FOR Z/OS 1.2.3 which doesn't support parse function. As a final try, I need to request to install latest verision may be SyNCSORT 1.3.
so that there is no need of parsing we will have to do sum fields from fixed lenghts.
this is assumed when there is no data in ... (three dots).
If there is possibility of data in specified position then you can shift fields you want to sum at left and fields shown(If agreed by users) .... towards extreme end.
as below..