View previous topic :: View next topic
|
Author |
Message |
Sunaina Javali
New User
Joined: 22 Apr 2009 Posts: 16 Location: Bangalore
|
|
|
|
Hi,
please anybody helps me to know;
Can we display the INDEX? If yes, then how?
Thanks,
Nisha |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
The easiest way, which would work in all versions of COBOL is
SET W-S-VAR-PICS9(9)-USAGE-DISPLAY TO THE-INDEX-U-WANT-TO-DISPLAY
DISPLAY W-S-VAR-PICS9(9)-USAGE-DISPLAY |
|
Back to top |
|
|
Sunaina Javali
New User
Joined: 22 Apr 2009 Posts: 16 Location: Bangalore
|
|
|
|
Thanks Dick
it's working |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
thx for the feedback |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
I thought it could be displayed directly. Even though it's stored as an offset, I think it's displayed as an occurrence number. Can't test since no mainframe access currently. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
If (as Terry has asked) you're looking for the actual displacement and you want to display this displacement, try the following -
Code: |
03 WS-PACKED PIC 9(04)V9 COMP-3.
03 FILLER REDEFINES WS-PACKED.
05 WS-FWORD PIC 9(08) COMP.
05 FILLER PIC X(01).
03 WS-DISPLAY PIC 9(08)V9.
03 WS-DISPLAY-X REDEFINES WS-DISPLAY PIC X(09).
MOVE ZERO TO WS-PACKED.
SET WS-FWORD TO INDEX-NAME.
MOVE WS-PACKED TO WS-DISPLAY.
INSPECT WS-DISPLAY-X CONVERTING X'FAFBFCFDFEFF' TO 'ABCDEF'.
|
At this point, the actual index-displacement value can be found in displayable format in WS-DISPLAY-X (1:8). |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Terry Heinze wrote: |
I thought it could be displayed directly. Even though it's stored as an offset, I think it's displayed as an occurrence number. Can't test since no mainframe access currently. |
some of the later versions of COBOL, yes.
Terry,
I just wanted to give him a solution that would work, regardless the VSN of COBOL or OPS-SYS. |
|
Back to top |
|
|
|