1. We have a input file which looks likw some thing below:
67H_____________ ---> header record
67L_____________ ----> leader redord
67D___________________________________ ----> data record
67D___________________________________ ----> data record
67D___________________________________ ----> data record
.
.
.
67S____XXXXXXX___ --> summary record
67T____YYYYYYYY___ ---> Trailer record
2. Now, we need to take the count of 67D records (data records) and put the count in the summary record in the place of XXXXXXX - 7 bytes in Hexadecimal format.
3. Similarly, we need to take the count of all the record in the file ( basically total data record + 4) and put the count in the Trailer record in the place of YYYYYYY - 7 bytes in Hexadecimal format.
Would you please suggest a solution for this?
I actually found some of the threads similar to this..but I couldn't arrive at a complete solution for this.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Can you delete the old summary and trailer records and build new summary records and trailer records instead of updating the old summary and trailer records? That would be easier.
Do you always have 2 header records?
By 7 bytes hexadecimal do you mean for example X'00000000000123' for a count of 291, or do you mean something else. Please be specific.
What is the RECFM and LRECL of the input file? What is the starting position of the count fields in the summary and trailer records?
Yeah.. I tried building it instead of updating. I used BUILD option in ICETOOL. But I don't know the correct way to put the COUNT in BUILD funciton. (Pls Advice, whether BUILD is the right one to use here?)
Yes, we always have a Header and a Leader record. (They have two different informations and are consumed by different systems)
Sorry for missing clarity....
Dataset LRECL = 300, FB.
Trailer record lenght:27
Summary record length: 21
In summary and trailer records, the COUNT starts at 10th column and is of length 7. For example,
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
Yeah.. I tried building it instead of updating. I used BUILD option in ICETOOL. But I don't know the correct way to put the COUNT in BUILD funciton. (Pls Advice, whether BUILD is the right one to use here?)
No, you would use TRAILER1 to build new trailer records, not BUILD. TRAILER1 has a COUNT parameter. However, if you need to keep the information from the original trailer records, then TRAILER1 won't do that.
Hopefully the job Kolusu supplied does what you want.
Thanks a lot!! It solved the issue. Actually I was mulling over EZT program to do the job.
If you are interested (otherwise please ignore reading below!), below is the entire SORT step reqirement in which I have used the above solution.
Please advice, whether the way I have used the ICETOOL is optimal and efficient.
1. Below is the format of the file which is given as input to the SORT step.
67H_____________ ---> header record
67L_____________ ----> leader redord
67D___________________________________ ----> data record
67D___________________________________ ----> data record
67D___________________________________ ----> data record
.
.
.
67S____XXXXXXX___ --> summary record
67L
67D
67D
.
.
67S
..
..
..
67T____YYYYYYYYYY___ ---> Trailer record
As you see, there can be any number of Leader-data-Summary sets with in Header & Trailer records.
2. Details of the input file:
LRECL = 300, FB
Header record length 20
Leader record length 20
Summary record length 27
COUNT : starts at position 10 and of length 7. This count will have the total number of data - 67D records within that Leader - summary record.
Trailer record length 21
COUNT: starts at postion 10 and of length 9 ( this by mistake i have given as 7 last time). This count will have the total number of records in the file (including header, leader, summary, trailer & data)
Both the counts will be of signed decimal i.e. s9(7) and s9(9). ( this I missed to mention last time)
3. Objective of SORT step is to accumulate all the data records (67D) into single set of Leader - Summary records. Other Leader & summary records should be removed. After accumulating data records & removing the leader-summary records, the count in the Summary and trailer records need to be updated accordingly. Also the data fields are need to be sorted based on two fields.
4. My control cards are as below.
i) To accumulate the 67D records and sort them, i have used below control card.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
SSK1711,
Jeez ! That is one heck of a complicated way to get the desired results. All you want is to eliminate the 67L leader records and sort the 67D data records and update the count at the end. You used 4 passes of the data when you just need 1 pass of data.
Try to tell us what the final requirement is instead of giving bits and pieces of your requirement
Here is a one pass DFSORT/ICETOOL JCL which will give you the desired results
Jeez ! That is one heck of a complicated way to get the desired results. All you want is to eliminate the 67L leader records and sort the 67D data records and update the count at the end. You used 4 passes of the data when you just need 1 pass of data.
Try to tell us what the final requirement is instead of giving bits and pieces of your requirement
Here is a one pass DFSORT/ICETOOL JCL which will give you the desired results