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
 

 

Why INDEX of an array cannot be displayed

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
srinivas12

New User


Joined: 11 Apr 2005
Posts: 6
Location: hyderabad

PostPosted: Mon Apr 11, 2005 7:22 pm    Post subject: Why INDEX of an array cannot be displayed
Reply with quote

Hi,

Can anyone tell why index of an array cannot be displayed.
Also one more question.
We know that an ESDS cannot have index. Then where will the RBA's will be stored for random access...
Back to top
View user's profile Send private message

learnmf

Active User


Joined: 14 Mar 2005
Posts: 123

PostPosted: Mon Apr 11, 2005 8:08 pm    Post subject:
Reply with quote

Quote:
Can anyone tell why index of an array cannot be displayed.


HI Srinivas
Index cannot be declare as a variable in data division.Thats why it cannot be displayed.
Thanks
Chandra
Back to top
View user's profile Send private message
srinivas12

New User


Joined: 11 Apr 2005
Posts: 6
Location: hyderabad

PostPosted: Mon Apr 11, 2005 9:54 pm    Post subject: Re: Why INDEX of an array cannot be displayed
Reply with quote

Hi Chandra,

I accept that it'll not be declared in the data division.Then it should be taken care by system.So we can call it as a system variable.
system variables like date,timestamps can be declared without declaring them.Then why cant an index????
Back to top
View user's profile Send private message
somasundaran_k

Active User


Joined: 03 Jun 2003
Posts: 134

PostPosted: Mon Apr 11, 2005 10:17 pm    Post subject:
Reply with quote

srinivas12

Since index refers to the memory address/register it can not be displayed directly by the DISPLAY statement.
If you want to DISPLAY it declare a working storage variable
Code:

01  WS-IDX                           PIC 9(4) VALUE 0.

       SET YOUR-IDX TO WS-IDX
       DISPLAY 'INDEX:' WS-IDX



hth
-Som
Back to top
View user's profile Send private message
srinivas12

New User


Joined: 11 Apr 2005
Posts: 6
Location: hyderabad

PostPosted: Mon Apr 11, 2005 11:00 pm    Post subject: Re: Why INDEX of an array cannot be displayed
Reply with quote

Hi Som,
Thanks a lot for the reply .Could u answer my second question.It was asked in one of the interview.What i feel that we calculate RBA to retrieve a particular record but we'll not store that.Correct me if i am wrong
Back to top
View user's profile Send private message
somasundaran_k

Active User


Joined: 03 Jun 2003
Posts: 134

PostPosted: Mon Apr 11, 2005 11:53 pm    Post subject:
Reply with quote

srinivas12

You are right. We are not storing the value of RBA in the file. RBA is used to access ESDS randomly. And it has been caluculated using the length of the record and the record number. You can use IDCAMS to Print the RBA for a particular/all the record/s.
Say for getting the RBA of 100th record in an ESDS
Code:

//PRINTRBA EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//MYESDS DD DSN=YOUR.ESDS.FILE,DISP=SHR
//SYSIN DD *
PRINT INFILE(MYESDS) -
SKIP (99) -
COUNT (1)
/*


Remove the SKIP and COUNT from the SYSIN you will get the RBA printed for the entire records.

hth
-Som
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 -> JCL & VSAM 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 Several errors during building altern... Andi1982 JCL & VSAM 11 Wed Jul 06, 2016 7:39 pm
No new posts Drop building Alternate Index for a p... bhavin.mehta JCL & VSAM 6 Mon Jul 04, 2016 3:47 pm
No new posts Unstring list of values into an array. Roshnii COBOL Programming 8 Mon Jun 27, 2016 6:25 pm
No new posts VSAM Alternate Index in CICS jacobdng CICS 2 Fri May 06, 2016 1:41 pm


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