Re: [U2] Regarding: LISTING SUB-VALUES

2013-12-27 Thread Will Johnson

Or @RECORD<3,3>

I wonder if using the @Record in this way, would be a microsecond faster than 
using CUSTOMER.PHONE.NUMBER ?
It would seem like the processor would have one less step to do, but maybe I'm 
wrong.



-Original Message-
From: Charles Stevenson-2 [via U2 (UniVerse & UniData)] 

To: Will Johnson 
Sent: Fri, Dec 27, 2013 5:32 am
Subject: Re: Regarding: LISTING SUB-VALUES


Anthony meant:
 002: CUSTOMER.PHONE.NUMBER<1,3>

On 12/27/2013 1:08 PM, Wols Lists wrote:
> CUSTOMER.PHONE.NUMBER.3
> 0001: I
> 0002: CUSTOMER.PHONE.NUMBER<3>
<1,3> extracts the 3rd value from that single attribute.
<3> extracts the 3rd attribute, which in this case would yield null.
CUSTOMER.PHONE.NUMBER already extracted the 3rd attribute.
So it is an array 1 attribute long, but with multivalues.

On UD, I think  this is customary:
 002: EXTRACT( CUSTOMER.PHONE.NUMBER,1,3 )

THE  <...>  syntax is really an alternate syntax of the EXTRACT function.

On UV, after you write your I-descriptor & compile it,
 DLIST CUSTOMER.FILE CUSTOMER.PHONE.3
will show you what it actually compiles to.
That can be illuminating.

I think this is beyond your immediate question but:
There are other fancier ways to get at multiple associated values 
aligned across several fields. Generally involves WHEN, BY.EXP, 
BY.EXP.DSND keywords.
You also need to make sure the I descriptors have an M in <6> and a 
common association name defined in <7>.

Regards,
cds


On 12/27/2013 1:08 PM, Wols Lists wrote:
> CUSTOMER.PHONE.NUMBER.3
> 0001: I
> 0002: CUSTOMER.PHONE.NUMBER<3>

___
U2-Users mailing list
[hidden email]
http://listserver.u2ug.org/mailman/listinfo/u2-users





If you reply to this email, your message will be added to the discussion below:

http://u2-universe-unidata.1073795.n5.nabble.com/Regarding-LISTING-SUB-VALUES-tp42409p42411.html


To start a new topic under U2 - Users, email 
ml-node+s1073795n3...@n5.nabble.com 
To unsubscribe from U2 (UniVerse & UniData), click here.
NAML





--
View this message in context: 
http://u2-universe-unidata.1073795.n5.nabble.com/Regarding-LISTING-SUB-VALUES-tp42409p42413.html
Sent from the U2 - Users mailing list archive at Nabble.com.
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Regarding: LISTING SUB-VALUES

2013-12-27 Thread David A. Green
Shan is CUSTOMER.PHONE.NUMBER an associated MV?  If you have an association
with a field like CUSTOMER.PHONE.TYPE and you want just the FAX numbers then
you can use the WITH keyword in your query like:

:LIST CUSTOMER CUSTOMER.NAME WHEN CUSTOMER.PHONE.TYPE EQ "FAX"
CUSTOMER.PHONE.NUMBER 

David A. Green
(480) 201-7953
DAG Consulting

-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Shanmukh Nandha
Sent: Thursday, December 26, 2013 11:26 PM
To: U2-Users@listserver.u2ug.org
Subject: [U2] Regarding: LISTING SUB-VALUES

Hi Everyone,

Always a pleasure to read the useful advice and varying personalities on
this list.

Generally we are using SB+ account.  There will be many multi-value field
available in files, How to list specific Multi values of a field in specific
file .

For example:-

CUSTOMER FILE contains fields like
1. CUSTOMER.NAME   (single value) 2. CUSTOMER.SALARY
(single value) 3.CUSTOMER.PHONE.NUMBER (multi value)

1. JOHN (Cust name with single value)
2. 70$/hr (Cust salary with single value) 3. 123454ý 655656ý 767787ý 87887
(Cust Ph No with Multi value)

General to list specific field we use LIST CUSTOMER F3.

How to list 3rd position of 3rd field of CUSTOMER file.

Could any one of you can please let me know

Thank you,
Shan
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Regarding: LISTING SUB-VALUES

2013-12-27 Thread Charles Stevenson

Anthony meant:
002: CUSTOMER.PHONE.NUMBER<1,3>

On 12/27/2013 1:08 PM, Wols Lists wrote:

CUSTOMER.PHONE.NUMBER.3
0001: I
0002: CUSTOMER.PHONE.NUMBER<3>

<1,3> extracts the 3rd value from that single attribute.
<3> extracts the 3rd attribute, which in this case would yield null.
CUSTOMER.PHONE.NUMBER already extracted the 3rd attribute.
So it is an array 1 attribute long, but with multivalues.

On UD, I think  this is customary:
002: EXTRACT( CUSTOMER.PHONE.NUMBER,1,3 )

THE  <...>  syntax is really an alternate syntax of the EXTRACT function.

On UV, after you write your I-descriptor & compile it,
DLIST CUSTOMER.FILE CUSTOMER.PHONE.3
will show you what it actually compiles to.
That can be illuminating.

I think this is beyond your immediate question but:
There are other fancier ways to get at multiple associated values 
aligned across several fields. Generally involves WHEN, BY.EXP, 
BY.EXP.DSND keywords.
You also need to make sure the I descriptors have an M in <6> and a 
common association name defined in <7>.


Regards,
cds


On 12/27/2013 1:08 PM, Wols Lists wrote:

CUSTOMER.PHONE.NUMBER.3
0001: I
0002: CUSTOMER.PHONE.NUMBER<3>


___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Regarding: LISTING SUB-VALUES

2013-12-27 Thread Wols Lists
On 27/12/13 06:25, Shanmukh Nandha wrote:

> 
> CUSTOMER FILE contains fields like
> 1. CUSTOMER.NAME   (single value)
> 2. CUSTOMER.SALARY (single value)
> 3.CUSTOMER.PHONE.NUMBER (multi value)
> 
> 1. JOHN (Cust name with single value)
> 2. 70$/hr (Cust salary with single value)
> 3. 123454ý 655656ý 767787ý 87887 (Cust Ph No with Multi value)
> 
> General to list specific field we use LIST CUSTOMER F3.
> 
> How to list 3rd position of 3rd field of CUSTOMER file.
> 
> Could any one of you can please let me know
> 
If you're happy creating a new dict field ...

CUSTOMER.PHONE.NUMBER.3
0001: I
0002: CUSTOMER.PHONE.NUMBER<3>
etc

Otherwise, in the LIST command, you can always do EVAL
'CUSTOMER.PHONE.NUMBER<3>'

Cheers,
Wol
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users