Help to become good?

Formally known as "Mercator Inside Integrator 6.7", DataStage TX enables high-volume, complex transactions without the need for additional coding.

Moderators: chulett, rschirm

Post Reply
himerius
Participant
Posts: 39
Joined: Fri Sep 07, 2007 5:10 am
Location: Sandefjord

Help to become good?

Post 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..
janhess
Participant
Posts: 201
Joined: Thu Sep 18, 2003 2:18 am
Location: UK

Post by janhess »

I think, in English, Rep is suggesting using a lookup table and using the LOOKUP function.
rep
Participant
Posts: 82
Joined: Tue Jun 19, 2007 8:04 am
Location: New York City

.....

Post 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.
janhess
Participant
Posts: 201
Joined: Thu Sep 18, 2003 2:18 am
Location: UK

Post by janhess »

Probably best to say nothing then.
rep
Participant
Posts: 82
Joined: Tue Jun 19, 2007 8:04 am
Location: New York City

Post by rep »

himerius
Participant
Posts: 39
Joined: Fri Sep 07, 2007 5:10 am
Location: Sandefjord

Post by himerius »

So there is no such thing as a DTX bible, or a must-have book I should get?
janhess
Participant
Posts: 201
Joined: Thu Sep 18, 2003 2:18 am
Location: UK

Post by janhess »

That's right. The only solution is to go on a course.
Did you sort out your lookup problrm?
himerius
Participant
Posts: 39
Joined: Fri Sep 07, 2007 5:10 am
Location: Sandefjord

Post 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"?
janhess
Participant
Posts: 201
Joined: Thu Sep 18, 2003 2:18 am
Location: UK

Post 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)
rep
Participant
Posts: 82
Joined: Tue Jun 19, 2007 8:04 am
Location: New York City

Post 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.
himerius
Participant
Posts: 39
Joined: Fri Sep 07, 2007 5:10 am
Location: Sandefjord

Post 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
janhess
Participant
Posts: 201
Joined: Thu Sep 18, 2003 2:18 am
Location: UK

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