Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Nov 09, 2006 6:32 pm Post subject:
It's not clear what you want to do here. If you want to write the H01 record to the output file if it has 'RAW' and write the F01 record to the output file if it has 'R', then you can use this DFSORT INCLUDE statement:
Code:
INCLUDE COND=((5,3,CH,EQ,C'H01',AND,24,3,CH,EQ,C'RAW'),OR,
(5,3,CH,EQ,C'F01',AND,28,1,CH,EQ,C'R'))
Note that we have to add 4 to each starting position to account for the RDW since this is a VB file.
For the input you show, the output would be:
Code:
H01 RAW .
F01 R .
If that's not what you want to do, then please explain more clearly what you want. Showing the input and expected output for different cases would help. _________________ 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 have a VB file with following record type:
======================
H01 RAW .
F01 R .
B01
B01
B01
T01
======================
In want to check if Header H01 has 'RAW' on column 20 and
F01 record has 'R' on column 24
If true write the 2 records H01 and F01 to ouput file
Else write nothing
So for the above record layout the output should look like:
======================
H01 RAW .
F01 R .
======================
I tried running using SORT pgm and the INCLUDE control card you mentioned
but its failing with U016
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Fri Nov 10, 2006 12:20 pm Post subject:
Do you mean that you want to write the two records only if the conditions for both records are true?
That would be the case for the example you showed.
But would you want no records written for these two cases where only one record meets the condition?
Case1:
H01 XXX .
F01 R .
B01
B01
B01
T01
Case 2:
H01 RAW .
F01 X .
B01
B01
B01
T01
Quote:
I tried running using SORT pgm and the INCLUDE control card you mentioned but its failing with U016
Make sure you have a blank in position 1 for both lines of the INCLUDE statement. If that's not the problem, then you need to show the //SYSOUT output so we can see what error message you received. _________________ 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
_________________ 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
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