Search String comparison & case sensitivity



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Search String comparison & case sensitivity

Postby MitchellSTL » Fri Sep 02, 2011 9:56 pm

I have an input file that has email addresses in them with mixed cases. I want to remove email addresses that are from a particular domain. The email addresses come in mostly lower case, but there are few that contained mixed case or all upper. Is there a way to make the comparison not case sensitive?

I checked the manual for a way to convert the compared text to upper (or lower). I didn't see a TRAN=LTOU on an OMIT COND statement. I was considering putting the LTOU conversion in another step where I would convert the whole file to uppercase, but I was looking for an all-in-one.

This OMIT worked for most, but I'd have to code for the different variations that a user could possible type (i.e. @SomeDomain.com, @SOMEdomain.com, etc).

OMIT COND=(1,100,SS,EQ,C'@somedomain.com')


I guess this is what I was trying to achieve. =)

OMIT COND=(1,100,SS,EQ,C'@SOMEDOMAIN.COM',TRAN=UTOL)
MitchellSTL
 
Posts: 27
Joined: Wed Feb 16, 2011 8:57 am
Has thanked: 1 time
Been thanked: 0 time

Re: Search String comparison & case sensitivity

Postby Frank Yaeger » Fri Sep 02, 2011 10:46 pm

You can use a DFSORT job like the following to do what you asked for. I assumed your input file has RECFM=FB and LRECL=100, but the job can be changed appropriately for other attributes:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (FB/100)
//SORTOUT DD DSN=...  output file (FB/100)
//SYSIN DD *
  INREC OVERLAY=(101:1,100,TRAN=UTOL)
  OPTION COPY
  OUTFIL OMIT=(101,100,SS,EQ,C'@somedomain.com'),
    BUILD=(1,100)
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post