Brenda:
One way to pick off only the first four characters in each value is to
use !FMTS, one of the dynamic-array handling subroutines. You create an
I-type like so in the DICT of first file:
0001: I
0002: SUBR("!FMTS",ONE,"4L####")
0003:
0004: PICK4
0005: 10L
0006: M
If we now type the command "LIST FILE_ONE FIELD_ONE PICK4" we get this
(made up data of course):
FILE_ONE FIELD_ONE. PICK4.....
BBB 4444XXX 4444
5555YYY 5555
6666ZZZ 6666
AAA 1111AAA 1111
2222BBB 2222
3333CCC 3333
2 records listed.
You see that the first 4 characters are selected from each value.
You said that you wished to use those 4 characters to read another
field. Assuming that the other field is the ID field of another file
(FILE_TWO), then the I-type could be this:
0001: I
0002:
TRANS(FILE_TWO,SUBR("!FMTS",FIELD_ONE,"4L####"),FIELD_IN_FILE_TWO,'X')
0003:
0004: FIELD_IN_FILE_TWO
0005: 15L
0006: M
Then each of the PICK4 values, 4444, 5555, etc, are used as IDs for the
second file. With my test data, the result is this:
FILE_ONE FIELD_ONE. PICK4..... FIELD_IN_FILE_TWO.............
BBB 4444XXX 4444 SOME FIELD IN 4444
5555YYY 5555 SOME FIELD IN 5555
6666ZZZ 6666 SOME FIELD IN 6666
AAA 1111AAA 1111 SOME FIELD IN 1111
2222BBB 2222 SOME FIELD IN 2222
3333CCC 3333 SOME FIELD IN 3333
Hope this helps.
Harold Oaks
Clark County, WA
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Brenda Price
Sent: Monday, May 19, 2008 1:24 PM
To: [email protected]
Subject: [U2] multi-valued extraction
I know I've done this before several times in fact but for some reason,
today I just can't get my dict item to work correctly.
Field 1 is multivalued with 10 digit ids, I want to extract only the
first 4 digits of those ids, then read another field with each of those
extracted ids. My dict item works fine until I add the [1,4], then only
the first 4 digits of the first 10 digit Id is returned. My co-worker
with 25 years plus experience is drawing a blank on this at the moment
also.
Rec<1> = 1154960101:@vm:3456960201:@vm:4565982341
Dict item comes back with 1154 only, instead of 1154, 3456, and 4565.
Brenda Price
AAC
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/