the first 6 characters give the record type where 000000 is the header (only one in each file) and 999999 is the trailer (only one in each file). The data in both these files exist in sets such as record types 100000, 200000 and 300000 form 1 set. Every set in the files will contain 1 record each for 100000 and 200000. There may be none or many records in each set corresponding to 300000.
What needs to be achieved here is a merge of these 2 files with the output containing one header and one trailer. The trailer (999999) should have the count of SETS and not records, 8 bytes starting position 7.
Each set could be identified by the record 100000, so basically the trailer should have a count of 100000 type records.
When you say "merge" do you mean that as MERGE in its meaning in SORT utilities? If so, what would you use as the key? If not, can you please clarify?
Which SORT product are you using? WHEN=GROUP and PUSH an ID would "count" the 100000 records. KEYBEGIN in DFSORT, RESTART a sequence number and BEGIN=sequenceno1 for Syncsort.
PUSH to the beginning of the record as you have variable-length records.
The ID (effectively a sequence number for the group) will magically appear on your trailer.
You need to BUILD to obliterate the ID from the data records and to include it on the trailer. A GROUP with a sequence number with BEGIN for the trailer should allow you to INCLUDE/OMIT the trailer you don't want. Similar for the header.
Well Nic, it's upto a person's perception. From my perceptive, if I have 2 files with 1 containing records of 80 bytes and the other containing records of 120 bytes, I would say on concatenation, I would get a file of 200 bytes.
One person's perception does not really matter. . . What does matter is that we all use the same terminology (otherwise everything quickly gets out of control). It is a good thing to train one's perception to use the standard/acceptable terminology and not somthing that one or a few have decided to use because they prefer it.
When you combine these 2 files, what should the output be (recfm, lrecl, anthing else we should know to help)? _________________ Have a good one
Joined: 24 Jul 2011 Posts: 651 Location: Down on the pig farm
Posted: Thu Jul 05, 2012 10:00 pm Post subject:
MERGE in sort terms is getting all the records from 2 or more datasets into a key sequence. Sticking the contents of one or more datasets to the end of another dataset so that the whole lot looks like one big dataset is concatenation. You actually are doing neither as your datasets are of different record lengths. You now have to say which dataset is to be forced to the record length of the other dataset - presumably by padding the first dataset with blanks to the full 120 bytes required. Of course, you may be willing to have the last 40 bytes chopped off the second dataset. _________________ Regards
Well, I have already apologized for my thinking/perception being wrong.
The point where I talked about different file lengths was just to explain what I thought was concatenation.
I have given all the file details in my original problem. RECFM=VB, LRECL=1000.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum