how to limit a column in transfer?

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
Toly_xiang
Participant
Posts: 9
Joined: Tue Apr 15, 2003 3:27 am
Location: China
Contact:

how to limit a column in transfer?

Post by Toly_xiang »

The datastage server version is 5.2.2 ang on AIX
I have a column like idno , I want to limit idno between 4764501 and
4764589, and also include 4773401.
and how to?
use hashed file stage or constraints? and how to?[:)]
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Toly

That is what constraints are for. They are designed to limit what gets sent to the target.

Thanks Kim.


Kim Duke
DwNav - ETL Navigator
www.Duke-Consulting.com
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

Two places to apply a filter. As Kim mentions the transformer constraint will let you add a filter to stop rows going through. The other option is putting a filter on a database source stage (if your source is a database table and not a flat file).

When you define your database table name and column list you should see an option in there for a where clause. Use this where clause to add "idno between 4764501 and 4764589 or idno = 4773401" or "(idno >= 4764501 and idno
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

To clarify what Vincent said, because I realise that English is not your first language, there are two possibilities.

If the data are being extracted from a database table, then you can use the Selection tab (which builds a WHERE clause in the SQL), for example:
IDNO BETWEEN (4764501 and 4764589) OR IDNO = 4773401

If the data are being read from a text file or other streaming source (such as FTP), then you put a constraint expression on the output link of a Transformer stage. For example:
(link.IDNO >= 4764501 And link.IDNO
Post Reply