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
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts Finding IMS resource blocker after se... Hooman24 IMS DB/DC 1 Wed Aug 16, 2017 9:17 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm


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