Page 1 of 1

Exclude records with a character in random position

PostPosted: Tue Dec 02, 2014 9:24 am
by ragsara
Hi,
Please find the below requirement :

I need to excluede the records which has '@' symbol in it, It can be present in any position of the record. Can this be handled in SORT ?

Input file length : 50 FB
Prmsinchak@abc.com         
PCRUPERT@abc.COM
PSARA1524@ABCDEF.NET     
PRDREISBECK@XYZ.COM
123       
PGTAYLERFROMFRANCE@ABCD.COM         
Pdccorcilius@abc.com
ABCDEF       
PJ_DIENST@ABCD.NET
ABC123
#$%^&*       
PMICHAELDONELAN@ABC.NET   
PVGEMMITI13@XYZ.COM     

Expected Output :
123                 
ABCDEF       
ABC123 
#$%^&*


Thanks in advance.

Re: Exclude records with a character in random position

PostPosted: Tue Dec 02, 2014 1:12 pm
by BillyBoyo
  OMIT COND=(1,50,SS,EQ,C'@')


The important part is the Sub-string data-type (SS) which allows all the bytes specified to be searched. This will find @ anywhere within the first 50 bytes of your record.

Re: Exclude records with a character in random position

PostPosted: Tue Dec 02, 2014 11:16 pm
by ragsara
Thanks Billy