RE: [U2] Unidata TCL - beginner question
Bruce, There has been several responses, but I don't think you have an answer yet, do you? I haven't followed the closely & don't have the original problem, and it is unclear to me whether you have multi- or single-valued date/part data. At any rate, you'll need to make 2 passes on the file, the first to sort, and the 2nd to grab only the oldest (or was it youngest?) date for each part. If mv, you're going to have to get the BP-EXP keyword in there. If UV, I know how I would do it, but I don't think my method would work in UD, iirc. On UD can you use SQL SELECT to accomplish the task? For maintainability's sake, and given how difficult it has been for this list to supply an answer (which may indicate that some arbitrary future maintenance programmer may also have difficulty understanding your eventual answer), you might want to do the selection in a basic program, where it would be fairly straightforward. cds > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Bruce Ordway > Sent: Friday, October 07, 2005 1:11 PM > To: 'u2-users@listserver.u2ug.org' > Subject: RE: [U2] Unidata TCL - beginner question > > >SORT filename BY Part BY Date @ID BREAK.ON Part Date DET.SUP< > BTW, I thought this worked to begin with. > Then, I started noticing it wasn't really. > I keep getting dates in the middle of the range for some parts. > Just so happens I'm working on a huge file, 886817 records. > I wonder if Unidata SORT's break down if a file is too big or > sized incorrectly? > --- > 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
See UDT.OPTIONS 43. The udto.pdf explains what this is doing. The file isn't too large - UniData just doesn't like displaying valid values in a detail suppress report that you don't break-on. hth Colin Alfke Calgary Canada From: Bruce Ordway >SORT filename BY Part BY Date @ID BREAK.ON Part Date DET.SUP< BTW, I thought this worked to begin with. Then, I started noticing it wasn't really. I keep getting dates in the middle of the range for some parts. Just so happens I'm working on a huge file, 886817 records. I wonder if Unidata SORT's break down if a file is too big or sized incorrectly? [demime 1.01d removed an attachment of type application/ms-tnef which had a name of winmail.dat] --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Unidata TCL - beginner question
Never seen a single burp in sorting ever. If you just eliminate the DET.SUP you'll see the detail, and can then compare to the DET.SUP errors to confirm if the sorting is wrong, or if maybe it just doesn't work. You could always fall back and punt by completing the messing sections of the program I sent yesterday. I'm sure that would work. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Bruce Ordway Sent: Friday, October 07, 2005 13:11 To: 'u2-users@listserver.u2ug.org' Subject: RE: [U2] Unidata TCL - beginner question >SORT filename BY Part BY Date @ID BREAK.ON Part Date DET.SUP< BTW, I thought this worked to begin with. Then, I started noticing it wasn't really. I keep getting dates in the middle of the range for some parts. Just so happens I'm working on a huge file, 886817 records. I wonder if Unidata SORT's break down if a file is too big or sized incorrectly? --- 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
>SORT filename BY Part BY Date @ID BREAK.ON Part Date DET.SUP< BTW, I thought this worked to begin with. Then, I started noticing it wasn't really. I keep getting dates in the middle of the range for some parts. Just so happens I'm working on a huge file, 886817 records. I wonder if Unidata SORT's break down if a file is too big or sized incorrectly? --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Unidata TCL - beginner question
>What you are looking for is the MAX verb. You would use it thus:< >LIST file.name PART MAX DATE DET.SUP< I'm on HPUX 11 & Unidata 5.2. There doesn't seem to be a MAX available. However, I do see a basic function called MAXIMUM(). I wonder if I could create a Virtual field using this to give me the last date? --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Unidata TCL - beginner question - correction
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
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
What you are looking for is the MAX verb. You would use it thus: LIST file.name 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 01:45:56 PM: > Hi, > I ran into yet another beginners TCL puzzle today. > Is there a way to use TCL and return only latest record? > i.e. I have 4 records > @ID Part Date > 1234 1589 12/2/04 > 1235 1589 11/6/03 > 1236 1589 10/1/05 > 1249 1589 10/2/05 > I only want to see 1249 1589 dated 10/2/05. > Thanks, > 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
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/
RE: [U2] Unidata TCL - beginner question
Try something like... LIST FILE.NAME WITH DATE LIKE "10/2..." Do a LIST DICT FILE.NAME for clarification. --Bill -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Bruce Ordway Sent: Thursday, October 06, 2005 1:46 PM To: 'u2-users@listserver.u2ug.org' Subject: [U2] Unidata TCL - beginner question Hi, I ran into yet another beginners TCL puzzle today. Is there a way to use TCL and return only latest record? i.e. I have 4 records @ID Part Date 1234 1589 12/2/04 1235 1589 11/6/03 1236 1589 10/1/05 1249 1589 10/2/05 I only want to see 1249 1589 dated 10/2/05. Thanks, 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
Try: SORT filename BY Part BY Date @ID BREAK.ON Part Date DET.SUP If you have two records with the same date for the same part, SORT automatically sorts by @ID as the last sort criteria. Tim Bryant ERP Support Manager CardioDynamics Int'l Corp 800.778.4825, Ext. 1087 858.535.0202 Ext. 1087 fax: 800.856.3038 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bruce Ordway Sent: Thursday, October 06, 2005 10:46 AM To: 'u2-users@listserver.u2ug.org' Subject: [U2] Unidata TCL - beginner question Hi, I ran into yet another beginners TCL puzzle today. Is there a way to use TCL and return only latest record? i.e. I have 4 records @ID Part Date 1234 1589 12/2/04 1235 1589 11/6/03 1236 1589 10/1/05 1249 1589 10/2/05 I only want to see 1249 1589 dated 10/2/05. Thanks, 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
I got this answer from another user group. Never noticed BREAK-ON combined with DET-SUPP does exactly what I wanted. LIST FILE @ID BREAK-ON PART DATE DET-SUPP --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Unidata TCL - beginner question
I thought of that too - tried it here - doesn't work. UDT.Options are tricky though - there's probably something in there that's causing it to not work. An example of a funky UD thing that doesn't have anything to do with the current question: I had an array of amounts like this: 143]285]1093]6354 And I was doing a locate by "AR" to insert the amounts. My next amount was a negative number and it put it right in the middle of the array - I was like "WHAT?". One of the UDT.Options specifies whether locate will sort in ASCII or numeric order - I couldn't believe it - Isnt that what the "BY" clause in the LOCATE is for (how you want to sort)? UV doesn't work this way. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of George Gallen Sent: Thursday, October 06, 2005 2:10 PM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Unidata TCL - beginner question What about using BY.DSND Date SAMPLE 1 That should give you the "last" one Assuming Unidata has SAMPLE George -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Bruce Ordway Sent: Thursday, October 06, 2005 1:46 PM To: 'u2-users@listserver.u2ug.org' Subject: [U2] Unidata TCL - beginner question Hi, I ran into yet another beginners TCL puzzle today. Is there a way to use TCL and return only latest record? i.e. I have 4 records @ID Part Date 1234 1589 12/2/04 1235 1589 11/6/03 1236 1589 10/1/05 1249 1589 10/2/05 I only want to see 1249 1589 dated 10/2/05. Thanks, 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/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Unidata TCL - beginner question
How about: :SELECT FILE.NAME BY.DSND DATE >LIST FILE.NAME PART DATE FIRST 1 Thank you, David A. Green DAG Consulting (480) 813-1725 www.dagconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bruce Ordway Sent: Thursday, October 06, 2005 10:46 AM To: 'u2-users@listserver.u2ug.org' Subject: [U2] Unidata TCL - beginner question Hi, I ran into yet another beginners TCL puzzle today. Is there a way to use TCL and return only latest record? i.e. I have 4 records @ID Part Date 1234 1589 12/2/04 1235 1589 11/6/03 1236 1589 10/1/05 1249 1589 10/2/05 I only want to see 1249 1589 dated 10/2/05. Thanks, 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
Darn it, I just realized my 1st correction was also wrong. I showed duplicate ID's. Here's the 2nd correction:So here is my revised 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 1221 1590 12/6/04 1222 1590 11/5/01 1223 1590 1/10/05 1224 1590 2/23/05 *** I only want to see: 1249 1589 10/2/05 1224 1590 2/23/05 Thanks, 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
> You can use : > > SORT filename BY PART BY.DSND DATE BY BREAK.ON PART > > And that will at least bring them up sorted by part with the latest date > at > the top of the stack. Other than that you would need to know the date and > qualify by date range. Interesting side-note: On uniVerse, if you LIST DIST.FILE you get a listing by PART. If you know how the items are distributed to each partfile, you can verify this easilly, especially on small distributed files. Karl > > > hth, > > Allen > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Bruce Ordway > Sent: Thursday, October 06, 2005 10:46 > To: 'u2-users@listserver.u2ug.org' > Subject: [U2] Unidata TCL - beginner question > > > Hi, > > I ran into yet another beginners TCL puzzle today. > Is there a way to use TCL and return only latest record? > > i.e. I have 4 records > > @ID Part Date > 1234 1589 12/2/04 > 1235 1589 11/6/03 > 1236 1589 10/1/05 > 1249 1589 10/2/05 > > I only want to see 1249 1589 dated 10/2/05. > > Thanks, > > 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/ > -- karl _/ _/ _/ _/_/_/ __o _/ _/ _/ _/_/ _-\<._ _/_/_/ _/_/_/ (_)/ (_) _/ _/ _/ _/ .. _/ _/ arl _/_/_/ _/ earson[EMAIL PROTECTED] -- IT Director, ATS Industrial Supply, Inc. http://www.atsindustrial.com Toll-free: 800-789-9300 x29 Direct2Desk: 801-978-4429 Facsimile: 801-972-3888 -- --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Unidata TCL - beginner question
Looks like on UV, you have to split up the BY.DSND and the SAMPLE. SELECT BY.DSND Date SELECT SAMPLE 1 Otherwise it picks a random sample, then does the by.dsnd on it. seems SAMPLE has a higher priority of execution than BY.DSND... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of George Gallen Sent: Thursday, October 06, 2005 2:10 PM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Unidata TCL - beginner question What about using BY.DSND Date SAMPLE 1 That should give you the "last" one Assuming Unidata has SAMPLE George --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Unidata TCL - beginner question
You can use : SORT filename BY PART BY.DSND DATE BY BREAK.ON PART And that will at least bring them up sorted by part with the latest date at the top of the stack. Other than that you would need to know the date and qualify by date range. hth, Allen -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Bruce Ordway Sent: Thursday, October 06, 2005 10:46 To: 'u2-users@listserver.u2ug.org' Subject: [U2] Unidata TCL - beginner question Hi, I ran into yet another beginners TCL puzzle today. Is there a way to use TCL and return only latest record? i.e. I have 4 records @ID Part Date 1234 1589 12/2/04 1235 1589 11/6/03 1236 1589 10/1/05 1249 1589 10/2/05 I only want to see 1249 1589 dated 10/2/05. Thanks, 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
What about using BY.DSND Date SAMPLE 1 That should give you the "last" one Assuming Unidata has SAMPLE George -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Bruce Ordway Sent: Thursday, October 06, 2005 1:46 PM To: 'u2-users@listserver.u2ug.org' Subject: [U2] Unidata TCL - beginner question Hi, I ran into yet another beginners TCL puzzle today. Is there a way to use TCL and return only latest record? i.e. I have 4 records @ID Part Date 1234 1589 12/2/04 1235 1589 11/6/03 1236 1589 10/1/05 1249 1589 10/2/05 I only want to see 1249 1589 dated 10/2/05. Thanks, 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/