Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
String Comparision

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
GauravKudesiya
Warnings : 1

New User


Joined: 11 Oct 2008
Posts: 74
Location: Chicago, IL

PostPosted: Thu Mar 26, 2009 12:15 am    Post subject: String Comparision
Reply with quote

I have to make a check in cobol program.
I have two vatiables,
Var-1 PIC X(7)
Var-2 PIC X(50)

In Var-2, Var-1 is present from 8th Character.
I have to check if Var-1 is present in Var-2, then i have to take Var-2 in file, other wise drop that.

EX:
Var-1 = 'CHANGE XXXXXXX YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY'
Var-2 = 'XXXXXXX'

If Var-2 is samilar to Var-1(8,7), then i have to process furthur
i had put that in IF condition.

IF (COND)

What is the COND to compare like this.

Thanks in Advance.
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 Mar 26, 2009 12:21 am    Post subject:
Reply with quote

Hello,

You can do what you want using Reference Modification. Something like:
Code:
IF VAR-2(8:7) = VAR-1


At the top of the page is a link to IBM Manuals. Among them are COBOL Language Reference manuals for current compilers. Search for refeence modification in any of them for more details.

The posted examples are not consistent, so i used the field definitons where var-1 is 7 and var-2 is 50. . .
Back to top
View user's profile Send private message
GauravKudesiya
Warnings : 1

New User


Joined: 11 Oct 2008
Posts: 74
Location: Chicago, IL

PostPosted: Thu Mar 26, 2009 12:23 am    Post subject:
Reply with quote

Thanks Dick Scherrer..
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 Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am
No new posts Find a string in PS file opened in br... mukkas CLIST & REXX 3 Sat Feb 24, 2018 2:15 pm
No new posts Comparision with current time arunsoods DFSORT/ICETOOL 5 Thu Nov 09, 2017 10:37 am
No new posts line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us