View previous topic :: View next topic
|
Author |
Message |
spoorni
New User
Joined: 29 Nov 2007 Posts: 20 Location: india
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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.
HTH.... |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
Why would you want pipe in comp3 though? |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Rohit,
He doesn't which is why he has a problem. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
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 |
|
|
|