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

Find the LENGTH of a String in COBOL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Nov 27, 2009 6:18 am
Reply with quote

The original Enterprise Cobol Manual (several years ago),
had a comment that stipulated that, like C or JAVA,
the COBOL LENGTH function of a variable would return either
the compile time generated length,
or would reflect the length of a null (X'00') delineated string.

Subsequent versions of the manual have omitted the NULL delineated string concept

it is not in force, nor was it ever in force. The original manual was published in error
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Nov 27, 2009 7:46 am
Reply with quote

Hello,

Quote:
you cannot change the length of the variable at run time -- it will always and forever be the length set at compile time.
While length will remain constant; You can choose how much of the variable you use.

So you might consider calculating/determining the "length to use" and when "using" the field, specify reference modification and the calculated length-to-use for those statements. . .
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 Goto page Previous  1, 2

 


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 COBOL -Linkage Section-Case Sensitive COBOL Programming 1
Search our Forums:

Back to Top