Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You need to clarify what you want to do.
Are there always only two records in the input file, and you want to write the second record if the first record meets the condition, but not write the second record if the first record does not meet the condition?
For example, if the two records are:
The Error is
PPPP40
you want the output to be:
PPPP40
but if the two records are:
No error
PPPP40
you don't want any output?
Or are there more than two records in the input file? And if so, what is it you want to do exactly?
Please show a better example of your input and expected output for the various possible cases and explain what it is you want to do exactly.
Actually A program will abend throwing the error statements. There can be many. But the way it will write is it will not write the error statement in a single way. I till split as I said. First it will say the " The error is" and then the immediate the record will have the error code. So I need to search for the string1 in the SYSOUT so in the search where ever I found the "The Error is" I need to read the immediate the next recor which tells the error code and write the same after reading it to an output fiel. So I posted this.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Kolusu will not be available for a few days.
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:
Thank you Frank for the update. But in the card can you quickly explain in a simple words what second OVERLAY says which include that ADD fucntion. Please I need only that.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
The first OVERLAY creates a sequence number for every record.
The second OVERLAY adds 1 to the sequence number for each record with 'THE ERROR'.
This forces the sequence number for each 'THE ERROR' record to be the same as the sequence number for the record after the 'THE ERROR' record. For example, if the sequence numbers for the first 'THE ERROR' record and the record after it are 5 and 6 after the first OVERLAY, they will be 6 and 6 after the second OVERLAY.
Thus, the SELECT ALLDUPS on the sequence number will select those pairs of records (the 'THE ERROR' record and the record after it) since they have duplicate sequence numbers (e.g. 6 and 6).
The OUTFIL removes the 'THE ERROR' records, so only the record after each 'THE ERROR' record is output.
I can't test this right now, but I would give a try to use LASTDUP rather than ALLDUPS, so you will have no need to code a OMIT card.
I would add a SORT FIELDS=COPY because your records are already sorted.
ICE650I 0 VISIT http://www.ibm.com/storage/dfsort FOR ICETOOL PAPERS, EXAMPLES
ICE632I 0 SOURCE FOR ICETOOL STATEMENTS: TOOLIN
ICE630I 0 MODE IN EFFECT: STOP
SELECT FROM(IN) TO(OUT) ON(134,8,CH) LASTDUP USING(CTL1)
ICE606I 0 DFSORT CALL 0001 FOR SORT FROM IN TO OUT USING CTL1CNTL CO
ICE628I 0 RECORD COUNT: 000000000000002
ICE638I 0 NUMBER OF RECORDS RESULTING FROM CRITERIA: 000000000000000
ICE602I 0 OPERATION RETURN CODE: 00
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Gerry,
It's not working for you because you don't have z/OS DFSORT V1R5 PTF UK90007 installed. That PTF has been available since April, 2006 and it's needed to use INREC with SPLICE. When I run your job here with that PTF, the output is:
PPPP40
When I run your job without the PTF, I get no output.
Ask your System Programmer to install that PTF (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:
But in the code why did we include SORT FIELDS=COPY and then removal of SEQNUM how this is going to impact?
If we remove SEQNUM then our whole IFTHEN need to be removed na??
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
But in the code why did we include SORT FIELDS=COPY and then removal of SEQNUM how this is going to impact?
If we remove SEQNUM then our whole IFTHEN need to be removed na??
We included SORT FIELDS=COPY because the ON(134,8,ZD) field is already in sorted order. No need to sort on a field that's already in sorted order. COPY is more efficient.
We don't remove the SEQNUM until after the INREC and SPLICE are processed (INREC is processed before SPLICE; OUTFIL is processed after SPLICE). We're done with the SEQNUM at that point.
No need to sort on a field that's already in sorted order. COPY is more efficient.
Can you please clarify me where are we sorting earlier?
You said no need to sort,COPY is more efficient.
Quote:
We don't remove the SEQNUM until after the INREC and SPLICE are processed (INREC is processed before SPLICE; OUTFIL is processed after SPLICE). We're done with the SEQNUM at that point.
Frank,
Sorry to say that I didnt get the above explanation. Are we using any splice in our code?
Previous time when Alian suggested to remove SEQNUM you said
Quote:
Yes. Fixed it.
Means what change you have done to the exisitng code. Did you really remove it out of that. Then can I assume code format is as follows now.
I did NOT remove the SEQNUM from the first OVERLAY. I removed some other unneeded SEQNUM I had in the original job, but I don't really remember where it was at this point.
Quote:
Are we using any splice in our code?
We are using SELECT, not SPLICE.
Quote:
Can you please clarify me where are we sorting earlier?
You said no need to sort,COPY is more efficient.
We are NOT sorting - that's the point. SELECT would normally sort on the ON field of 134,8,CH. But since the values we created for 134,8,CH with the INREC statement are sequence numbers that are already in sorted order, we don't need to sort them.