View previous topic :: View next topic
|
Author |
Message |
Appu
New User
Joined: 26 Apr 2010 Posts: 73 Location: India
|
|
|
|
Hi,
Please see the below COBOL code.
COBOL Declarations
Code: |
01 ERROR-PCB.
05 ERROR-DBNAME PIC X(8).
05 ERROR-SEGLEVEL PIC XX.
05 ERROR-STATUS PIC XX.
05 ERROR-PROCOPT PIC X(4).
05 ERROR-RESERVE PIC X(4).
05 ERROR-SEGNAME PIC X(8).
05 ERROR-KEYLENGTH PIC S9(5) COMP.
05 ERROR-SENSNUM PIC S9(5) COMP.
05 ERROR-KEYAREA PIC X(25).
05 FILLER PIC X(50).
01 IOBER.
03 PCB-IO POINTER.
01 IO-PCB PIC X(100).
|
COBOL Code
Code: |
SET PCB-IO TO ADDRESS OF IO-PCB.
SET ADDRESS OF ERROR-PCB TO PCB-IO.
|
The spool display of IO-PCB is as follows :
Code: |
4444444410444444444444444444444444444444444444440000
0000000000000000000000000000000000000000000000000000
|
I tried printing ERROR-PCB after the assignment and in the spool all the items declared inside ERROR-PCB are coming correctly but i am getting unexpected values for ERROR-KEYLENGTH and ERROR-SENSNUM.
I am getting the value 52576 for ERROR-KEYLENGTH and ERROR-SENSNUM. But from the spool display of IO-PCB i was expecting the values from position 29-36 in the hex output above.
Could please anyone explain why ERROR-KEYLENGTH and ERROR-SENSNUM is showing a values which is not at all present in IO-PCB.
Is there any relation since these two fields are PIC S9(5) COMP ?
Please help. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
in which section are PCB-IO, IO-PCB, ERROR-PCB defined
all in working storage? all in linkage?
which level of cobol are you using? (cobol II or enterprise?) |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Try this instead -
Code: |
SET PCB-IO TO ADDRESS OF ERROR-PCB.
SET ADDRESS OF IO-PCB TO PCB-IO.
|
The contents of IO-PCB is now the same as the contents of ERROR-PCB, because they are pointing to the same address of ERROR-PCB.
You had just the opposite, pointing both at the address of IO-PCB, which looks to be uninitialized.
Why not just display the contents of ERROR-PCB? Is there a real reason to monkey around with storage addresses as this is foreign to many folks using COBOL.
What version/release of COBOL are you using?
Are these WS or LINKAGE items?
Bill |
|
Back to top |
|
|
|