Page 1 of 1

checking for spaces..

PostPosted: Tue Nov 06, 2012 2:04 pm
by VIJAY1
How to check if my variable value contains spaces in cobol.?

Re: checking for spaces..

PostPosted: Tue Nov 06, 2012 2:27 pm
by Pandora-Box
Do a INSPECT over your variable checking for ' ' if count is greater or equal to 1

Your variable then contains spaces

Re: checking for spaces..

PostPosted: Tue Nov 06, 2012 5:13 pm
by Robert Sample
Pandora-Box's answer is only partly correct as not enough information was provided to correctly and completely answer the question.

Question 1: what is the PICTURE of the variable you are wanting to check for spaces?
Question 2: are you wanting to know if the entire variable is spaces or if there are spaces embedded in the variable?
Question 3: what have you tried already and what were the results?

Re: checking for spaces..

PostPosted: Tue Nov 06, 2012 7:27 pm
by VIJAY1
Thanks for the replies.pic clause is alphanumeric.and prem kishan I tried inspect and got it right.Thank you.