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
 

 

Difference between INSPECT and FUNCTION LENGTH

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
jpraveenreddy

New User


Joined: 30 Nov 2007
Posts: 28
Location: mysore

PostPosted: Thu Feb 21, 2008 1:07 pm    Post subject: Difference between INSPECT and FUNCTION LENGTH
Reply with quote

Hi friends,
I want to find length of a field and pad zeroes,but I am not sure whether to do it using INSPECT verd or with intrinsic FUNCTION LENGTH.
Can you tell me the difference between the two approaches? icon_smile.gif
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Feb 21, 2008 1:31 pm    Post subject:
Reply with quote

function length will return the PIC clause defined length.

one of the inspect formats will tally the number of instances a char exists in a field.

I don't understand: I want to find length of a field and pad zeroes.
Back to top
View user's profile Send private message
jpraveenreddy

New User


Joined: 30 Nov 2007
Posts: 28
Location: mysore

PostPosted: Thu Feb 21, 2008 2:11 pm    Post subject: Reply to: Difference between INSPECT and FUNCTION LENGTH
Reply with quote

Thanx dbzTHEdinosauer.
Thats what I was thinking, now its confirmed.
I wanted to pad zeroes in the unoccupied positions of the field. icon_biggrin.gif
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu Feb 21, 2008 8:09 pm    Post subject: Re: Reply to: Difference between INSPECT and FUNCTION LENGTH
Reply with quote

jpraveenreddy wrote:
I wanted to pad zeroes in the unoccupied positions of the field.
If you know what is in the 'unoccupied' positions, INSPECT REPLACING will work fine. Have you looked at NUMVAL and NUMVAL-C?
Back to top
View user's profile Send private message
raak

Active User


Joined: 23 May 2006
Posts: 166
Location: chennai

PostPosted: Fri Feb 22, 2008 10:42 am    Post subject:
Reply with quote

If your variable is in WORKING-STORAGE, the length does not change, ever. So FUNCTION LENGTH will only return one value no matter what data is stored in the variable. INSPECT allows you to locate the last byte of relevant data in the variable.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm


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