IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

in cobol aphanumeric compare for var1 and var2


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
p_gandhi

New User


Joined: 20 Apr 2007
Posts: 14
Location: TORONTO,ONTARIO,CANADA

PostPosted: Thu May 03, 2007 10:40 pm
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu May 03, 2007 10:47 pm
Reply with quote

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

New User


Joined: 20 Apr 2007
Posts: 14
Location: TORONTO,ONTARIO,CANADA

PostPosted: Fri May 04, 2007 6:45 pm
Reply with quote

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

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri May 04, 2007 8:04 pm
Reply with quote

ABCD is not the same as abcd, they are not equal.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri May 04, 2007 8:14 pm
Reply with quote

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

Active User


Joined: 16 Sep 2004
Posts: 106
Location: Hyderabad

PostPosted: Fri May 04, 2007 8:59 pm
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 08, 2007 3:16 am
Reply with quote

Hello p_gandhi,

Do you now have a solution for your question?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top