Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us