My requirement is to:
1. Copy the dataset to another dataset by omitting a particular record type(20) which is the first 2 digits of the records.
2. Count the sorted records
3. In the trailer record (type 30) insert the record count in the place of 'XX'
Have completed 1st requirement using SORT and OMIT. But i am not aware of, how to proceed with 2nd and 3rd.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
deepak.tcs,
If you are ok with creating a dynamic trailer record with count then use the followin JCL. The count will be a 8 byte field. If you want you can change the length
Hi Skolusu,
Thanks Alot for your reply! It is working great. But in the first JCL, i need the record count of the output file. (i.e after omitting certain record type). Now it is showing the original file record type.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
deepak.tcs wrote:
Hi Skolusu,
Thanks Alot for your reply! It is working great. But in the first JCL, i need the record count of the output file. (i.e after omitting certain record type). Now it is showing the original file record type.
Regards,
Deepak
*Sigh* Look carefully at the control cards I posted. Especially the omit card. I am omitting the existing trailer record and creating a new trailer record.
The second JCL works great for me. I think i need to mention a thing here. i need only the count of the record type 25 in the output file. Record type 10 and 30 are header and trailer, so i don't require those count to be included in the count.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
deepak.tcs wrote:
The second JCL works great for me.
Deepak,
BOTH THE JCL's GIVE THE EXACT SAME RESULTS . Did you run the above shown JCL's as is? Do NOT make any changes and run the jobs by just copying and pasting as is. Look at the output now and tell me if you notice any difference in the 2 outputs.
Quote:
I think i need to mention a thing here.i need only the count of the record type 25 in the output file. Record type 10 and 30 are header and trailer, so i don't require those count to be included in the count.
Are there any other hidden requirements like this? what happens if you have record type 35 which is not omitted? Do you count and copy them to output or do you drop them? Explain all your requirements clearly.
The only thing i changed in the JCL is the length of the count to '2'.In the output, the record count is shown as '04' but i need the count to be '02'. Since the record types 10 and 30 are header and trailer, i don't need the count to include these records.
Joined: 01 Sep 2006 Posts: 39 Location: Chennai, India
Assuming that You will have only one '30' record, you have to count all the 25 records and the count will not increase more than 2 digits, please see the code below:
Hi Vinod,
Thanks for your response! I have got the solution actually. it matches with what you have suggested. however, your solution holds the restriction of count cannot be more than 2 digits. So Rather than subtracting 1 from the count, we can define the start parameter for the seq number to start. 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 do this more easily like this: