|
View previous topic :: View next topic
|
| Author |
Message |
sakthi_ksv
New User
.jpg)
Joined: 20 Jul 2006 Posts: 48 Location: Chennai
|
|
|
|
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.
AAAAAAAA --> Header
FC232343
DE343523
ER343243
EE342423
999999999000000 - Trailer.
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!!! |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

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? |
|
| Back to top |
|
 |
sakthi_ksv
New User
.jpg)
Joined: 20 Jul 2006 Posts: 48 Location: Chennai
|
|
|
|
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.
Thanks and Regards,
Sakthi. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

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:
| Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (VB/436)
//SORTOUT DD DSN=... output file (VB/436)
//SYSIN DD *
OPTION COPY,VLSCMP
OMIT COND=(5,9,CH,EQ,C'999999999')
OUTFIL REMOVECC,
TRAILER1=(C'999999999',COUNT-1=(EDIT=(TTTTTT)))
/*
|
You can just change the count in the trailer record with a DFSORT job like this:
| Code: |
//X1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (VB/436)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
VTOF,BUILD=(80X),
TRAILER1=(C'NEWCT,''',COUNT-2=(EDIT=(TTTTTT)),C'''')
/*
//X2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=... input file (VB/436)
//SORTOUT DD DSN=... output file (VB/436)
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(5,9,CH,EQ,C'999999999'),
OVERLAY=(14:NEWCT))
/*
|
|
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

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:
| Code: |
//NEW EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (VB/436)
//SORTOUT DD DSN=... output file (VB/436)
//SYSIN DD *
OPTION COPY
OUTFIL IFTRAIL=(HD=YES,
TRLID=(5,9,CH,EQ,C'999999999'),
TRLUPD=(14:COUNT=(EDIT=(TTTTTT))))
/*
|
For complete details on the new functions for DFSORT and DFSORT's ICETOOL available with the Oct, 2010 PTF, see:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000242 |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|