OPENPATH "directory-of-tab-delimited-file" TO F.PATH ELSE STOP "Can not find 
directory"
OPEN "","Name-of-file-with-keys" TO F.KEYFILE ELSE STOP "CAN Not find file"
*
READ XDATA FROM F.PATH,"flat-file-name" ELSE STOP "Can not find flat filename"
MAXLINES=DCOUNT(XDATA,CHAR(254))
FOR T=1 TO MAXLINES
   LIN=XDATA<T>
   KEYVALUE=FIELD(LIN,CHAR(9),1)
   VALUE=FIELD(LIN,CHAR(9),2)
   READ VDATA FROM F.KEYFILE,KEYVALUE ELSE PRINT KEYVALUE:" Not in Key File" ; 
CONTINUE
*
* could also read:
*
   READ VDATA FROM F.KEYFILE,KEYVALUE ELSE
      Insert code here as to what to do if the KEYVALUE does not exist in the 
FILE on the system
   END
*
*
...
...
   Insert code here as to what to do with the VALUES in the FILE on the system, 
and what
   To do with the VALUE in the flatfile
...
...
NEXT T
*
...
...


-----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

Reply via email to