MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

UPPER CASE and lower case - any alternate solution

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Mon Nov 04, 2013 12:22 pm    Post subject: UPPER CASE and lower case - any alternate solution Reply with quote

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
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Mon Nov 04, 2013 12:23 pm    Post subject: Reply with quote

I mean the cobol program should treat 'ADD' and 'add' strings are same.
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Mon Nov 04, 2013 12:42 pm    Post subject: Reply with quote

You could convert everything to Upper case before trying to compare . . .
_________________
All the best,

di
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Mon Nov 04, 2013 12:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Mon Nov 04, 2013 12:59 pm    Post subject: Re: UPPER CASE and lower case - any alternate solution Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Mon Nov 04, 2013 1:54 pm    Post subject: Reply with quote

Thanks Koulsu.
I will go for the option 2.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group