View previous topic :: View next topic
|
Author |
Message |
anatha
New User
Joined: 19 Jan 2006 Posts: 7
|
|
|
|
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 |
|
|
sbalajibe
New User
Joined: 15 Aug 2005 Posts: 62
|
|
|
|
hi anatha,
length Function shoul solve u r problem
thanks
Balaji |
|
Back to top |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
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 |
|
|
anatha
New User
Joined: 19 Jan 2006 Posts: 7
|
|
|
|
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 |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
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 |
|
|
|