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 line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm

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