checking for spaces..



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

checking for spaces..

Postby VIJAY1 » Tue Nov 06, 2012 2:04 pm

How to check if my variable value contains spaces in cobol.?
VIJAY1
 
Posts: 26
Joined: Sun Oct 21, 2012 2:49 pm
Has thanked: 3 times
Been thanked: 0 time

Re: checking for spaces..

Postby Pandora-Box » Tue Nov 06, 2012 2:27 pm

Do a INSPECT over your variable checking for ' ' if count is greater or equal to 1

Your variable then contains spaces
User avatar
Pandora-Box
 
Posts: 65
Joined: Fri Feb 10, 2012 8:30 pm
Location: Mars
Has thanked: 3 times
Been thanked: 6 times

Re: checking for spaces..

Postby Robert Sample » Tue Nov 06, 2012 5:13 pm

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?
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: checking for spaces..

Postby VIJAY1 » Tue Nov 06, 2012 7:27 pm

Thanks for the replies.pic clause is alphanumeric.and prem kishan I tried inspect and got it right.Thank you.
VIJAY1
 
Posts: 26
Joined: Sun Oct 21, 2012 2:49 pm
Has thanked: 3 times
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post