Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Removing a record in a file through sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Vasanthr

New User


Joined: 24 Jan 2011
Posts: 21
Location: India

PostPosted: Thu Jan 27, 2011 4:57 pm    Post subject: Removing a record in a file through sort
Reply with quote

Hi
I have a file with around 100 records .In some records first 10 characters and another 10 characters matches with each other . I want to remove the records if these match . Is there any sort jcl to remove these?

eg.SAmple scenario
Input file
ABCDEFG123456767ABCDEF12332434
HHHHHHH454GHJKL7HHHHHH2324345
JSDSDSD123232343ABDSDSK232344

Here in first 2 records the (1,6) characters match with characters in (16,6) . So these must be removed and only third record must be present in output.

Output file :
JSDSDSD123232343ABDSDSK232344
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Jan 27, 2011 5:03 pm    Post subject:
Reply with quote

Code:
 SORT      FIELDS=COPY
 EXCLUDE   COND=(pos,length,format,operator,pos,length,format)
Back to top
View user's profile Send private message
Vasanthr

New User


Joined: 24 Jan 2011
Posts: 21
Location: India

PostPosted: Thu Jan 27, 2011 5:11 pm    Post subject:
Reply with quote

thanks got it
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Jan 28, 2011 12:26 am    Post subject:
Reply with quote

That would be OMIT, not EXCLUDE. The DFSORT control statements would be:

Code:
 
   SORT FIELDS=COPY
   OMIT COND=(1,6,CH,EQ,16,6,CH)
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us