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
 

 

Inspect statement

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

New User


Joined: 29 Nov 2007
Posts: 20
Location: india

PostPosted: Mon Jun 06, 2016 9:53 pm    Post subject: Inspect statement
Reply with quote

I am trying to use an inspect statement in a cobol program as follows:
INSPECT PBRO-BLAZE-REC REPLACING ALL LOW-VALUES BY '|'

The PBRO-BLAZE-REC has some S9(02) COMP-3 fields and they are getting replaced as well when i use this inspect statement. Is there any reason why? If yes, how can this be resolved?
Back to top
View user's profile Send private message

Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Mon Jun 06, 2016 10:26 pm    Post subject: Reply to: Inspect statement
Reply with quote

Yes, because an S9(02) COMP-3 field could contain X'00' in the first byte. As far as INSPECT is concerned, this is a legitimate target. It doesn't care about the PICTURE clause, it's an equal opportunity Verb. icon_lol.gif

HTH....
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Mon Jun 06, 2016 10:28 pm    Post subject:
Reply with quote

Quote:
Is there any reason why? If yes, how can this be resolved?
If you don't know the internal representation for a COMP-3 variable, you need to read the Enterprise COBOL Programming Guide manual to find out - try page 53 of the version 6.1 manual. A PIC S9(02) COMP-3 variable will take TWO bytes and if the absolute value of the variable is less than 10, then the first byte will have a LOW-VALUE in it. As far as resolving the issue, you have multiple choices:
1. Do not use that INSPECT statement
2. Change the COMP-3 variables to USAGE DISPLAY
3. Modify the INSPECT to work on variables except the COMP-3 variables
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Tue Jun 07, 2016 7:05 pm    Post subject:
Reply with quote

Why would you want pipe in comp3 though?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Tue Jun 07, 2016 8:38 pm    Post subject:
Reply with quote

Rohit,
He doesn't which is why he has a problem.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Tue Jun 07, 2016 9:43 pm    Post subject:
Reply with quote

Nic,
yes, I wanted TS to look Manuals on what data items the INSPECT would works. INSPECT is what TS did not read in the manuals before using it and Robert pointed the options already.
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 -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am
No new posts Converting NULL column into NOT NULL ... Raghu navaikulam DB2 5 Sat Aug 06, 2016 3:45 pm
This topic is locked: you cannot edit posts or make replies. Updating value of key using rewrite s... ParminderKumar COBOL Programming 4 Thu Aug 04, 2016 12:46 am
No new posts View Copybook having COPY statement i... nkumar Compuware & Other Tools 6 Mon May 16, 2016 7:28 pm


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