Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 6968
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: 6968
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: 2502
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: 6968
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 SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts Display upon console bipinpeter COBOL Programming 1 Thu Jun 22, 2017 12:35 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us