Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Level 88 with inspect

Status
Not open for further replies.

Daniel1878

Programmer
Jan 18, 2016
1
GB
Morning,

Can someone please shed some light on why the following is not working. It may be that you can't use level 88 with inspect.
I have the following part of code in my program but fails to work.


V2.58 03 WS-BAD-NAMES PIC X(10) VALUE SPACES.
v2.58 88 WS-CUST-BAD-NAMES VALUE 'occupie' 'occupant'
'a n other' 'household'
'homeowner' 'billpayer'
'landlord'.

INSPECT WS-LAST-NAME-LOWER TALLYING WS-OCCBILL
FOR ALL WS-CUST-BAD-NAMES

Thanks
 
The 88 level only applies to the variable under which it falls. It is not a universal name, even though it is unique.

==================================
adaptive uber info galaxies (bigger, better, faster, and more adept than cognitive innovative agile big data clouds)


 
[Welcome to Tek-Tips.]

Because that simply isn't how INSPECT works.

This particular INSPECT will increment WS-OCCBILL each time it finds 10 characters that match the current value of WS-BAD-NAMES. If WS-BAD-NAMES contains spaces, that is what will be used in the comparison.

You can probably achieve what you want by using multiple TALLYING phrases. Or, if it is clearer, use multiple INSPECT statements without re-initializing WS-OCCBILL (since INSPECT does not initialize the tally counter).

Tom Morrison
Hill Country Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top