[U2] Indexes

2008-03-14 Thread Dennis Bartlett
My dumb question for the day (just cant remember how to... and the manual's
example is too simplistic...)

How do I programmatically get an index value out, 
eg
I have a STOCK file, and a REPAIRS file. Whoever designed this needs their
head read, but the repairs file only has the stock code as a reference in
the record. I have indexed the repair file on stock code, and need to create
a report on the stock file of how many items are under repair.

1. UniverseBASIC code?

2. is this possible from an Itype?
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Indexes

2008-03-14 Thread Symeon Breen
I would use the SAVING clause on a select of the repairs file to build a list 
of stock id's then use a merge list command to see what stock ids do not have a 
repairs record.



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dennis Bartlett
Sent: 14 March 2008 10:04
To: u2-users@listserver.u2ug.org
Subject: [U2] Indexes

My dumb question for the day (just cant remember how to... and the manual's
example is too simplistic...)

How do I programmatically get an index value out, 
eg
I have a STOCK file, and a REPAIRS file. Whoever designed this needs their
head read, but the repairs file only has the stock code as a reference in
the record. I have indexed the repair file on stock code, and need to create
a report on the stock file of how many items are under repair.

1. UniverseBASIC code?

2. is this possible from an Itype?
---
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] AUTO: Claude Masseron/UK/IBM is out of the office. (returning 01/04/2008)

2008-03-14 Thread Claude Masseron
I am out of the office until 01/04/2008.

Please contact Kenton Turner on 07801 684291 in my absence.


Note: This is an automated response to your message U2 Users Digest V1
#2115 sent on 14/3/08 8:00:05.
This is the only notification you will receive while this person is away.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Indexes

2008-03-14 Thread Raul_Dominguez
At the universe tcl:
SELECT REPAIR SAVING UNIQUE STOCK.ID

Providing the the id to the STOCK file is in a field called STOCK.ID. 

Raul





- Original Message -
From: Dennis Bartlett [EMAIL PROTECTED]
Sent: 03/14/2008 12:03 PM ZE2
To: u2-users@listserver.u2ug.org
Subject: [U2] Indexes



My dumb question for the day (just cant remember how to... and the manual's
example is too simplistic...)

How do I programmatically get an index value out, 
eg
I have a STOCK file, and a REPAIRS file. Whoever designed this needs their
head read, but the repairs file only has the stock code as a reference in
the record. I have indexed the repair file on stock code, and need to create
a report on the stock file of how many items are under repair.

1. UniverseBASIC code?

2. is this possible from an Itype?
---
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] Indexes

2008-03-14 Thread Brian Leach
Dennis

Two more ways to do this:

1/ you can use BASIC but it's a slight pig..
The SelectIndex statement selects keys from an index. But it generates a
select list, so you need to be careful about segregating these e.g. if
calling from a SUBR() in an Idescriptor.

2/ a way I'm clearly not recommending but that happens to work rather well
:)
The index is actually just a type 25 file with simple inverted records (key
= indexed values, fields = key of records under the index). If you can find
which of the index.nnn files in the I_filename directory is that index
(should match the order they appear in the LIST.INDEX statement), you can
just create a file pointer to it. Or, if you want to be safer, use an
OpenPath in BASIC and hold the pointer in named common...

Brian

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Dennis Bartlett
 Sent: 14 March 2008 10:04
 To: u2-users@listserver.u2ug.org
 Subject: [U2] Indexes
 
 My dumb question for the day (just cant remember how to... 
 and the manual's example is too simplistic...)
 
 How do I programmatically get an index value out, eg I have a 
 STOCK file, and a REPAIRS file. Whoever designed this needs 
 their head read, but the repairs file only has the stock code 
 as a reference in the record. I have indexed the repair file 
 on stock code, and need to create a report on the stock file 
 of how many items are under repair.
 
 1. UniverseBASIC code?
 
 2. is this possible from an Itype?
 ---
 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] Indexes

2008-03-14 Thread Tom Dodds
I recently put together a Tech Tip for a monthly news Letter about the Merge 
List process.  That might help with your situation, take a look.

http://www.ashwoodcomputer.com/TechTip.html

This is not an ad for Ashwood Computer Company

Tom Dodds
[EMAIL PROTECTED]
630.235.2975


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Symeon Breen
Sent: Friday, March 14, 2008 5:38 AM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Indexes

I would use the SAVING clause on a select of the repairs file to build a list 
of stock id's then use a merge list command to see what stock ids do not have a 
repairs record.



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dennis Bartlett
Sent: 14 March 2008 10:04
To: u2-users@listserver.u2ug.org
Subject: [U2] Indexes

My dumb question for the day (just cant remember how to... and the manual's
example is too simplistic...)

How do I programmatically get an index value out, 
eg
I have a STOCK file, and a REPAIRS file. Whoever designed this needs their
head read, but the repairs file only has the stock code as a reference in
the record. I have indexed the repair file on stock code, and need to create
a report on the stock file of how many items are under repair.

1. UniverseBASIC code?

2. is this possible from an Itype?
---
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] Indexes

2008-03-14 Thread Dennis Bartlett
Thanks! This is by far the easiest, and it works!

-Original Message-
[EMAIL PROTECTED] wrote:

At the universe tcl:
SELECT REPAIR SAVING UNIQUE STOCK.ID
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Indexes

2008-03-14 Thread Scott Ballinger
There is no function like the T correlative to translate to an indexed file
from a dict item, so you will need to do in BASIC as an I-type. The command
is BSCAN, e,g.

BSCAN BVAL,ID.LIST FROM FV,ID USING FIELDNAME ELSE BVAL = 

ID.LIST contains an AM delimited list of keys to records in file FV than
match ID in FIELDNAME.
BVAL  is the value of the indexed attribute that matches ID. If there was no
match, then BVAL will be the next indexed value past ID, so I always test if
BVAL = ID.
FV is the open file variable to the indexed file.
ID is the value you are searching for in the indexed FIELDNAME.
FIELDNAME is the name of the indexed fields in FV (e.g. CREATE.INDEX MYFILE
FIELDNAME).

A BY SEQ clause is optional, SEQ is either A or D for ascending or
descending, (ascending is the default).

See HELP BASIC BSCAN

I usually loop on BSCAN until BVAL NE ID. I am not sure if that is always
necessary.

I use I-types that incorporate BSCAN to return values from indexed files all
the time. It works great.

/Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006


On Fri, Mar 14, 2008 at 3:03 AM, Dennis Bartlett [EMAIL PROTECTED]
wrote:

 My dumb question for the day (just cant remember how to... and the
 manual's
 example is too simplistic...)

 How do I programmatically get an index value out,
 eg
 I have a STOCK file, and a REPAIRS file. Whoever designed this needs their
 head read, but the repairs file only has the stock code as a reference in
 the record. I have indexed the repair file on stock code, and need to
 create
 a report on the stock file of how many items are under repair.

 1. UniverseBASIC code?

 2. is this possible from an Itype?
 ---
 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] Indexes

2008-03-14 Thread Brutzman, Bill
Dennis:

I would handle it with something like the following...

-Bill

*

equate true to 1, false to 0

open 'STOCK'   to F.Stockelse  null
open 'REPAIRS' to F.Repairs  else  null

clearselect ALL

execute SELECT REPAIRS

 done = false  
  loop
readnext Invoice.ID else done = true
  until done do

read R.Repairs from F.Repairs, Repair.ID  else  R.Repairs = ''
  Bin.Location.ID = R.Repairs7

read R.Stock from F.Stock, Bin.Location.ID  else  R.Stock = ''
  Part.Nbr = R.Stock12

read R.Item from F.Item.Master, Part.Nbr  else  R.Item = ''
  Part.Desc = R.Item17

Print.Str  = Repair.ID'L#11' 
Print.Str := Part.Nbr 'L#6'  : '  '
Print.Str := Part.Desc'L#22' : '  '
Print.Str := Bin.Location 'L#6'
  print Print.Str

  R.This  = Repair.ID : VM
  R.This := Part.Nbr

locate R.This in Repair.Array1   by 'AL'  setting pos else null
insR.This before Repair.Arraypos

repeat


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Dennis Bartlett
Sent: Friday, March 14, 2008 6:04 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] Indexes


My dumb question for the day (just cant remember how to... and the manual's
example is too simplistic...)

How do I programmatically get an index value out, 
eg
I have a STOCK file, and a REPAIRS file. Whoever designed this needs their
head read, but the repairs file only has the stock code as a reference in
the record. I have indexed the repair file on stock code, and need to create
a report on the stock file of how many items are under repair.

1. UniverseBASIC code?

2. is this possible from an Itype?
---
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] Indexes

2008-03-14 Thread David Murray
Dennis,

Create a subr/function routine to open the REPAIRS file, use BSCAN to find
the required records (using the passed STOCK code) and then DCOUNT the BSCAN
result. You can then return this value.

Create an ITYPE dictionary field (in STOCK file) which calls this routine,
passing the required STOCK key/code.

It would be a good idea to cache the file open using one of the methods
which was discussed some months ago in this mail list.

Cheers,

David Murray


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dennis Bartlett
Sent: Friday, March 14, 2008 6:04 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] Indexes

My dumb question for the day (just cant remember how to... and the manual's
example is too simplistic...)

How do I programmatically get an index value out, eg I have a STOCK file,
and a REPAIRS file. Whoever designed this needs their head read, but the
repairs file only has the stock code as a reference in the record. I have
indexed the repair file on stock code, and need to create a report on the
stock file of how many items are under repair.

1. UniverseBASIC code?

2. is this possible from an Itype?
---
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] Indexes

2008-03-14 Thread Jerry Banker
Keep it simple! In a program you can use SELECTINDEX and from a command
line use SELECT with the SAVING UNIQUE keywords.

Jerry Banker

 -Original Message-
 From: Scott Ballinger [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 14, 2008 9:22 AM
 To: u2-users@listserver.u2ug.org
 Subject: Re: [U2] Indexes
 
 There is no function like the T correlative to translate to an indexed
 file
 from a dict item, so you will need to do in BASIC as an I-type. The
 command
 is BSCAN, e,g.
 
 BSCAN BVAL,ID.LIST FROM FV,ID USING FIELDNAME ELSE BVAL = 
 
 ID.LIST contains an AM delimited list of keys to records in file FV
 than
 match ID in FIELDNAME.
 BVAL  is the value of the indexed attribute that matches ID. If there
 was no
 match, then BVAL will be the next indexed value past ID, so I always
 test if
 BVAL = ID.
 FV is the open file variable to the indexed file.
 ID is the value you are searching for in the indexed FIELDNAME.
 FIELDNAME is the name of the indexed fields in FV (e.g. CREATE.INDEX
 MYFILE
 FIELDNAME).
 
 A BY SEQ clause is optional, SEQ is either A or D for ascending
 or
 descending, (ascending is the default).
 
 See HELP BASIC BSCAN
 
 I usually loop on BSCAN until BVAL NE ID. I am not sure if that is
 always
 necessary.
 
 I use I-types that incorporate BSCAN to return values from indexed
 files all
 the time. It works great.
 
 /Scott Ballinger
 Pareto Corporation
 Edmonds WA USA
 206 713 6006
 
 
 On Fri, Mar 14, 2008 at 3:03 AM, Dennis Bartlett
 [EMAIL PROTECTED]
 wrote:
 
  My dumb question for the day (just cant remember how to... and the
  manual's
  example is too simplistic...)
 
  How do I programmatically get an index value out,
  eg
  I have a STOCK file, and a REPAIRS file. Whoever designed this needs
 their
  head read, but the repairs file only has the stock code as a
 reference in
  the record. I have indexed the repair file on stock code, and need
to
  create
  a report on the stock file of how many items are under repair.
 
  1. UniverseBASIC code?
 
  2. is this possible from an Itype?
  ---
  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/


[U2] UV - XDOM - XPath - loop on nodes from xPath criteria ?

2008-03-14 Thread Manu Fernandes
Hi,

I'll use Universe's XDOM functions and I don't understand how to work
with multiple xml nodes within a xPath result.



Into XDOMLocate I can use xPath like /bookstore/book[price50.00]'   ;
it return a nodehandle to the first node which is ok with condition but
when I have many nodes I don't understand how to loop on all nodes



Any idea, experiences ?



Thanks by advance

Manu

--



Here is the XML Sample store into XML booktore.xml.



?xml version=1.0 encoding=ISO-8859-1?

bookstore

  book

title lang=frHarry Potter/title

price29.99/price

typepaper/type

  /book

  book

title lang=engLearning XML/title

price39.95/price

typepdf/type

  /book

  book

title lang=frDracula/title

price18.50/price

typepaper/type

  /book

/bookstore





I try this basic code to extract information.



Status = XDOMOpen('bookstore.xml',XML.FROM.FILE,XDDO)

if Status # XML.SUCCESS then stop



Status = XDOMLocate(XDDO,'/bookstore/book[price30.00]',,XBOOKS)

*this must return 2 nodes

Loop

  xml = 

  Status = XDOMWrite(XBOOKS,xml,XML.TO.STRING)

  CRT book xml : :xml

while status = XML.SUCCESS do

  Status = XDOM  what to get the next node which is ok with the
xpath condition ?

repeat

end
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Indexes

2008-03-14 Thread Anthony Youngman
Ah...

If that's what you want, then in BASIC

SELECTINDEX STOCK.ID FROM F.REPAIR

Should have exactly the same effect (and save the overhead of an EXECUTE). The 
only difference is the resulting select list may not be sorted (although I 
think it is).

If you then want to find what records are then associated with each stock id

SELECTINDEX STOCK.ID, STOCK.ID FROM F.REPAIR

Cheers,
Wol

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dennis Bartlett
Sent: 14 March 2008 13:44
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Indexes

Thanks! This is by far the easiest, and it works!

-Original Message-
[EMAIL PROTECTED] wrote:

At the universe tcl:
SELECT REPAIR SAVING UNIQUE STOCK.ID
---
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/