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
 
Working storage with index - comparison?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Working storage with index - comparison?
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

Site Director


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

PostPosted: Thu Sep 06, 2007 6:31 pm    Post subject:
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    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Thu Sep 06, 2007 6:44 pm    Post subject:
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Thu Sep 06, 2007 7:48 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Sat Sep 15, 2007 1:30 am    Post subject:
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Sat Sep 15, 2007 2:48 pm    Post subject:
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    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 sharing PLI storage Pedro PL/I & Assembler 2 Mon Oct 16, 2017 10:11 pm
No new posts LIBDEF not working in called proc packerm CLIST & REXX 0 Fri Sep 15, 2017 7:22 pm
No new posts Working with hex values in Filemanage... Emile Straker IBM Tools 0 Tue Sep 12, 2017 1:42 am
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 ISREDIT MACRO NOT WORKING! :cry: kirank889 TSO/ISPF 3 Thu Aug 03, 2017 5:46 pm

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