Look up to sequncial file

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Das
Participant
Posts: 87
Joined: Tue Oct 24, 2006 9:58 pm
Location: india

Look up to sequncial file

Post by Das »

Hi All

Could you look into the following issues with DS PX.

1. Is it possible to perform the lookup into a sequncial file with out craeting the Dataset (i mean direct lookup to the sequncial).

2.Is it possible to do a self lookup(parimary link as well as the reference link of a sequncial file are same file say emp.txt)?How we can handle this type of situation.

Thanks,
Das"
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

1. If you mean a sparse lookup, no - that's only supported for DB2 and Oracle. If you mean a Sequential File stage feeding a reference link, then yes. The contents of the sequential file are loaded into the virtual Data Set associated with the link. However, if it is too large, this will fail.

2. Yes (see above), but why?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Das
Participant
Posts: 87
Joined: Tue Oct 24, 2006 9:58 pm
Location: india

Post by Das »

ray.wurlod wrote:1. If you mean a sparse lookup, no - that's only supported for DB2 and Oracle. If you mean a Sequential File stage feeding a reference link, then yes. The contents of the sequential file are loaded ...
Thanks.I am beginer in PX..

I tried to create a reference link as well as a primary link from sequncial file stage both are referencing the same SEQ FILE, it was not possible.
Why?

then i tried to load whole the data from SEQ FILE(abc.txt) to a DATASET (abc.ds) ,[same name src and tgt ] that time it was giving an error," unable to write.."
then i tried to load whole the data from SEQ FILE(abc.txt) to a DATASET (pqr.ds) ,[different name src and tgt ] that time data was loaded successfully
could you tell why?

My requirement is to do a self lookup on a sequncial file Please suggest a solution

Rgds,
Das"
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Please post the actual error message.
satadru.kar
Participant
Posts: 14
Joined: Fri Dec 22, 2006 5:40 am
Location: Kolkata

Post by satadru.kar »

if you want to do a self lookup with the sequential file, the best way to do it( what I found) is first use the sequential file, followed by a Copy stage from where you should bring out two links, one as primary and other one as a referrence, for the following look up stage... try this option. This should work.
Thanks,
Satadru Kar
satadru.kar
Participant
Posts: 14
Joined: Fri Dec 22, 2006 5:40 am
Location: Kolkata

Post by satadru.kar »

if you want to do a self lookup with the sequential file, the best way to do it( what I found) is first use the sequential file, followed by a Copy stage from where you should bring out two links, one as primary and other one as a referrence, for the following look up stage... try this option. This should work.
Thanks,
Satadru Kar
satadru.kar
Participant
Posts: 14
Joined: Fri Dec 22, 2006 5:40 am
Location: Kolkata

Post by satadru.kar »

if you want to do a self lookup with the sequential file, the best way to do it( what I found) is first use the sequential file, followed by a Copy stage from where you should bring out two links, one as primary and other one as a referrence, for the following look up stage... try this option. This should work.
Thanks,
Satadru Kar
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post by Minhajuddin »

Das wrote: I tried to create a reference link as well as a primary link from sequncial file stage both are referencing the same SEQ FILE, it was not possible.
Why?
Please post your design, as to what you tried e.g. SeqFile-->Lookup....
Das wrote: then i tried to load whole the data from SEQ FILE(abc.txt) to a DATASET (abc.ds) ,[same name src and tgt ] that time it was giving an error," unable to write.."
The first point you need to understand is these two files have different names, How? one is abc.txt and the other is abc.ds alright!

and you don't need a dataset for a reference lookup, you can use the sequential file to do that as well.

To help us really help you, you need to put your error messages in the code tags

Das wrote: then i tried to load whole the data from SEQ FILE(abc.txt) to a DATASET (pqr.ds) ,[different name src and tgt ] that time data was loaded successfully
could you tell why?

Try changing the names back again and see if it works ;)
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can do it from the same sequential file, but not from the same Sequential File stage - you will need two Sequential File stages (one on the stream input the other on the reference input to the Lookup stage) each referring to the same file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply