DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
Author Message
himerius
Participant



Joined: 07 Sep 2007
Posts: 39
Location: Sandefjord
Points: 365

Post Posted: Wed Sep 19, 2007 2:58 am Reply with quote Back to top

DataStage® Release: 8x
Job Type: TX
OS: Windows
Hi.
1. I've recently started using the program, and have read through the tutorital which was included. But I want to learn more about the syntax of the datastage "scrip-language".
Anyone know good books, cbt or other usefull information on how to get to know the program better?

2. Is there any way to make variables, use wildcards and other programming techniques, or setting the rules to a script language?

The reason why im asking, is that the rules doesnt seem to scale well?

I had a series of potential values i needed to convert, and i had to make this huges sentence:

Code:
IF(ecc~v Attr ecc~RoleType Type:.:ElemDecl head~SenderRole Comp:.:InXML = "DKK", "A08", IF( ecc~v Attr ecc~RoleType Type:.:ElemDecl head~SenderRole Comp:.:InXML = "DDQ", "A12", IF(ecc~v Attr ecc~RoleType Type:.:ElemDecl head~SenderRole Comp:.:InXML = "DDX", "A05", IF(ecc~v Attr ecc~RoleType Type:.:ElemDecl head~SenderRole Comp:.:InXML = "DEA", "A09", IF(ecc~v Attr ecc~RoleType Type:.:ElemDecl head~SenderRole Comp:.:InXML = "EZ", "A04", IF(ecc~v Attr ecc~RoleType Type:.:ElemDecl head~SenderRole Comp:.:InXML = "GD", "A21", IF(ecc~v Attr ecc~RoleType Type:.:ElemDecl head~SenderRole Comp:.:InXML = "MDR", "A25", IF(ecc~v Attr ecc~RoleType Type:.:ElemDecl head~SenderRole Comp:.:InXML = "UD", "A13", ecc~v Attr ecc~RoleType Type:.:ElemDecl head~SenderRole Comp:.:InXML))))))))


I checked the include field but that cant support "mini-mapping", only include/exclued, with comment..
rep
Participant



Joined: 19 Jun 2007
Posts: 82
Location: New York City
Points: 1097

Post Posted: Wed Sep 19, 2007 7:37 am Reply with quote Back to top

himerius wrote:
Hi.
1.
how to get to know the program better?
..


Dinner and a movie?

Take some of the classes? Though I'd suggest programming for at least 3 months before taking the Fundamentals depending on your IT/IS background. Me? Im really smart, and Im not saying youre not, Im just saying that Ive realized something, even working in IT/IS. Stupid people have to eat also.


2:


For that code you got there, if there werent that many fields and they wouldnt change, Id probably do it like that, and like it!

If more codes would be added, or changed, ever, Id build a quick cross-reference, then EXTRACT(The damn value you want, where the damn value you got=damn value you got in the cross-reference)

Damn Value you got, Damn Value you want
"DKK" , "A08"
DDQ" , "A12
"DEA" , "A09
"MDR" , "A25


Now, you can add codes to the cross-reference and never have to re-compile the map, and I could have added two CR (crossrefs)s in the time it took to write this post. Hell, you could hardcode the entire CR in the first output card just like that above, then use it subsequent output cards as the CR.
Rate this response:  
Not yet rated
janhess
Participant



Joined: 18 Sep 2003
Posts: 201
Location: UK
Points: 950

Post Posted: Wed Sep 19, 2007 7:55 am Reply with quote Back to top

I think, in English, Rep is suggesting using a lookup table and using the LOOKUP function.
Rate this response:  
Not yet rated
rep
Participant



Joined: 19 Jun 2007
Posts: 82
Location: New York City
Points: 1097

Post Posted: Wed Sep 19, 2007 9:09 am Reply with quote Back to top

English is my second language, the first being humoristic/sarcastic Internet wiseass, of the no-harm-ever-intended dialect.

I believe that answering a question will get a person here, but entertaining them will get them back.



My third language is 01000010 01001001 01001110 01000001 01010010 01011001.
Rate this response:  
Not yet rated
janhess
Participant



Joined: 18 Sep 2003
Posts: 201
Location: UK
Points: 950

Post Posted: Wed Sep 19, 2007 9:15 am Reply with quote Back to top

Probably best to say nothing then.
Rate this response:  
Not yet rated
rep
Participant



Joined: 19 Jun 2007
Posts: 82
Location: New York City
Points: 1097

Post Posted: Wed Sep 19, 2007 1:13 pm Reply with quote Back to top

Rate this response:  
Not yet rated
himerius
Participant



Joined: 07 Sep 2007
Posts: 39
Location: Sandefjord
Points: 365

Post Posted: Mon Oct 08, 2007 3:00 am Reply with quote Back to top

So there is no such thing as a DTX bible, or a must-have book I should get?
Rate this response:  
Not yet rated
janhess
Participant



Joined: 18 Sep 2003
Posts: 201
Location: UK
Points: 950

Post Posted: Mon Oct 08, 2007 3:15 am Reply with quote Back to top

That's right. The only solution is to go on a course.
Did you sort out your lookup problrm?
Rate this response:  
Not yet rated
himerius
Participant



Joined: 07 Sep 2007
Posts: 39
Location: Sandefjord
Points: 365

Post Posted: Mon Oct 08, 2007 3:46 am Reply with quote Back to top

Dunno if ibm has any courses in norway, and it sounds expensive:P
Didnt modify the if statement, but i guess it could be done with a "choose" and a "when"?
Rate this response:  
Not yet rated
janhess
Participant



Joined: 18 Sep 2003
Posts: 201
Location: UK
Points: 950

Post Posted: Mon Oct 08, 2007 3:55 am Reply with quote Back to top

IBM run courses in the UK. A colleague was on one last week and there was a guy from Sweden there.

Your rule would be scalable if you set up a lookup file containing the before and after value in each record. Read this in an Input card and use the lookup function to return the required value.

Lookup(newvalue,old value = ecc~v Attr ecc~RoleType Type:.:ElemDecl head~SenderRole Comp:.:InXML)
Rate this response:  
Not yet rated
rep
Participant



Joined: 19 Jun 2007
Posts: 82
Location: New York City
Points: 1097

Post Posted: Mon Oct 08, 2007 3:26 pm Reply with quote Back to top

If you didn't want to create a lookup, which would work fine, and if more values come down the pike and you had created one, you can just add it to the look up, and not have to re-deploy, stop/start the system.

Another way you could do it is using the SUBSTITUTE function, which will change any string into another string, so for your rule, it would be.


SUBSTITUTE(value to check, value to find, value to replace it if you find it,value to find, value to replace it if you find it,value to find, value to replace it if you find it). The 2nd and 3rd field repeat.

so,

SUBSTITUTE(ecc~v Attr ecc~RoleType Type:.:ElemDecl head~SenderRole Comp:.:InXML, "DKK", "A08", "DEA", "A09","EZ", "A04", value to find, value to change it to)

Basically what you're telling it is, put the InXML field in your output, but if it finds the string in the second field of the function, replace that string to one in the 3rd field in the function before you write it out, and you can put as many different combos of values as you want.


If the string in the input was was "12345678" in a field called Xfield, and used this rule:

SUBSTITUTE(Xfield, "3", "9", "5", "9", "8", "rep is the best")

You would get this in your output

12949679rep is the best

in your output.

Get it?


Other then that, I found the tutorial to be very good. I did it twice even, then read all the functions on my own and messed with them. Yes, the classes are expensive, but I believe they have them in Europe, if not in Norway.
Rate this response:  
Not yet rated
himerius
Participant



Joined: 07 Sep 2007
Posts: 39
Location: Sandefjord
Points: 365

Post Posted: Tue Oct 09, 2007 7:54 am Reply with quote Back to top

Yes i get it, but the biggest problem right now is that i cant use helpfile cause i havent received they right patch..

Mabbe i change subject to : Help to become god? o.0
Rate this response:  
Not yet rated
janhess
Participant



Joined: 18 Sep 2003
Posts: 201
Location: UK
Points: 950

Post Posted: Tue Oct 09, 2007 9:24 am Reply with quote Back to top

All the info you need is in the pdf documents supplied with the product. If you are getting this by a download, the docs are in a separate installation file.
Rate this response:  
Not yet rated
Display posts from previous:

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours