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 Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am


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