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

How to count the string length


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 1448
Location: Chicago, IL

PostPosted: Fri Feb 10, 2006 9:50 pm
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts To get the count of rows for every 1 ... DB2 3
Search our Forums:

Back to Top