Page 1 of 1

Search String comparison & case sensitivity

PostPosted: Fri Sep 02, 2011 9:56 pm
by MitchellSTL
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)

Re: Search String comparison & case sensitivity

PostPosted: Fri Sep 02, 2011 10:46 pm
by Frank Yaeger
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)
/*