Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

in cobol aphanumeric compare for var1 and var2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: in cobol aphanumeric compare for var1 and var2
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

Site Director


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

PostPosted: Thu May 03, 2007 10:47 pm    Post subject:
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    Post subject: Re: in cobol aphanumeric compare for var1 and var2
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: 3158
Location: Tucson AZ

PostPosted: Fri May 04, 2007 8:04 pm    Post subject:
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

Site Director


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

PostPosted: Fri May 04, 2007 8:14 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue May 08, 2007 3:16 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us