The reason that the following line does not work is this:

LOCATE V.DATES IN X.DATE.LIST<1,1> BY "AR" SETTING LOC ELSE

You are telling it to locate V.DATES in X.DATE.LIST attribute 1, multivalue 1,
but you are doing your insert in multivalue 2 then multivalue 3.  If you switch
your code to what Roger suggests you will be looking in only attribute 1.  This
is the correct way to do this.  In Rogers example, the first locate looks for
13219 in X.DATE.LIST<1,1,1>.  It is actually looking for the subvalue it belongs
in.  When you do the second locate, LOC gets set to 2 because X.DATE.LIST<1,1,1>
has a value of 13219 which is less than 13223.  The INS statement then says put
13223 before X.DATE.LIST<1,2> even though we were actually looking in
X.DATE.LIST<1,1,2>.  Then when you do the locate the third time it does the same
thing.  It looks in X.DATE.LIST<1,1> at the first subvalue, which has a value of
13219 and sets LOC to 2.  When you do an INS before X.DATE.LIST<1,2> it puts the
13224 before the 13223.



Nick Cipollina
Systems Analyst
SuperValu Eastern Region
(804)746-6068
[EMAIL PROTECTED]


                                                                                       
                                                
                      Roger Glenfield                                                  
                                                
                      <[EMAIL PROTECTED]        To:       U2 Users Discussion List 
<[EMAIL PROTECTED]>                                
                      ne.net>                  cc:                                     
                                                
                      Sent by:                 Subject:  RE: LOCATE Command - Help :(  
                                                
                      u2-users-bounces@                                                
                                                
                      oliver.com                                                       
                                                
                                                                                       
                                                
                                                                                       
                                                
                      03/19/2004 11:57                                                 
                                                
                      PM                                                               
                                                
                      Please respond to                                                
                                                
                      U2 Users                                                         
                                                
                      Discussion List                                                  
                                                
                                                                                       
                                                
                                                                                       
                                                




Suggestion in place.

I didn't look/test the second locate.  But you'll probably have the same
problem.

Hope this helps.

Roger Glenfield

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Kate
> Sent: Friday, March 19, 2004 10:42 PM
> To: U2 Users Discussion List
> 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
try
  LOCATE V.DATES IN X.DATE.LIST<1> BY "AR" SETTING LOC ELSE
---on Pick flavor at least, your code doesn't work
--I feed the code this sequence of dates, 13219, 13224, 13223 and they don't
come out 'ar' sequenced.
--switch to my code and I then get 13219, 13223, 13224

> 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
>
>


--
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