MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

INSPECT - checking 2 values instead of 1 ?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
tcurrier
Intermediate


Joined: 10 Feb 2006
Posts: 188
Topics: 68

PostPosted: Thu Apr 08, 2010 1:48 pm    Post subject: INSPECT - checking 2 values instead of 1 ? Reply with quote

Ising 'inspect tallying', can I check for 2 values instead of 1 ?

I want to compute the length of data in a field, ignoring any trailing
spaces OR low-values....

This obviously doesn't work, but would there be another way to do it ?

Code:
INSPECT FUNCTION REVERSE(W-TEXT) TALLYING W-TALLY
        FOR LEADING SPACES OR LOW-VALUES.     


Thanks...
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Thu Apr 08, 2010 3:23 pm    Post subject: Reply with quote

One way would be to move this field to a work field, replace all of the low-values with zeros, then do the reverse inspect tallying leading spaces.

If it is ok to remove the low-values, the move to the work field would not be needed.
_________________
All the best,

di
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12369
Topics: 75
Location: San Jose

PostPosted: Thu Apr 08, 2010 4:17 pm    Post subject: Reply with quote

tcurrier,

Unless I am missing something , doesn't removing the OR work?

This would work for ALL trailing spaces or ALL trailing low values ,but I guess it wouldn't work for mixed bag of both trailing spaces with embedded low-values

Code:

INSPECT FUNCTION REVERSE(W-TEXT) TALLYING W-TALLY
        FOR LEADING SPACES LOW-VALUES.     


Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tcurrier
Intermediate


Joined: 10 Feb 2006
Posts: 188
Topics: 68

PostPosted: Thu Apr 08, 2010 5:24 pm    Post subject: Reply with quote

Thanks, Kolusu...

That does work if the trailing bytes are ALL spaces or ALL low-values....
I doubt that we would ever have a combination of both in the same field anyway....

TC
Back to top
View user's profile Send private message
tcurrier
Intermediate


Joined: 10 Feb 2006
Posts: 188
Topics: 68

PostPosted: Thu Apr 08, 2010 5:28 pm    Post subject: Reply with quote

Sorry, Papadi....

Didn't see your reply at first... That's also a good idea..

Thanks,

TC
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Apr 08, 2010 5:44 pm    Post subject: Reply with quote

why not negatively increment an index, preset to LENGTH of W-TEXT
and PERFORM until TEXT(index) > spaces (remembering that spaces are > LVs, x'40' > x'00)
the index will then have your length, and you save the time of an INSPECT.

wasting time converting x'00' to x'40' means two passes thru W-TEXT.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group