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

comparing strings


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

New User


Joined: 08 Apr 2004
Posts: 25
Location: hyd

PostPosted: Thu Apr 08, 2004 2:48 pm
Reply with quote

How can i compare two strings in cobol
Back to top
View user's profile Send private message
mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 237
Location: USA

PostPosted: Thu Apr 08, 2004 3:51 pm
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
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
This topic is locked: you cannot edit posts or make replies. How to search multiple strings in a PDS IBM Tools 3
No new posts Print next line strings when a condit... DFSORT/ICETOOL 9
No new posts Include current & next records if... DFSORT/ICETOOL 22
No new posts Search the strings present in ps file... All Other Mainframe Topics 8
No new posts Comparing Signed Packed decimal and p... SYNCSORT 2
Search our Forums:

Back to Top