Page 1 of 1

Help to become good?

Posted: Wed Sep 19, 2007 2:58 am
by himerius
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: Select all

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..

Posted: Wed Sep 19, 2007 7:55 am
by janhess
I think, in English, Rep is suggesting using a lookup table and using the LOOKUP function.

.....

Posted: Wed Sep 19, 2007 9:09 am
by rep
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.

Posted: Wed Sep 19, 2007 9:15 am
by janhess
Probably best to say nothing then.

Posted: Wed Sep 19, 2007 1:13 pm
by rep

Posted: Mon Oct 08, 2007 3:00 am
by himerius
So there is no such thing as a DTX bible, or a must-have book I should get?

Posted: Mon Oct 08, 2007 3:15 am
by janhess
That's right. The only solution is to go on a course.
Did you sort out your lookup problrm?

Posted: Mon Oct 08, 2007 3:46 am
by himerius
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"?

Posted: Mon Oct 08, 2007 3:55 am
by janhess
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)

Posted: Mon Oct 08, 2007 3:26 pm
by rep
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.

Posted: Tue Oct 09, 2007 7:54 am
by himerius
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

Posted: Tue Oct 09, 2007 9:24 am
by janhess
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.