View previous topic :: View next topic |
Author |
Message |
saravanan80 Beginner
Joined: 25 Dec 2006 Posts: 14 Topics: 6
|
Posted: Thu Feb 08, 2007 10:42 am Post subject: Inspecting a Variable. |
|
|
I'm having a viriable WS-A X(21) ,
we are having a string of data in it with a String DUMMY in it
"12345DUMMY6789" , how we can use the inspect command to check the presence of the value DUMMY alone in the stream of the entire data,
Please reply... |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Thu Feb 08, 2007 11:13 am Post subject: |
|
|
saravanan80,
try this
Code: |
01 WS-A PIC X(21) VALUE '12345DUMMY6789'.
01 WS-TALLY PIC S9(04) COMP VALUE 0.
INSPECT WS-A TALLYING WS-TALLY FOR all 'DUMMY'
IF WS-TALLY > 0
DISPLAY 'THE STRING HAS DUMMY'
END-IF
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
programmer1 Beginner
Joined: 18 Feb 2004 Posts: 138 Topics: 14
|
Posted: Thu Feb 08, 2007 11:17 am Post subject: |
|
|
INSPECT WS-A TALLYING WS-COUNT FOR ALL 'DUMMY'.
IF WS-COUNT > 0 DISPLAY 'STRING FOUND' END-IF. _________________ Regards,
Programmer |
|
Back to top |
|
|
|
|