IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Working storage with index - comparison?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
emonmisra

New User


Joined: 10 Jul 2006
Posts: 7
Location: Bangalore

PostPosted: Thu Sep 06, 2007 6:20 pm
Reply with quote

HI,

Have u ever come across the situation where one Index of internal table is compared with a working storage variable.

Warning: ???????????? removed from Titile
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Sep 06, 2007 6:31 pm
Reply with quote

Hello,

Yes, it is fairly common. . .
Back to top
View user's profile Send private message
emonmisra

New User


Joined: 10 Jul 2006
Posts: 7
Location: Bangalore

PostPosted: Thu Sep 06, 2007 6:37 pm
Reply with quote

Hi,

But index is not variable. this is displacement. we can even dispaly the value of index. How it can be comapred like

RBASSC-DRIVERX > WS-TOTAL-DRIVERS-INEXP
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Sep 06, 2007 6:43 pm
Reply with quote

emonmisra wrote:
Hi,

But index is not variable. this is displacement. we can even dispaly the value of index. How it can be comapred like

RBASSC-DRIVERX > WS-TOTAL-DRIVERS-INEXP


COBOL will convert the index to an occurence number and do a numeric compare.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Thu Sep 06, 2007 6:44 pm
Reply with quote

Try Comparing index-names and index data items....
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Sep 06, 2007 7:25 pm
Reply with quote

William Thompson wrote:
Try Comparing index-names and index data items....


That would be more efficient but you have to remember to set the index data item to a displacement and not an occurence.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Sep 06, 2007 7:48 pm
Reply with quote

If you look at table 24, you will see that an index-name can be compared toa numeric interger (data-name or literal) and it will compare the occurance number of the index-name.....
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Fri Sep 14, 2007 10:50 pm
Reply with quote

This is an example of why it is easier to track a subscript (defined in ws) as opposed to an index. Indices are horrible to debug and terrible to find in a dump. Susbscripts are much more manageable.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Sep 14, 2007 11:06 pm
Reply with quote

Sandy Zimmer wrote:
This is an example of why it is easier to track a subscript (defined in ws) as opposed to an index. Indices are horrible to debug and terrible to find in a dump. Susbscripts are much more manageable.


But indexes are more efficient.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Fri Sep 14, 2007 11:10 pm
Reply with quote

Really? I do think that has been disproven. Besides, which is cheaper - lately - hardware or programmers? I always opt for a compromise.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Sat Sep 15, 2007 1:30 am
Reply with quote

Well, Sandy, I guess we can all agree where you stand on the index/subscript question....grin....

As far as efficiency goes, it depends.....indexes are recalculated each time they are incremented while subscripts are calculated upon reference to the data item in the table.

They both have their place, but you can't SEARCH without indexes....
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Sat Sep 15, 2007 4:16 am
Reply with quote

Well, CICS Guy - maybe you cannot search without an index, but the way I do it, I can search with a subscript. I have done it for years. I just do not use SEARCH or SEARCH ALL. icon_smile.gif I just check the values as I go thru the table. Remember that the table must be in sequence. When I hit a value greater than what I am looking for, or I find what I am looking for, or I'm at the end of the table. I end the search. Maybe I just like the control? icon_lol.gif
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Sat Sep 15, 2007 2:48 pm
Reply with quote

Sandy Zimmer wrote:
Maybe I just like the control
Good for you.....And I never said that you couldn't search a table..... icon_lol.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts CICS vs LE: STORAGE option CICS 0
No new posts Cobol file using index COBOL Programming 2
Search our Forums:

Back to Top