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

differnce in finding the length cobol II and cobol III


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
madhan1582

New User


Joined: 02 Aug 2005
Posts: 3
Location: chennai

PostPosted: Wed Aug 17, 2005 11:59 am
Reply with quote

In cobol III i will find the length of the variable using the function

function lenght(variable-name)

but in cobol II its not allowed to use length function ( so i have to use inspect in that case it is returning the length of the variable which is declared.
eg;
01 varstr pic x(15) value 'hari'.
01 cnt pic 9(2).
if i am using the following syntax it is giving me the result 15 ,whether it will be possible to find the values length i.e 4 (as in length function).

Inspect varstr talling cnt for charecters.

pls give me the result if u people know it.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Wed Aug 17, 2005 12:12 pm
Reply with quote

Hi Madhan,

One post...Two queries....With out Search....in Wrong Forum.... icon_biggrin.gif

Quote:
if i am using the following syntax it is giving me the result 15 ,whether it will be possible to find the values length i.e 4 (as in length function).


You can do it like this.

Code:
ENVIRONMENT DIVISION.                                       
CONFIGURATION SECTION.             
SPECIAL-NAMES. CLASS VALID-DATA IS 'A' THRU 'Z'.   
..           
..
..
INSPECT VARSTR TALLYING CNT
        FOR ALL VALID-DATA.

You can also add more special characters as per your requirements in SPECIAL-NAMES clause.

Regards,

Priyesh.
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Finding and researching jobs All Other Mainframe Topics 0
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
Search our Forums:

Back to Top