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
 

 

How to count the string length

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
dipanshu

New User


Joined: 16 Jan 2006
Posts: 53
Location: pune

PostPosted: Fri Feb 10, 2006 9:31 pm    Post subject: How to count the string length
Reply with quote

str1 contains 'dipanshu goyal 2008'

how to calculate the length of str1

Pls assist

Thanks,
Dipanshu
Back to top
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Fri Feb 10, 2006 9:50 pm    Post subject: Re: How to count the string length
Reply with quote

You could have made a search to find out the help in forum instead.
Despite having a warning you didnt try that, I wish you help next time.

Well, Below pasted is the code for you.

Code:
INSPECT FUNCTION REVERSE(TEXT1) TALLYING L FOR LEADING SPACE
COMPUTE L = X - L.                                         

*X= Total length of the variable.


Courtsy : MMWIFE (This code is taken from one of mmwife's earlier post, with a slight change icon_wink.gif )

Regards,

Priyesh.
Back to top
View user's profile Send private message
dileepv

New User


Joined: 03 Nov 2005
Posts: 2
Location: Hyderabad,AP,India

PostPosted: Sat Feb 11, 2006 5:37 pm    Post subject: Re: How to count the string length
Reply with quote



you have asked a simple question . right?
it is " length of str1 " will give u the result
ok bye
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Feb 11, 2006 9:57 pm    Post subject:
Reply with quote

Hi Priyesh,

Thanx for the by-line. icon_smile.gif

dileepv,

str1 can be a pic x(50) field, length of str1 would yield "50". I'm sure Dipanshu meant:

"var1 pic x(50) contains str1. str1 contains 'dipanshu goyal 2008'. How to calculate the length of str1."
Back to top
View user's profile Send private message
siva2
Warnings : 1

New User


Joined: 10 Feb 2006
Posts: 7

PostPosted: Mon Feb 13, 2006 11:48 am    Post subject: my query .. regd copy book
Reply with quote

1. waht is copy book ..
wht it contains..

explain me clearly..

im not clear about the concept..
please..
Back to top
View user's profile Send private message
jangam

New User


Joined: 02 Feb 2006
Posts: 7

PostPosted: Tue Feb 14, 2006 8:49 pm    Post subject: Re: How to count the string length
Reply with quote

HI
Code:


INSPECT SOURCESTR1 TALLYING COUNTER#1 FOR [ALL] CHARACTERS



I THINK THIS WORK CHECK PLEASE

REGARDS

HARI
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 abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm


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