I have a file which has many headers and trailers. Certain header doesn't have a corresponding trailer. My requirement is to write the group of records which doesn't have a trailer into one file, some error file and the others to the output file.
The length of input, output and error file is 900. Recfm is FB.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Sangee,
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:
I have gone through the trick discussed in the above link.
But i am not still not clear with CTL1. Sequential number is added starting from position 903, also we are checking the condition for the position 901,902 whether the values are equal to 'VB' or 'VV'. But from where we are getting the value VB?
Also could you please explain the significance of the below step
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
where we are getting the value VB
From the "splice" of position 901 of the base (first) record and position 902 of the overlay (second) record. To understand this, you need to understand how SPLICE works. Complete details on SPLICE are at:
As for the IFTHEN WHEN clause, let's break it down. Before the IFTHEN WHEN, the records look like this:
Code:
grpnum
MH01ABI..... 00000001 <--- header = start of group
MM01......... 00000002
MM01......... 00000003
MT01ABI..... 00000004
MH01YQW..... 00000002 <--- header = start of group
MM01....... 00000006
MM01...... 00000007
...
WHEN=NONE skips the records that satisifed previous IFTHEN conditions - that would be the header record in this case because of the IFTHEN with WHEN=(1,4,CH,EQ,C'MH01').