Hi All,
I have a VB file with header, trailer and detail record. Header record will start with 'A' in the first 8 bytes and Trailer record will have as shown below.
I want to update the trailer in the last 6 bytes with the actual number of records in teh file. How it can be done with ICETOOL and not with ICEMAN (as it wont work in my system).
Please dont say that it is already there in this forum, I already did numerous search with different combinations of words but none of the entry satisfies my query. So Please help me on this as I have struck up with this final requirement. Please advice!!!
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
How it can be done with ICETOOL and not with ICEMAN (as it wont work in my system).
This statement makes no sense. If you can use PGM=ICETOOL, then you can use PGM=ICEMAN.
When you say "the actual number of records in the file" do you mean the number of data records (4 in your example) or the number of data + header + trailer records (6 in your example)?
Can a new trailer record be rebuilt as:
999999999cccccc
where cccccc is the count? Or do you need other fields from the original trailer record that you didn't show in your example?
You said the input file has RECFM=VB. What is the input file's LRECL?
the count of records means, only the count of detail records, count of header and trailer should not be included. Length of the trailer and header will be as shown in the example above and only the length of detail record varies (from the above example with the actual file entries) and the LRECL is 436.
For your question
Quote:
Can a new trailer record be rebuilt as:
999999999cccccc
where cccccc is the count? Or do you need other fields from the original trailer record that you didn't show in your example?
Though the trailer will always contain '9' in the first 8 bytes followed by 6 bytes of count of no records, I will prefer to retain the original trailer in which the last six bytes will be the count of no of records.
Please advice!! This is the last thing I have to do with my requirement, once it is done, my task is over, Please help me on this.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
Though the trailer will always contain '9' in the first 8 bytes followed by 6 bytes of count of no records, I will prefer to retain the original trailer in which the last six bytes will be the count of no of records.
I don't see the difference between these two. They will both result in a 19-byte trailer with an RDW, eight 9's and a 6-character count.
You can rebuild the trailer record with a DFSORT job like this:
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct,2010), you can now use DFSORT's new IFTRAIL function to update the count in the existing trailer record quite easily like this: