IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Length of characters


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
seenu

New User


Joined: 09 Jun 2004
Posts: 3

PostPosted: Wed Jun 09, 2004 10:21 am
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Thu Jun 10, 2004 12:10 am
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Thu Jun 10, 2004 12:13 am
Reply with quote

Oops, forgot to clear the 1st field:

also "move spaces to your-fld(251:) "

Jack
Back to top
View user's profile Send private message
seenu

New User


Joined: 09 Jun 2004
Posts: 3

PostPosted: Thu Jun 10, 2004 11:14 am
Reply with quote

Thanks Jack for the reply
Back to top
View user's profile Send private message
Arun Joseph

New User


Joined: 30 Mar 2005
Posts: 13
Location: India

PostPosted: Wed Mar 30, 2005 9:26 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
Search our Forums:

Back to Top