View previous topic :: View next topic |
Author |
Message |
vak255 Intermediate
Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Mon Nov 04, 2013 12:22 pm Post subject: UPPER CASE and lower case - any alternate solution |
|
|
I have to compare two alphanumeric strings.
Presently 'ADD' and 'add' are treated differently as it is case sensitive.
I am aware of the below but I want to know if its possible to make this comparision not case sensitive.....any compile option? or alternate solution?
Code: |
FUNCTION UPPER-CASE(input)
Option2: INSPECT string1 CONVERTING “abcdefghijklmnopqrstuvwxyz" TO "ABCDEFGHIJKLMNOPQRSTUVWXYZ”
|
|
|
Back to top |
|
|
vak255 Intermediate
Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Mon Nov 04, 2013 12:23 pm Post subject: |
|
|
I mean the cobol program should treat 'ADD' and 'add' strings are same. |
|
Back to top |
|
|
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Mon Nov 04, 2013 12:42 pm Post subject: |
|
|
You could convert everything to Upper case before trying to compare . . . _________________ All the best,
di |
|
Back to top |
|
|
vak255 Intermediate
Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Mon Nov 04, 2013 12:56 pm Post subject: |
|
|
Thanks for the response Papadi.
Yes, thats my plan. I like to check on if there is a better option since there will be millions of records and converting both the fields for every record will raise the CPU time I believe. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Mon Nov 04, 2013 12:59 pm Post subject: Re: UPPER CASE and lower case - any alternate solution |
|
|
vak255 wrote: | I have to compare two alphanumeric strings.
Presently 'ADD' and 'add' are treated differently as it is case sensitive.
I am aware of the below but I want to know if its possible to make this comparision not case sensitive.....any compile option? or alternate solution?
Code: |
FUNCTION UPPER-CASE(input)
Option2: INSPECT string1 CONVERTING “abcdefghijklmnopqrstuvwxyz" TO "ABCDEFGHIJKLMNOPQRSTUVWXYZ”
|
|
Vak255,
There are no compiler options to ignore the case. However given the 2 options you have, INSPECT solution is the optimal solution as it just involves 1 TR instruction where as UPPER-CASE function involves loading and calling the module IGZCUPL.
Kolusu |
|
Back to top |
|
|
vak255 Intermediate
Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Mon Nov 04, 2013 1:54 pm Post subject: |
|
|
Thanks Koulsu.
I will go for the option 2. |
|
Back to top |
|
|
|
|