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
 
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: 2504
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: 8154
Location: East Dubuque, Illinois, USA

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: 1788
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: 1868
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: 1788
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 WER268A OUTREC STATEMENT : SYNTAX E... frozenblood87 SYNCSORT 12 Sat Aug 26, 2017 9:45 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm
No new posts ON 2 AND EVERY 1 - Statement ??? UmeySan COBOL Programming 2 Tue Jul 25, 2017 1:20 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm

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