View previous topic :: View next topic |
Author |
Message |
badri5 Banned
Joined: 27 Jun 2006 Posts: 18 Topics: 16
|
Posted: Tue Sep 01, 2009 7:54 am Post subject: Checking the length of a string |
|
|
I want to check the length of a string in cobol.
Here is the example
ws-var1 pic x(17) .
1st record----abcdefghijklm
I checked like this
If ws-var1(1:17) not = ' '
and
If ws-var1(1:17) not = ' '-----17 spaces
and
if ws-var1(1:17) not = spaces
The above example is 13 characters.rest 4 characters are spaces.But it is accepting.
i checked like the above conditions.but even if it is 13 characters it is accepting.If it is 17 characters only it should accept.even if 17th character is a space it should not accept.
Could you kindly tell me how to code for this logic for this |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
|
|