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
 

 

To display USAGE IS INDEX item

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sudhakar.harish
Warnings : 1

New User


Joined: 06 Dec 2006
Posts: 3
Location: ERNAKULAM

PostPosted: Mon Dec 11, 2006 2:37 pm    Post subject: To display USAGE IS INDEX item
Reply with quote

Is it possible to display index if so what will be displayed and how?
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Dec 11, 2006 3:22 pm    Post subject:
Reply with quote

Index of what?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2181
Location: @my desk

PostPosted: Mon Dec 11, 2006 4:09 pm    Post subject:
Reply with quote

Hi

You cant use the DISPLAY statement to see the contents of a table index.

Thanks
Arun
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Dec 11, 2006 4:37 pm    Post subject:
Reply with quote

hi,

Because an index has a special internal representation it cannot be displayed and can only be assigned a value, or have its value assigned, by the SET verb. The MOVE cannot be used with a table index.
Back to top
View user's profile Send private message
yaju4ever
Warnings : 1

New User


Joined: 30 Sep 2006
Posts: 19
Location: mumbai

PostPosted: Mon Dec 11, 2006 4:44 pm    Post subject:
Reply with quote

if u want to print the value of the index then u have to define the INDEX DATA ITEM using USAGE IS INDEX in wrking strg section.....then move that index in tht index data item and then print that index data item....it will show u the value of ur index....
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Dec 11, 2006 5:18 pm    Post subject:
Reply with quote

hey try this, sudhakar.harish....
using the SET verb u can assign the value of index to a data-name.and then display that data-name content... as shown below
Code:

WORKING-STORAGE SECTION.                   
01 A PIC 9.                               
01 FAC1.                                   
    02 FAC OCCURS 3 TIMES INDEXED BY F1.   
        04 SUBI PIC XX.                   
PROCEDURE DIVISION.                       
    SET F1 TO 3.                           
    SET A TO F1.                           
    DISPLAY A.                             
    STOP RUN.                             
 
Back to top
View user's profile Send private message
yaju4ever
Warnings : 1

New User


Joined: 30 Sep 2006
Posts: 19
Location: mumbai

PostPosted: Mon Dec 11, 2006 5:40 pm    Post subject:
Reply with quote

krisprems wrote:
hey try this, sudhakar.harish....
using the SET verb u can assign the value of index to a data-name.and then display that data-name content... as shown below
Code:

WORKING-STORAGE SECTION.                   
01 A PIC 9.                               
01 FAC1.                                   
    02 FAC OCCURS 3 TIMES INDEXED BY F1.   
        04 SUBI PIC XX.                   
PROCEDURE DIVISION.                       
    SET F1 TO 3.                           
    SET A TO F1.                           
    DISPLAY A.                             
    STOP RUN.                             
 



ya it will also wrk but wht i write previously will also wrk.....
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2181
Location: @my desk

PostPosted: Mon Dec 11, 2006 6:00 pm    Post subject:
Reply with quote

Hi yaju4ever

You cant use MOVE / DISPLAY statements with a USAGE IS INDEX data-item.Any item declared with USAGE IS INDEX can only appear in:


- A SEARCH or SET statement
- A relation condition
- The USING phrase of the PROCEDURE DIVISION
- The USING phrase of the CALL statement


Thanks
Arun
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Dec 11, 2006 6:02 pm    Post subject:
Reply with quote

If I recall correctly, you can redefine it to a full word binary and display its value.
Back to top
View user's profile Send private message
yaju4ever
Warnings : 1

New User


Joined: 30 Sep 2006
Posts: 19
Location: mumbai

PostPosted: Mon Dec 11, 2006 6:47 pm    Post subject:
Reply with quote

arcvns wrote:
Hi yaju4ever

You cant use MOVE / DISPLAY statements with a USAGE IS INDEX data-item.Any item declared with USAGE IS INDEX can only appear in:


- A SEARCH or SET statement
- A relation condition
- The USING phrase of the PROCEDURE DIVISION
- The USING phrase of the CALL statement


Thanks
Arun




let me coorect my written explanation,,,,but my meant by wrting move was abt SET.....i am correctng it....
if u want to print the value of the index then u have to define the INDEX DATA ITEM using USAGE IS INDEX in wrking strg section.....then move that index in tht index data item using SET and then print that index data item....it will show u the displacement of a data item refered by tht indexs....but above code give krisperms will give u the value of index only.....
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2181
Location: @my desk

PostPosted: Mon Dec 11, 2006 6:54 pm    Post subject:
Reply with quote

Hi William

You are right.It s giving the desired result

Thanks
Arun
Back to top
View user's profile Send private message
yaju4ever
Warnings : 1

New User


Joined: 30 Sep 2006
Posts: 19
Location: mumbai

PostPosted: Mon Dec 11, 2006 7:07 pm    Post subject: thnx
Reply with quote

hi wiliam ....thnx for cheking it and making me more confident abt my concept....
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 Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm
No new posts Display ZEDLMSG without Pressing F1 &... anandgbe CLIST & REXX 8 Thu Dec 15, 2016 4:20 pm
No new posts How to display value of an exit param... lind sh CICS 2 Sun Oct 09, 2016 12:28 pm
This topic is locked: you cannot edit posts or make replies. DSList (3.4) cannot display Chinese c... jacobdng TSO/ISPF 4 Wed Oct 05, 2016 2:51 pm
This topic is locked: you cannot edit posts or make replies. Get and display content of an address... lind sh CICS 1 Mon Aug 08, 2016 9:18 am


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