This is a similar issue with the LOCATE and understanding what level it's
trying to locate in.

For example, let's say you just read in a REC that has attributes, values
and sub values.

If one of the attributes may contain the value "FRED" then the reference for
REC would be:

LOCATE "FRED" IN REC SETTING POS...

and POS would be the attribute FRED was in. Notice REC is alone without any
<>.

If attribute 5 could have a whole value of TOM, then the reference would be:

LOCATE "TOM" IN REC<5> SETTING POS.

and POS would be the value TOM was in.

If a rare circumstance has "BILL" in a value in REC<7,10>, then it's
LOCATE "BILL" IN REC<7,10> SETTING POS
and POS would be the subvalue BILL was in.

Basically it's one level up.

If you READV A5 and are LOCATING for a simple multi-value of "SUE", then you
use

LOCATE "SUE" IN A5<1> SETTING POS
not
LOCATE "SUE" IN A5 SETTING POS

Reason: The LOCATE doesn't know that A5 was the result of a READV. It very
well could be the start of something attributed later but now just has a lot
of multi-values in attribute 1.

my 3 cents.
----- Original Message -----
From: "Kate" <[EMAIL PROTECTED]>
To: "U2 Users Discussion List" <[EMAIL PROTECTED]>
Sent: Friday, March 19, 2004 10:42 PM
Subject: LOCATE Command - Help :(


> Hi!
>
> I am trying to accomplish the following
>
> 1) Build a header for all possible dates for a person with certain data in
it.  e.g.  one person might have 3 dates where they had activity but another
person might have 5 dates with activity, but I want the header to have all
possible dates with activity.  So the Header Date variable contains all
possible dates.  And that prints fine.
>
> LOCATE V.DATES IN X.DATE.LIST<1,1> BY "AR" SETTING LOC ELSE
> INS V.DATES BEFORE X.DATE.LIST<1,LOC>
> END
>
> But then for each person, I want to have the values print under the
correct date headings.  And it changes for each page.
>
> 2)  For each record:
>      a)  obtain the # of dates and print the values to print under the
correct dates for each person
>
> LOCATE X.AB.DATE IN X.DATE.LIST<1,1> BY "AR" SETTING POS THEN
> IF VALUE = 'B' THEN
> X.AB.PRINT<1,POS> = TRIM(X.AB.TYPE)
> END
> END
>
> Then I remove the @VM's and print X.AB.PRINT.  It prints the values but
all in one sequence.  Not in the proper position.
>
> Can anyone tell me what I am doing wrong?
>
> Thanks for any help you can pass my way.
>
> Kate
>
>
>
>
> --
> u2-users mailing list
> [EMAIL PROTECTED]
> http://www.oliver.com/mailman/listinfo/u2-users

-- 
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users

Reply via email to