View previous topic :: View next topic
|
Author |
Message |
GauravKudesiya Warnings : 1 New User
Joined: 11 Oct 2008 Posts: 74 Location: Chicago, IL
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
GauravKudesiya Warnings : 1 New User
Joined: 11 Oct 2008 Posts: 74 Location: Chicago, IL
|
|
|
|
Thanks Dick Scherrer.. |
|
Back to top |
|
|
|