Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 How to Count a particular record in a... Mounika Nemani DFSORT/ICETOOL 5 Tue May 29, 2018 1:07 pm
No new posts Limit in Length for a CICS START seahawk789 CICS 6 Mon Apr 02, 2018 8:34 pm
No new posts Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am
No new posts Creation of Datasets dynamically on t... Raghu M N DFSORT/ICETOOL 8 Fri Mar 16, 2018 12:56 am
No new posts Find a string in PS file opened in br... mukkas CLIST & REXX 3 Sat Feb 24, 2018 2:15 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us