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
 
Can we display the INDEX? If yes, then how?

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

New User


Joined: 22 Apr 2009
Posts: 16
Location: Bangalore

PostPosted: Mon Jun 01, 2009 1:02 pm    Post subject: Can we display the INDEX? If yes, then how?
Reply with quote

Hi,


please anybody helps me to know;
Can we display the INDEX? If yes, then how?


Thanks,
Nisha
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Mon Jun 01, 2009 1:19 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Sunaina Javali

New User


Joined: 22 Apr 2009
Posts: 16
Location: Bangalore

PostPosted: Mon Jun 01, 2009 2:30 pm    Post subject: Can we display the INDEX? If yes, then how?
Reply with quote

Thanks Dick

it's working icon_biggrin.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Mon Jun 01, 2009 3:09 pm    Post subject:
Reply with quote

thx for the feedback
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue Jun 02, 2009 1:46 am    Post subject:
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Tue Jun 02, 2009 1:55 am    Post subject: Reply to: Can we display the INDEX? If yes, then how?
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Tue Jun 02, 2009 3:09 am    Post subject:
Reply with quote

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
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 display the sign only if the value is... useit DFSORT/ICETOOL 3 Wed Oct 04, 2017 5:53 pm
No new posts Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm
No new posts DB2 NULL Values display V S Amarendra Reddy DB2 3 Thu Sep 07, 2017 6:59 pm
No new posts Confusion b/w index and subscript Deepak kumar25 Mainframe Interview Questions 7 Thu Aug 31, 2017 6:50 am
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm

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