Page 1 of 1

Hash/Seq file value to set as parameter

Posted: Wed Jun 01, 2005 12:46 pm
by shrey3a
Hi,

I've a value in Hash/Seq file and I need to use it as a Job parameter.
Its a Date filed and I need to query my source against it , presently I'm doing this in transformer-constraint but it fetches all of the data. I want to filter the data at sourcr stage only by embedding the hash file value as parameter in the SQL query where clause.

Regards

Re: Hash/Seq file value to set as parameter

Posted: Wed Jun 01, 2005 1:08 pm
by bapajju
Hi,

Just a quick think. Ur hahs file must be getting created fromat Table. You can write ur Source SQL putting a where clause on this table (the table that is source to HASH)

Posted: Wed Jun 01, 2005 2:30 pm
by Sainath.Srinivasan
You need to create a stand-alone job that reads the value from the hash-file and returns as the status. The next job can then obtain this value and include this as a parameter in the SQL.

Posted: Wed Jun 01, 2005 2:38 pm
by shrey3a
Hi Sai,,

I am new to DS, Can you please explain how to read value from hash file and read and return as status and how to pass this value in next job.

Regards
Sainath.Srinivasan wrote:You need to create a stand-alone job that reads the value from the hash-file and returns as the status. The next job can then obtain this value and include this as a parameter in the SQL.

Posted: Wed Jun 01, 2005 11:28 pm
by sudharsanan
Shreya,
how to read value from hash file and read and return as status and how to pass this value in next job.
In order to read value from hashfile, you have to get familiar with Datastage Routines. Datastage's repository is universe Database. You have to query the Universe database to fetch the values.

In my project we call the routine using Routine Activity stage,we use these routines to get values from the hash file. The routine is written in such a way that when we call the routine by passing the parameter (usually parameter will be the key) we fetch the value and after getting the value we pass this value to the job/sequence. You do a search on this forum as this topic was discussed so many times..probably some of the gurus here can help you in learning the Datastage Basic...

Hope this info is useful..

Thanks
Sudharsanan A N

Posted: Thu Jun 02, 2005 4:34 am
by Sainath.Srinivasan
To keep it simple, you can create a table in your db and populate it with the value from hash-file. This will assist you in writing an SQL linking this table from hash-file and you will not need any parameter to be passed.

Posted: Thu Jun 02, 2005 5:30 am
by ray.wurlod
I posted such a routine earlier today. Search for ReadV