To Omit records based n SORT condition

Author Message
Chidane

New User

Joined: 25 Nov 2021
Posts: 19
Location: India

 Posted: Tue Jul 16, 2024 2:29 pm 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
Garry Carroll

Senior Member

Joined: 08 May 2006
Posts: 1198
Location: Dublin, Ireland

 Posted: Tue Jul 16, 2024 4:31 pm This is quite an easy task to OMIT certain records. What have you tried and with what results? Garry.
Chidane

New User

Joined: 25 Nov 2021
Posts: 19
Location: India

 Posted: Tue Jul 16, 2024 7:43 pm 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.
Garry Carroll

Senior Member

Joined: 08 May 2006
Posts: 1198
Location: Dublin, Ireland

Posted: Tue Jul 16, 2024 7:47 pm

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.
Chidane

New User

Joined: 25 Nov 2021
Posts: 19
Location: India

 Posted: Tue Jul 16, 2024 7:54 pm Thanks very much Garry.
sergeyken

Senior Member

Joined: 29 Apr 2008
Posts: 2102
Location: USA

Posted: Tue Jul 16, 2024 8:48 pm

 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)
Joerg.Findeisen

Senior Member

Joined: 15 Aug 2015
Posts: 1297
Location: Bamberg, Germany

 Posted: Tue Jul 16, 2024 8:52 pm That SYNCSORT Lists do not work in DFSORT, use SS instead.
 View Bookmarks All times are GMT + 6 Hours

 Topic Forum Replies Similar Topics SORT JCL to merge multiple tow into s... DFSORT/ICETOOL 6 Using Multiple IFTHEN and WHEN condit... SYNCSORT 12 Looking for help with SORT JCL/SYNC sort DFSORT/ICETOOL 6 sort to find out the char which repea... Mainframe Interview Questions 10 Dynamically build sort control statem... SYNCSORT 18
Search our Forums:

 IBMMainframes.com is not an official and/or affiliated with IBM® in anyway Board Rules | FAQ | Downloads | Wiki | SiteMap | Contact Us