× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 2021-03-26 3:07 p.m., Gary Kuznitz wrote:
I'm trying to create an alternating table.
The code I have is:
D ZipCodes S 7 DIM(222) CTDATA
PERRCD(1)
D County S 1 DIM(222) ALT(ZipCodes)

C AIAOTX Lookup ZipCodes County
30

*RNF5158 30 010500 Result-Field operand must
not be array name for specified operation.

You're actually creating an alternating -array-, not a -table-. To define a table, the name has to start with "TAB". If you change the names to say tabZipCodes and tabCounty, your code will work.

If factor 2 is an ordinary array, not starting with TAB", you can't put anything in the result field.

The LOOKUP opcode is really weird for arrays. It actually updates the index for the factor 2 array.

D ZipCodes S 7 DIM(2) CTDATA PERRCD(1)
D County S 1 DIM(2) ALT(ZipCodes)
D i S 10i 0

C eval i = 1
C '7654321' Lookup ZipCodes(i) 30
C return

My ctdata:
**
1234567A
7654321B

After the Lookup operation, i is 2.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.