MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

High Values

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
nadh
Intermediate


Joined: 08 Oct 2004
Posts: 192
Topics: 89

PostPosted: Thu Feb 05, 2009 9:28 am    Post subject: High Values Reply with quote

Hi,

I've coded one variable as below in working storage section. Is this ok. please confirm
Code:

01  HOLD-CUSTOMER-SAE-LIST               VALUE HIGH-VALUES.
                                                           
  03  HOLD-CUSTOMER-SAE OCCURS 20000 TIMES.                 
    05  HOLD-SAE-KEY.                                       
        10  HOLD-SAE-CODE                PIC X(07).         
        10  HOLD-SAE-SUFFIX              PIC X(03).         
        10  HOLD-SAE-BT-CUSTOMER-KEY.                       
            15  HOLD-SAE-BT-TEL-NBR      PIC X(10).         
            15  HOLD-SAE-BT-CUS-CD       PIC X(03).         
    05  HOLD-SAE-QTY                     PIC 9(04).         
    05  HOLD-SAE-BLG-EFF-DT              PIC X(06).         
                                                           


Thanks
nadh
Back to top
View user's profile Send private message Send e-mail
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Feb 05, 2009 10:18 am    Post subject: Reply with quote

did it compile?
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
nadh
Intermediate


Joined: 08 Oct 2004
Posts: 192
Topics: 89

PostPosted: Thu Feb 05, 2009 10:51 am    Post subject: Reply with quote

Yeah It is compiled and in production..

Thanks
Nadh
Back to top
View user's profile Send private message Send e-mail
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Feb 05, 2009 10:53 am    Post subject: Reply with quote

then what is your question?
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Sat Feb 07, 2009 1:56 am    Post subject: Reply with quote

I doubt it compiled cleanly. You might want to look again at the information, warning, error, and severe messages of your compile listing.
P.S. I stand corrected. After checking the manual, it looks like this is legitimate. In 30 years of coding in COBOL, I've never initialized a group item in this manner though. I especially would not initialize a numeric field with X'FF's.
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
haatvedt
Beginner


Joined: 14 Nov 2003
Posts: 66
Topics: 0
Location: St Cloud, Minnesota USA

PostPosted: Sat Feb 14, 2009 2:42 pm    Post subject: Reply with quote

This could be a situation where they have some sequential or binary search logic for this array. when initializing an array to be used in a binary or sequential search for which the data is known to be in ascending sequence, the unused portion of the array must be initialized to high values to get a binary search to function properly. A sequential search will work without this, but it can be made more efficient when a "not found" condition is being executed by exiting the search when the array key is > the search key. This requires that the unused portion of the array also be initialized to high-values...

just a thought...

I used to do this quite a bit...

lately I define these arrays with an OCCURS DEPENDING ON clause and this can eliminate the need to initialize the array altogether when using the SEARCH or SEARCH ALL verbs in COBOL..

lots of different ways to skin the proverbial cat in this case...

if I had to guess, i would think that this was a way to make the search more
efficient.

thanks,
_________________
Chuck Haatvedt

email --> clastnameatcharterdotnet

(replace lastname, at, dot with appropriate
characters)
Back to top
View user's profile Send private message
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Sun Feb 15, 2009 11:53 am    Post subject: Reply with quote

A binary search (SEARCH ALL) would not be allowed in this case since there is no INDEXED BY clause present.
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group