hi
i want to know can we use decode function in datastage . are any other functions similar to decode
CAN WE USE DECODE FUNCTION
Moderators: chulett, rschirm, roy
There are hundreds of different "decode" functions out there in the programming world. Which one are you referring to?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
There is no DECODE function like that built into DataStage. There are various ways of doing this starting with a long IF-THEN-ELSE or a CASE statement. How you solve this depends upon what your primary objectives are - simplicity or performance.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Ray - not for a DECODE with only 4 values; that would be a lot of overhead. an IF-THEN-ELSE... construct or {my preference} a INDEX/LOCATE statement is going to be faster than a cached hash lookup. If there are tens or hundreds of lookups then that would be a different matter.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Hmm... as with most things, 'depends'. Another consideration would be the nature of the decoded data. If you have a static, fixed, never will change list then you've covered all the considerations. If there is a possibility that it could change, I'd look into storing the decode data in a flat file and sourcing it into a cached hashed file in the job each run. That way you don't have to touch the job to add a new decode value pair. And unless you are doing a bajillion lookups, I wouldn't be too concerned about the 'overhead' it adds to the job.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: