Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Length of characters

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Length of characters
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts Remove Special Characters from Mainfr... Rodger Zhang All Other Mainframe Topics 6 Wed Jul 06, 2016 1:12 am
No new posts File Manager with Variable Length File ahabib IBM Tools 10 Thu Mar 31, 2016 11:00 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us