View previous topic :: View next topic
|
Author |
Message |
seenu
New User
Joined: 09 Jun 2004 Posts: 3
|
|
|
|
Hi,
I have a string ws-a x(400). I have to check the length of the string and if it contains more than 250 chars, then i have to unstring the rest and put it in another string. I am using cobol II under z/os environment..
regards,
Seenu |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Seenu,
I'd do something like this:
Code: |
if your-fld(251:) > spaces
move your-fld(251:) to new-fld
end-if
|
Regards, Jack. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Oops, forgot to clear the 1st field:
also "move spaces to your-fld(251:) "
Jack |
|
Back to top |
|
|
seenu
New User
Joined: 09 Jun 2004 Posts: 3
|
|
|
|
Thanks Jack for the reply |
|
Back to top |
|
|
Arun Joseph
New User
Joined: 30 Mar 2005 Posts: 13 Location: India
|
|
|
|
This works only if your-fld has been initialized with spaces. Otherwise there may be junk characters which may cause the condition to be true. |
|
Back to top |
|
|
|