RE: [U2] Unidata TCL - beginner question - correction

2005-10-06 Thread Richard Taylor
It looks like date and part are multi-valued.  You can create a dictionary
that takes the MAX on the date field.  Sort my descending and use SAMPLE 1
as others have indicated.  This should give you just the ID of 1249.

You can also defined this new data reference on-the-fly in the retrieve
statement so you would not need the dictionary.  This should be documented
in the UV Reference manual.

One other thought on this, you can use SQL statements in UV.  This works
fairly well if you are using standard SQL.

Rich Taylor | Senior Programmer/Analyst| VERTIS
250 W. Pratt Street | Baltimore, MD 21201
P 410.361.8688 | F 410.528.0319 
[EMAIL PROTECTED] | http://www.vertisinc.com
 
Vertis is the premier provider of targeted advertising, media, and
marketing services that drive consumers to marketers more effectively.
 
"The more they complicate the plumbing
  the easier it is to stop up the drain"
 
- Montgomery Scott NCC-1701

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:owner-u2-
> [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
> Sent: Thursday, October 06, 2005 2:03 PM
> To: 'u2-users@listserver.u2ug.org'
> Subject: [U2] Unidata TCL - beginner question - correction
> 
> Sorry,
> My first post on this had an example that was a little ambiguous.
> Not looking for GE or >=
> 
> Here is a more complete example
> *
> i.e. I have 8 records
> @ID Part Date
> 1234 1589 12/2/04
> 1235 1589 11/6/03
> 1236 1589 10/1/05
> 1249 1589 10/2/05
> 1234 1590 12/6/04
> 1235 1590 11/5/01
> 1236 1590 1/10/05
> 1249 1590 2/23/05
> ***
> I only want to see:
> 1249 1589 10/2/05
> 1249 1590 2/23/05
> 
> Can this be done with TCL?
> I'm asking because I can do this in an Access query with MAX.
> Hoping TCL can do the same as it would save me a lot of trouble.
> 
> If not TCL, then how about in a program?
> 
> Thanks again,
> 
> Bruce Ordway
> Viking Engineering
> 763-586-1228
> [EMAIL PROTECTED]
> ---
> 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/


Re: [U2] Unidata TCL - beginner question - correction

2005-10-06 Thread Gordon J Glorfield
Ok.  In that case do it thusly:

LIST file.name BY PART PART MAX DATE DET.SUP


Gordon J. Glorfield
Sr. Applications Developer
MAMSI (A UnitedHealth Company)
301-360-8839

[EMAIL PROTECTED] wrote on 10/06/2005 02:03:12 PM:

> Sorry,
> My first post on this had an example that was a little ambiguous.
> Not looking for GE or >=

> Here is a more complete example
> *
> i.e. I have 8 records
> @ID Part Date
> 1234 1589 12/2/04
> 1235 1589 11/6/03
> 1236 1589 10/1/05
> 1249 1589 10/2/05
> 1234 1590 12/6/04
> 1235 1590 11/5/01
> 1236 1590 1/10/05
> 1249 1590 2/23/05
> ***
> I only want to see:
> 1249 1589 10/2/05
> 1249 1590 2/23/05

> Can this be done with TCL?
> I'm asking because I can do this in an Access query with MAX.
> Hoping TCL can do the same as it would save me a lot of trouble.

> If not TCL, then how about in a program?

> Thanks again,

> Bruce Ordway
> Viking Engineering
> 763-586-1228
> [EMAIL PROTECTED]
> ---
> u2-users mailing list
> u2-users@listserver.u2ug.org
> To unsubscribe please visit http://listserver.u2ug.org/


This e-mail, including attachments, may include confidential and/or 
proprietary information, and may be used only by the person or entity to 
which it is addressed. If the reader of this e-mail is not the intended 
recipient or his or her authorized agent, the reader is hereby notified 
that any dissemination, distribution or copying of this e-mail is 
prohibited. If you have received this e-mail in error, please notify the 
sender by replying to this message and delete this e-mail immediately.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Unidata TCL - beginner question - correction

2005-10-06 Thread Allen E. Elwood
I think you're looking at a program now.


PERFORM 'SELECT FILENAME BY PART BY.DSND DATE'
FIRST = 1
LOOP WHILE READNEXT ID DO
  GOSUB READ.RECORD
  IF ID = PREVIOUS.ID THEN CONTINUE
  GOSUB OUTPUT.THIS.OLDEST.RECORD
  PREVIOUS.ID = ID
REPEAT
STOP
READ.RECORD:
  READ REC FROM FILENAME, ID ELSE {whatever you want for an error}
  IF FIRST THEN
FIRST = ""
PREVIOUS.ID = ID
GOSUB OUTPUT.THIS.OLDEST.RECORD
  END
RETURN
OUTPUT.THIS.OLDEST.RECORD
  **parse the date and output**
RETURN  
  
Something like the above NOT-DEBUGGED psudo program should work nicely.

hth,

Allen


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Bruce Ordway
Sent: Thursday, October 06, 2005 11:03
To: 'u2-users@listserver.u2ug.org'
Subject: [U2] Unidata TCL - beginner question - correction


Sorry,
My first post on this had an example that was a little ambiguous.
Not looking for GE or >=

Here is a more complete example
*
i.e. I have 8 records
@ID Part Date
1234 1589 12/2/04
1235 1589 11/6/03
1236 1589 10/1/05
1249 1589 10/2/05 
1234 1590 12/6/04
1235 1590 11/5/01
1236 1590 1/10/05
1249 1590 2/23/05 
***
I only want to see:
1249 1589 10/2/05
1249 1590 2/23/05

Can this be done with TCL?
I'm asking because I can do this in an Access query with MAX.
Hoping TCL can do the same as it would save me a lot of trouble.

If not TCL, then how about in a program?

Thanks again,

Bruce Ordway
Viking Engineering
763-586-1228
[EMAIL PROTECTED] 
---
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/