But the shifting is more expensive than the traversing :)

 

 

 

-----Original Message-----
From: Israel, John R. <johnisr...@daytonsuperior.com>
To: 'U2 Users List' <u2-users@listserver.u2ug.org>
Sent: Tue, Apr 30, 2013 10:02 am
Subject: Re: [U2] Help needed..


Yes, I understand it shifts everything, but you are not traversing deeper with 
each loop.  You are only going 1 deep every time.  Old school.  :-)

John


-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] 
On Behalf Of Wjhonson
Sent: Tuesday, April 30, 2013 12:48 PM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Help needed..

That's interesting John, but the del *does* in fact *shift* the entire array 
forward each time.
It really does :)

You can traverse without re-scanning by using the SELECT or SELECTV to 
transform 
the entire contents *once* into a type of Get List (it works try it!)

You can then use a READNEXT to extract each row, without the need to rescan 
from 
the beginning, since READNEXT has always maintainted a pointer to where it left 
off.  It doesn't start at the front each time.


 

 

 

-----Original Message-----
From: Israel, John R. <johnisr...@daytonsuperior.com>
To: 'U2 Users List' <u2-users@listserver.u2ug.org>
Sent: Tue, Apr 30, 2013 9:27 am
Subject: Re: [U2] Help needed..


Here is some fast and loose code that I often use.

READ TXT.REC FROM F.YYYY, KEY.TXT
LOOP
        ROW = TXT<1>
WHILE ROW # ""
        DEL TXT<1>              ;* Make the TXT file smaller and smaller and 
not traversing deeper 
and deeper
        CONVERT CHAR(9) TO @FM IN ROW
        KEY = ROW<1>    ;* extract the key out of the row
        DEL ROW<1>              ;* Remove the key from the row - all that is 
left is the record
        WRITE ROW ON F.XXX, KEY
REPEAT


JRI

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org]
On Behalf Of Sathya
Sent: Tuesday, April 30, 2013 11:21 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] Help needed..

Hi all,..

I have a requirement here. Need guidance in doing that. Any help will be 
useful. 



TIA.

I have a flat file with tab delimited records and the file looks like below:

abcd 1234
cdef 3478
ghae 6284
...

I have to fetch the data 'abcd' and 'cdef' from this flat file and fetch some 
corresponding attributes from a file which has 'abcd' and 'cdef' as the key 
values. Please let me know if this could be done. If yes any kinda basic 
suggestions in doing that will be helpful. 

Thanks again,
Sathya V. 

_______________________________________________
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

 
_______________________________________________
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

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

Reply via email to