View previous topic :: View next topic |
Author |
Message |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Mon Mar 13, 2006 10:39 am Post subject: |
|
|
treks02,
Some of the older compilers may not allow look up on multiple fields. Try this code. Hopefully it should solve the error.
Code: |
01 MY-TABLE.
03 ELEMENT-LIST OCCURS 0 TO 20000,
DEPENDING ON REC-LENGTH
ASCENDING KEY IS TABLE-LOOKUP-KEY
INDEXED BY IDX.
05 TABLE-LOOKUP-KEY.
10 ELEMENT-1 PIC X(2).
10 ELEMENT-2 PIC X(2).
10 ELEMENT-3 PIC X(2).
05 ELEMENT-4 PIC X(2).
05 ELEMENT-5 PIC X(1).
05 ELEMENT-6 PIC X(15).
05 ELEMENT-7 PIC X(2).
05 ELEMENT-8 PIC X(1).
05 ELEMENT-9 PIC X(15).
SEARCH ALL ELEMENT-LIST
AT END
SET NO-REC-FOUND TO TRUE
WHEN TABLE-LOOKUP-KEY(IDX) = 'XXYYZZ'
MOVE ELEMENT-1(IDX) TO WV-TEMP-VAR1
MOVE ELEMENT-2(IDX) TO WV-TEMP-VAR2
MOVE ELEMENT-3(IDX) TO WV-TEMP-VAR3
END-SEARCH.
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
treks02 Beginner
Joined: 08 Mar 2006 Posts: 15 Topics: 3
|
Posted: Mon Mar 13, 2006 10:35 pm Post subject: |
|
|
hi kolusu,
thanks for the help, i now have only 1 severe error.
Code: |
IGYPS2213-S "NO-REC-FOUND" was reference modified and reference modification is not allowed in this context. The statement was discarded.
|
what could this be? |
|
Back to top |
|
 |
treks02 Beginner
Joined: 08 Mar 2006 Posts: 15 Topics: 3
|
Posted: Mon Mar 13, 2006 11:01 pm Post subject: |
|
|
hi again,
i saw this in the internet:
http://docs.hp.com/en/65/books/emsynt.htm
Quote: |
0366 Variable length delimiter not allowed
You cannot use a reference modified item or a group containing an OCCURS ... DEPENDING ON clause in this context.
Replace the reference modified item, or specify a valid item in the OCCURS DEPENDING ON clause.
|
could this be the problem? |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Tue Mar 14, 2006 8:55 am Post subject: |
|
|
treks02,
How is NO-REC-FOUND defined? Also what version of cobol are you using? you can find that as the first line of your compile listing.
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
treks02 Beginner
Joined: 08 Mar 2006 Posts: 15 Topics: 3
|
Posted: Tue Mar 14, 2006 11:59 pm Post subject: |
|
|
kolusu wrote: | treks02,
How is NO-REC-FOUND defined? Also what version of cobol are you using? you can find that as the first line of your compile listing.
Kolusu |
88 NO-REC-FOUND PIC X
PP 5655-G53 IBM Enterprise COBOL for z/OS and OS/390 3.2.1
I think this causes the problem... |
|
Back to top |
|
 |
Cogito-Ergo-Sum Advanced
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
|
Posted: Wed Mar 15, 2006 4:00 am Post subject: |
|
|
Are you sure your error message is pointing to the line in SEARCH statement ?
Anyway, code 88 conditions as follows:
Code: |
05 W000-Flg-Valid Pic X(01) .
88 88-Valid-Pass Value 'Y' .
88 88-Valid-Fail Value 'N' .
|
_________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes. |
|
Back to top |
|
 |
treks02 Beginner
Joined: 08 Mar 2006 Posts: 15 Topics: 3
|
Posted: Wed Mar 15, 2006 6:59 am Post subject: |
|
|
Cogito-Ergo-Sum wrote: | Are you sure your error message is pointing to the line in SEARCH statement ?
Anyway, code 88 conditions as follows:
Code: |
05 W000-Flg-Valid Pic X(01) .
88 88-Valid-Pass Value 'Y' .
88 88-Valid-Fail Value 'N' .
|
|
hi Cogito-Ergo-Sum,
sori that was a typo error
I have coded NO-REC-FOUND the same way as you did.
Code: |
05 WF-REC-FLG Pic X(01) .
88 REC-FOUND Value 'Y' .
88 NO-REC-FOUND Value 'N' .
|
I dont know what could be the reason but wheN i tried to use
Code: |
MOVE 'N' TO WF-REC-FLG
|
THE ERROR DISAPPEARED. THANKS! |
|
Back to top |
|
 |
vak255 Intermediate

Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Thu Jul 27, 2006 6:31 am Post subject: |
|
|
I have a table with < 100 records.
Which Search method will be better. SEARCH or SEARCH ALL.
whats the criteria to decide SEARCH/SEARCH ALL.
pls let me know if u have any links for it. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Thu Jul 27, 2006 9:59 am Post subject: |
|
|
vak255 wrote: | I have a table with < 100 records.
Which Search method will be better. SEARCH or SEARCH ALL.
whats the criteria to decide SEARCH/SEARCH ALL.
pls let me know if u have any links for it. |
For a table of that size , It does NOT make any difference. SEARCH , PERFORM VARYING and SEARCH ALL will be the same for small tables. SEARCH ALL is effective for large tables (atleast 5k ) to notice any difference in the performance.
For large SORTED tables SEARCH ALL will be better. For such tables using a binary search (SEARCH ALL) can be 18% faster than using a sequential search (SEARCH)
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
|
|