View previous topic :: View next topic
|
Author |
Message |
p_gandhi
New User
Joined: 20 Apr 2007 Posts: 14 Location: TORONTO,ONTARIO,CANADA
|
|
|
|
Hi,
I need some help regarding alphanumeric comparison
If var1 = var2 (where var1 = ABCD, var2 = abcd)
when it's compare this value it's not supposed to be equal because one has caps and other is lower case.
What should I need to code in COBOL so It's compare like this
Thanks
Paresh Gandhi |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You question is not clear - as posted the 2 will compare not equal (provided at execute time one is upper and the other lower case - they have different hex values). Is that not what you want? |
|
Back to top |
|
|
p_gandhi
New User
Joined: 20 Apr 2007 Posts: 14 Location: TORONTO,ONTARIO,CANADA
|
|
|
|
Let me give you some more detail so you guys can help me
I am working on one flat file where there are duplicates records are.
Now I have to remove those duplicates with this conditions
if var1 = PIC S9(13)V USAGE COMP-3. 1var
var2 = PIC S9(4) USAGE COMP. 2var
var3 = PIC X(30). 3var
now from the same file I have to find duplicates and remove it with this 3 keys, my yesterday's question was when I compare the var3 to var3 and if value are 'ABCD' and 'abcd' it's not have to match it has to count as a different record and not to raise the flag for the duplicates.
Thanks |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
ABCD is not the same as abcd, they are not equal. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
From this
Quote: |
ABCD is not the same as abcd, they are not equal. |
they will not be duplicates.
If you post some "real" record pieces and how you want your code to work with them (i.e. the desired output from that input) we will be able to offer suggestions. You don't need to post entire records, only the fields that matter for your requirement. |
|
Back to top |
|
|
ashwinreddy
Active User
Joined: 16 Sep 2004 Posts: 106 Location: Hyderabad
|
|
|
|
Hi,
Check if you have used FUNCTION UPPER-CASE before comparision.
Only above case the two values may be equal. Else it is not possible. Remember Cobol is case sensitive, i think you know it.
Cheers
Ashwin |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello p_gandhi,
Do you now have a solution for your question? |
|
Back to top |
|
|
|