|
Pat, Partial jdiag info: System : AIX junior 3.5 000177514C00 OS Release : 5.3.0.0 RELEASE Information : Major 3.4 , Minor 8 , Patch 0351 Spooler dir (JBCSPOOLERDIR) : '/usr/jspooler' JBCEMULATE : 'UNIVERSE' I just did a test with this I-type: DICT JUNK.CWN.1 TEST.1 001: I 002: 1 + 2 003: 004: Test 005: 4R 006: S LIST JUNK.CWN.1 *A1 *A2 TEST.1 JUNK.CWN.1.......... *A1................. *A2................. Test 5-70517*197909*5 14723 14723 3 23-TR506*494827*23 14936 14936 3 3-BC302*200782*3 14873 14873 3 The 1 and 2 are definitely being interpreted as literals here and not as attributes. I believe the emulation would have a lot to do with that. You're the one who left out DCOUNT? In the immortal words of Jim: "You're fired - again!" ;-) Charlie pat wrote, On 05/06/2009 10:53 AM: Au contraire Charlie, The unquoted numeric literal is used as an Attribute reference in everything but ... '@RECORD', where jBASE 3.4 is intelligent enough to know that the numeric value inside '< >' is a number, and not an attribute referenceBut yes, the 'COUNT + 1' will be incorrect for Null attributes, so apologies for that And apologies for not implementing 'DCOUNT' which would have made life simpler *** Ian, I-types are equivalent to the V types used in your previous 'life' before jBASE ;-) [ jBASE 3.4 also has 'D' types ala the 'D' types from your previous incarnation ] I types are originally from Prime I believe Pat. On 6 May, 13:33, Charlie Noah <[email protected]> wrote:Pat, I-Type dict items generally don't perform as efficiently in Jbase as 10-line Pick types. I am basing this on experience with Jbase 3.4.x. Things may be different with 4.x If either will do the job, do a timing test to determine which is faster, especially if it will be used a lot. BTW, in your mvcnt example below, the result will be incorrect if the attribute is null. COUNT(@RECORD<1>, @VM) + (@RECORD<1> # '') or IF @RECORD<1> # '' THEN COUNT(@RECORD<1>, @VM) + 1 ELSE 0 (or '' if you prefer). will return the correct result. It's a pity DCOUNT() doesn't work, although, again, I'm referring to 3.4.x. Also, in your example, you are using 1 as an attribute reference first, and as a literal second. Depending on your emulation, it will either be one or the other. Regards, Charlie Noah Inland Truck Parts Company pat wrote, On 05/05/2009 05:16 PM:Why restrict yourself to 10 line DICTionary items ? Try the additional features provided by I types DICT file mv2_of_Attr1 Last_mv_of_Attr1 mvcnt mv2_of_Attr1 001 I 002 @RECORD<1,2> 003 004 2nd Value in Attribute 1 005 10L Last_mv_of_Attr1 001 I 002 FIELD(1,@VM,mvcnt) 003 004 Last value in Attribute 1 005 10L mvcnt 001 I 002 COUNT(1,@VM)+1 003 004 Number of values in Attribute 1 005 5R LIST file mv2_of_Attr1 Last_mv_of_Attr1 should give you : 'dave' and 'chris' respectively, based on your data below, Pat. On 5 May, 11:13, inavran<[email protected]>wrote:Hi, I was wondering if anyone knew the correct syntax for extracting the 'last multi-value' from a field using a 10 line dictionary items eg record (3 attributes with 4 multi-values on each line) 001:john]dave]simon]chris 002:blue]red]yellow]green 003:30]25]42]50 i would want to extract just "chris" from attribute 1. (being the last MV) also, i would be curious how to extract a specific other multi value as well (eg "dave" (MV 2) at present i am doing this using a subroutine CALL within the DICT, which is very slow (as you would expect), so i am keen to get a better solution in place. I am using jBASE 3.4.x on Windows 2003 Many thanks in advance. Ian --~--~---------~--~----~------------~-------~--~----~ Please read the posting guidelines at: http://groups.google.com/group/jBASE/web/Posting%20Guidelines IMPORTANT: Type T24: at the start of the subject line for questions specific to Globus/T24
To post, send email to [email protected]
|
- DICT question inavran
- Re: DICT question pat
- Re: DICT question inavran
- Re: DICT question Charlie Noah
- Re: DICT question pat
- Re: DICT question Charlie Noah
- Re: DICT question Daniel Klein
- RE: DICT question Tony G
- Re: DICT question Abi Nanthan
- Re: DICT question Richard Kann
- Re: DICT question Daniel Klein
