Jerry:

I hate to mention the obvious, but one should not equate anything unless they 
intend
both sides of the equate to change when either variable changes.  For instance,

DIM MYREC(30)
EQUATE MYREC.DATE TO MYREC(1)
EQUATE MYREC.NAME TO MYREC(2)
--etc--

Thus, whenever MYREC changes, due to a new record read, so does MYREC.DATE, etc.
Alternatively, you simply have to alter MYREC.DATE to make sure the MYREC 
record has
been changed too.  To fix the problems you've encountered try:

VALID.CC.TYPES = 'A':@VM:'B':@VM:'D':@VM:'M':@VM:'S':@VM:'V'
VALID.CC.NAMES = 'American Express':@VM:'Carte Blanche':@VM:'Diners
Club':@VM:'Mastercard':@VM:'Discover':@VM:'Visa'

VALID.CC.TYPES2 = 'A]B]D]M]S]V'
VALID.CC.NAMES2 = 'American Express]Carte Blanche]Diners
Club]Mastercard]Discover]Visa'

...the output looks like:

3 Dev (0)-> RUN DTABP TEST
Equate with @VM: A2B2D2M2S2V
Equate with @VM: American Express2Carte Blanche2Diners 
Club2Mastercard2Discover2V
isa

Equate with `253: A2B2D2M2S2V
Equate with `253: American Express2Carte Blanche2Diners 
Club2Mastercard2Discover2
Visa

Account type: A

FIRST WAY
Account name: American Express
Position: 1

SECOND WAY
Account name: American Express
Position: 1

THIRD WAY
Account name: American Express
Position: 1

FOURTH WAY
Account name: American Express
Position: 1

In all the years I've been doing this I've never run into these kinds of 
problems
because I follow the basic guideline noted.  So, use an equate if both sides can
change.  If that's not what you want make a simple assignment.  There is no 
reason,
with today's machines, to create more complexity of syntax in order to 
accomplish
this simple task.

Just my $.02  :-)

Bill

>-----Original Message-----
>From: [EMAIL PROTECTED] 
>[mailto:[EMAIL PROTECTED] On Behalf Of Jerry Banker
>Sent: Tuesday, October 23, 2007 7:06 AM
>To: u2-users@listserver.u2ug.org
>Subject: RE: [U2] curious EQUATE issue - SOLVED Just want to 
>know if anyone understands WHY?
>
>We are running in Reality flavor on UniVerse 10.2.4 and Red 
>Hat Linux AS3. Here is a test of the code using the two forms 
>of LOCATE:
>
>      EQU VALID.CC.TYPES TO 'A':@VM:'B':@VM:'D':@VM:'M':@VM:'S':@VM:'V'
>      EQU VALID.CC.NAMES TO 'American Express':@VM:'Carte 
>Blanche':@VM:'Diners Club':@VM:'Mastercard':@VM:'Discover':@VM:'Visa'
>
>      EQU VALID.CC.TYPES2 TO 'A]B]D]M]S]V'
>      EQU VALID.CC.NAMES2 TO 'American Express]Carte 
>Blanche]Diners Club]Mastercard]Discover]Visa'
>
>      CC.ACCT.TYPE = 'A'
>
>      CRT 'Equate with @VM: ':VALID.CC.TYPES
>      CRT 'Equate with @VM: ':VALID.CC.NAMES
>      CRT
>      CRT 'Equate with `253: ':VALID.CC.TYPES2
>      CRT 'Equate with `253: ':VALID.CC.NAMES2
>      CRT
>      CRT 'Account type: ':CC.ACCT.TYPE
>      CRT
>      CRT 'FIRST WAY'
>      LOCATE(CC.ACCT.TYPE, VALID.CC.TYPES, 1 ; CC.PTR) THEN
>         CRT 'Account name: ':VALID.CC.NAMES<1,CC.PTR>
>      END ELSE
>         CRT 'Account name: NOT FOUND'
>      END
>      CRT 'Position: ':CC.PTR
>      CRT
>      CRT 'SECOND WAY'
>      LOCATE CC.ACCT.TYPE IN VALID.CC.TYPES<1> SETTING CC.PTR THEN
>         CRT 'Account name: ':VALID.CC.NAMES<1,CC.PTR>
>      END ELSE
>         CRT 'Account name: NOT FOUND'
>      END
>      CRT 'Position: ':CC.PTR
>      CRT
>      CRT 'THIRD WAY'
>      LOCATE(CC.ACCT.TYPE, VALID.CC.TYPES2, 1 ; CC.PTR) THEN
>         CRT 'Account name: ':VALID.CC.NAMES2<1,CC.PTR>
>      END ELSE
>         CRT 'Account name: NOT FOUND'
>      END
>      CRT 'Position: ':CC.PTR
>      CRT
>      CRT 'FOURTH WAY'
>      LOCATE CC.ACCT.TYPE IN VALID.CC.TYPES2<1> SETTING CC.PTR THEN
>         CRT 'Account name: ':VALID.CC.NAMES2<1,CC.PTR>
>      END ELSE
>         CRT 'Account name: NOT FOUND'
>      END
>      CRT 'Position: ':CC.PTR
>
>      END
>
>And here are the results when you run the test program.
>
>Equate with @VM: A}B}D}M}S}V
>Equate with @VM: American Express}Carte Blanche}Diners 
>Club}Mastercard}Discover}Visa
>
>Equate with `253: A}B}D}M}S}V
>Equate with `253: American Express}Carte Blanche}Diners 
>Club}Mastercard}Discover}Visa
>
>Account type: A
>
>FIRST WAY
>Account name: American Express}Carte Blanche}Diners 
>Club}Mastercard}Discover}Visa
>Position: 1
>
>SECOND WAY
>Account name: NOT FOUND
>Position: 2
>
>THIRD WAY
>Account name: American Express
>Position: 1
>
>FOURTH WAY
>Account name: American Express
>Position: 1
>-------
>u2-users mailing list
>u2-users@listserver.u2ug.org
>To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to