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 find string length in COBOL ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
anatha

New User


Joined: 19 Jan 2006
Posts: 7

PostPosted: Tue Jan 24, 2006 11:21 am    Post subject: How to find string length in COBOL ?
Reply with quote

Hi Friends,

How do u findout the string length in COBOL? (Note:- The string is the
combination of two or more strings Ex:- ?Ravi Kumar?)
:(
Back to top
View user's profile Send private message

sbalajibe

New User


Joined: 15 Aug 2005
Posts: 62

PostPosted: Tue Jan 24, 2006 11:59 am    Post subject:
Reply with quote

hi anatha,
length Function shoul solve u r problem

thanks
Balaji
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Tue Jan 24, 2006 12:13 pm    Post subject: Length Function
Reply with quote

Hi anatha,
Adding to balaji's point u may use the function in this manner:

Code:

01 X Pic 9(2).
01 Output-Record.
05 Product-Name Pic x(20).
05 Product-Number Pic 9(9).
05 Product-Price Pic 9(6).
. . .
Procedure Division.

Compute X = Function Length(Output-Record)


The LENGTH function returns the length of a national item in national characters.
Back to top
View user's profile Send private message
anatha

New User


Joined: 19 Jan 2006
Posts: 7

PostPosted: Tue Jan 24, 2006 2:05 pm    Post subject:
Reply with quote

Thanks khamarutheen ,
But i have small doubt what is
"Function Length(Output-Record) "
what is Function .that is user defined function or .......
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Tue Jan 24, 2006 2:39 pm    Post subject: Function in cobol
Reply with quote

Hi anatha,

FUNCTION is a reserved word, but the function-names are not
reserved. So to invoke any built in function v follow as

Syntx:
FUNCTION Funtionname(parameter)

Like that. Hope Understood. Let me know if u wanna more....
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 -> DB2 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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
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