|
View previous topic :: View next topic
|
| Author |
Message |
Chidane
New User
Joined: 25 Nov 2021 Posts: 32 Location: India
|
|
|
|
Hi Team,
I have a flat file of 13 byte with following data
123ABC 234ABC
234DEF 123DEF
123XYZ 123ABC
If the value of position 1-3 byte and also position 8 - 10 is 123 or 234, THEN check if the value of pos 4 - 6 is same as value of pos 11 - 13. If same, then ignore that record else dont ignore.
The value in position 1-3 and position 8 - 10 will be aalways 123 or 234. The values in position 4 - 6 and 11 - 13 will be changing.
In the above example, only first 2 records should be ignored.
Could you please help with the SORT card for the above requirement
Thanks |
|
| Back to top |
|
 |
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1216 Location: Dublin, Ireland
|
|
|
|
This is quite an easy task to OMIT certain records. What have you tried and with what results?
Garry. |
|
| Back to top |
|
 |
Chidane
New User
Joined: 25 Nov 2021 Posts: 32 Location: India
|
|
|
|
Hi Garry,
I was able to write only OMIT condition.
OMIT COND = (1,3,CH,EQ,C'123',OR,1,3,CH,EQ,C'234' OR
8,3,CH,EQ,C'123',OR,8,3,CH,EQ,C'234' )
I am confused about the second part of checkign if the value of post 4 - 6 is same as value in pos 11 - 13
Can you please help me here. |
|
| Back to top |
|
 |
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1216 Location: Dublin, Ireland
|
|
|
|
When showing your code, please use the code tags and paste the screenshot. You're amost there You need to add an AND to match the positions in 4-6 & 11-13 .
| Code: |
OMIT COND=((1,3,CH,EQ,C'123',OR,1,3,CH,EQ,C'234',OR,
8,3,CH,EQ,C'123',OR,8,3,CH,EQ,C'234'),AND,
4,3,CH,EQ,11,3,CH) |
Garry. |
|
| Back to top |
|
 |
Chidane
New User
Joined: 25 Nov 2021 Posts: 32 Location: India
|
|
|
|
| Thanks very much Garry. |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2272 Location: USA
|
|
|
|
| Code: |
OMIT COND=((1,3,CH,EQ,L(C'123',C'234'),
OR,8,3,CH,EQ,L(C'123',C'234')),
AND,4,3,CH,EQ,11,3,CH)
|
|
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1430 Location: Bamberg, Germany
|
|
|
|
| That SYNCSORT Lists do not work in DFSORT, use SS instead. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|