In other words, I have a file with a record type in column 1 (i.e. 'A' or 'B' or whatever) and in the following record a numeric value (i.e. 100).
I want to eventually sum fields by record type the numeric value that follows it.
The output should be like this:
A250
B550
Also, is there a way of reading a file and holding a record in memory while you search the file for another record?
Example:
Input FIle:
1111111111
123456789A<--- record with 'A' in column 10
1111111111
123456789B
1111111111
123456789C
99XXX10000<---- record with '99' in column 1 and take 10000 value
.
.
.
Let's say I need to look for an 'A' in column 10 and then keep searching for the next '99' in column 1 and take the value in column 6 (5 bytes), therefore my output file would be:
A10000
.
.
.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Here's a DFSORT/ICETOOL job that will do the first thing you asked for. You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) to use INREC with SPLICE. If you don't have that PTF, ask your System Programmer to install it. Alternatively, you could use an extra COPY operator before the SPLICE operator to do the INREC. Without the April, 2006 PTF, you won't get any output.
First as always, your assistance is much appreciated and Thank You !!!!
As for the 2nd example:
The input file contains in sequence the following:
1111111111
123456789A<--- record with 'A' in column 10
1111111111
123456789B
1111111111
123456789C
99XXX10000<---- record with '99' in column 1 and take 10000 value
1111111111
123456789B<--- record with 'B' in column 10
1111111111
123456789B
1111111111
123456789C
99XXX10000<---- record with '99' in column 1 and take 10000 value
1111111111
123456789A<--- record with 'A' in column 10
1111111111
123456789B
1111111111
123456789C
99XXX10000<---- record with '99' in column 1 and take 10000 value
In other words, the file contains a record type in column 10 (1 character byte) and somewhere down the file, there is a '99' record type in column 1 in sequence and that's what I want to pair it up with. This process repeats itself in the file...
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
the file contains a record type in column 10 (1 character byte)
Please give the complete list of record types you want to look for.
You show:
Code:
1111111111
123456789A<--- record with 'A' in column 10
1111111111
123456789B
1111111111
123456789C
99XXX10000<---- record with '99' in column 1 and take 10000 value
I see records with 'A', 'B' and 'C' in column 10 before the '99' record. Are you looking for the first 'A' or 'B' (or other?) record and then the next '99' record, and then the next 'A' or 'B' (or other?) record and then the next '99' record, etc?
Sorry, but my sample data was made up and is not clear..
Look at it this way..
Code:
1111111111
103456789C<--- record type with '10' in column 01 (2bytes)
1111111111
1234567891
1111111111
1234567891
99XXX10000<---- record with '99' in column 1 and take 10000 value
1111111111
103456789B<--- record type with '10' in column 01 (2bytes)
1111111111
1234567891
1111111111
1234567891
99XXX10000<---- record with '99' in column 1 and take 10000 value
1111111111
103456789C<--- record type with '10' in column 01 (2bytes)
1111111111
1234567891
1111111111
1234567891
99XXX10000<---- record with '99' in column 1 and take 10000 value
etc...
In column 1 for 2 bytes is the Record Type.
There will be a record type = '10' and I need to extract the 1 byte character on that line (i.e. 'C'), then I need to look for the next Record Type = '99' and get the numeric value (i.e. 10000). Now I need to keep reading the file, as there will be another set of data with the record type of '10' followed further down by a record tpye of '99', etc...
therfore at the end the output shoould look like this:
C10000
B10000
C10000
I don't really need the record types in the output.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Here's a DFSORT/ICETOOL job that will do what you asked for. You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use INREC with SPLICE. If you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:
If you don't have the April, 2006 PTF, you won't get any output records. Alternatively, you could use a separate COPY operator with the INCLUDE and INREC statements before the SPLICE operator.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
"We will check to see if the PTF UK90006 or 7 is coming on our new zOS v1.7 SYSTEM this month."
I asked our service team leader about that, and he said that when a customer orders a tape with maintenance on it they can specify the level of maintenance they want. For instance, they could say they want z/OS 1.7 with all PTFs through August, 2006. z/OS DFSORT V1R5 PTF UK90007 has been available since April, 2006. So tell your System Programmer to ask for a level of maintenance that will get you that PTF.