View previous topic :: View next topic |
Author |
Message |
nadh Intermediate
Joined: 08 Oct 2004 Posts: 192 Topics: 89
|
Posted: Thu Feb 05, 2009 9:28 am Post subject: High Values |
|
|
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 |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Thu Feb 05, 2009 10:18 am Post subject: |
|
|
did it compile? _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
nadh Intermediate
Joined: 08 Oct 2004 Posts: 192 Topics: 89
|
Posted: Thu Feb 05, 2009 10:51 am Post subject: |
|
|
Yeah It is compiled and in production..
Thanks
Nadh |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Thu Feb 05, 2009 10:53 am Post subject: |
|
|
then what is your question? _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Sat Feb 07, 2009 1:56 am Post subject: |
|
|
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 |
|
 |
haatvedt Beginner
Joined: 14 Nov 2003 Posts: 66 Topics: 0 Location: St Cloud, Minnesota USA
|
Posted: Sat Feb 14, 2009 2:42 pm Post subject: |
|
|
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 |
|
 |
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Sun Feb 15, 2009 11:53 am Post subject: |
|
|
A binary search (SEARCH ALL) would not be allowed in this case since there is no INDEXED BY clause present. _________________ ....Terry |
|
Back to top |
|
 |
|
|