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
 

 

differnce in finding the length cobol II and cobol III

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: differnce in finding the length cobol II and cobol III
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: 1452
Location: Chicago, IL

PostPosted: Wed Aug 17, 2005 12:12 pm    Post subject: Re: differnce in finding the length cobol II and cobol III
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm


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