Hash/Seq file value to set as parameter

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
shrey3a
Premium Member
Premium Member
Posts: 234
Joined: Sun Nov 21, 2004 10:41 pm

Hash/Seq file value to set as parameter

Post 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
bapajju
Participant
Posts: 82
Joined: Wed Nov 19, 2003 11:58 pm

Re: Hash/Seq file value to set as parameter

Post 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)
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post 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.
shrey3a
Premium Member
Premium Member
Posts: 234
Joined: Sun Nov 21, 2004 10:41 pm

Post 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.
sudharsanan
Participant
Posts: 64
Joined: Fri Jul 16, 2004 7:53 am

Post 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
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I posted such a routine earlier today. Search for ReadV
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