Joined: 14 Oct 2004 Posts: 130 Topics: 43 Location: virtual village
Posted: Thu Sep 07, 2006 8:22 pm Post subject: compare record count with the count given in trailer record
I have a requirement as below:
a file will have records and trailer record will have the number records. I need to check whether the record count given in the trailer record is equal to the exact count of records. This is to check whether we have received all the records.
Can ll this be done in a single sort step?
I can use DF-sort in my shop. _________________ Thanks
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Fri Sep 08, 2006 8:31 am Post subject:
Quote:
a file will have records and trailer record will have the number records. I need to check whether the record count given in the trailer record is equal to the exact count of records. This is to check whether we have received all the records.
Sarangadhar,
You need to provide more details. you have been a member on this site for almost 2 years and yet you don't follow the rules. Post detailed information on what you're trying to accomplish. Do not make people guess what you mean. This will give you a much better chance of getting a good answer to your question.
Provide answers for the following questions
1. What do you want to do if the record counts don't match?
2. How do you identify the trailer record?
3. what is the position and format of the count field?
4. Does the trialer count consider the header & trailer as part of the record count or is it considering only the detail records?
5. What is the LRECL and RECFM of the input dataset?
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Sep 21, 2006 8:39 pm Post subject:
Sarangdhar,
Try this job. This job will return a return-code of 4 since the trailer record has 7 where as the total no: of records excluding the header and trailer are 6. The job will return a zero return-code if the count on trailer record is 6.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Fri Sep 22, 2006 10:43 am Post subject:
Kolusu's job will NOT work with DFSORT.
Syncsort treats a SORTOUT DD connected to an OUTFIL statement as a SORTOUT data set, so NULLOUT applies to it. FNAMES=SORTOUT is treated differently than FNAMES=OUT1.
DFSORT treats a SORTOUT DD connected to an OUTFIL statement as an OUTFIL data set, so NULLOFL applies to it rather than NULLOUT. FNAMES=SORTOUT is treated the same as FNAMES=OUT1 which we feel is the more consistent approach.
For z/OS DFSORT V1R5, the equivalent to Kolusu's job would be:
I don't know whether or not that works with Syncsort.
NULLOUT and NULLOFL are available with z/OS DFSORT V1R5, but not with DFSORT R14. The following DFSORT/ICETOOL job will work with both releases. If you want RC=12 instead of RC=4, just remove the RC4 parameter.
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 14 Oct 2004 Posts: 130 Topics: 43 Location: virtual village
Posted: Fri Sep 22, 2006 3:53 pm Post subject:
Thanks Kolusu n Frank.
Frank:
Both of your sorts are working..
my observation from 2nd type:
i think this is not identifying the trailer record by word "TRAILER"; instead looking for the count at the last record (with the given column position). Of course since the trailer record is always last record, it works.
Which is the less time consuming mechanism? Since the first sort type needs to add sequence number for every record, this may take more time comparatively. Also 2nd one is not looking for filtering, just traversing till the end and comparing the record count with the count given at last record. Are my assumptions correct? _________________ Thanks
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Fri Sep 22, 2006 5:09 pm Post subject:
Quote:
think this is not identifying the trailer record by word "TRAILER"; instead looking for the count at the last record (with the given column position). Of course since the trailer record is always last record, it works.
Yes, you're right that my job expects the trailer record to be the last record rather than looking for 'TRAILER'. If you want a DFSORT job that looks for 'TRAILER', you can use this version:
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Fri Sep 22, 2006 5:12 pm Post subject:
Quote:
Which is the less time consuming mechanism?
Well, when anyone asks about "time", I always try it out to see. So I ran Kolusu's job and my two jobs with a million 80 byte records as input and the last record as the trailer record. Kolusu's job took 0.63 CPU sec, my first job took 0.17 CPU sec and my second job took 0.19 CPU sec. YMMV. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
I am going through the above solution given by you. I am not understanding the following parameters. Could you please explain what the following parameters means?.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Dec 14, 2006 11:57 am Post subject:
REMOVECC - tells DFSORT to remove the ANSI carriage control character from each output record and set the RECFM to FB or VB. Without REMOVECC, each record starts with a carriage control character (e.g. '1' for page eject) and the RECFM is set to FBA or VBA.
NODETAIL - tells DFSORT to suppress the detail records (so only the trailer1 record will appear in the output data set). Without NODETAIL, each detail record will appear in the output data set.
M11 - this is an edit mask that converts the input value to a numeric output value with leading zeros (digits '0'-'9'). For example '0000325'.
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
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