Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
comparing strings

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
kiran

New User


Joined: 08 Apr 2004
Posts: 26
Location: hyd

PostPosted: Thu Apr 08, 2004 2:48 pm    Post subject: comparing strings
Reply with quote

How can i compare two strings in cobol
Back to top
View user's profile Send private message
References
PostPosted: Thu Apr 08, 2004 2:48 pm    Post subject: Re: comparing strings Reply with quote

mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 257
Location: USA

PostPosted: Thu Apr 08, 2004 3:51 pm    Post subject:
Reply with quote

Hello kiran,

Code:

ws-string1    pic x(05) value 'india'
ws-string2    pic x(08) value 'india   '


Strings comparison is as below

Code:

    if ws-string1 = ws-string2
        display 'both the strings are same'
    else
        display 'strings are not same'
    end if
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1