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 Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm


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