Guide or tutorial to write Datastage Routines

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
Network_CIS
Premium Member
Premium Member
Posts: 12
Joined: Thu Jul 30, 2009 1:33 am
Location: Melbourne

Guide or tutorial to write Datastage Routines

Post by Network_CIS »

Hi,
Could anybody help me with Guides or tutorials for writing and using Datastage routines.

Or could anybody suggest to do this without routines >
source: oracle
target: tab delimited sequential file

requirement:I need to break a line into two rows if text in a row is more than 132 chars.

col1: key value
col2: notes

if notes are longer than 132 then terget should look like:

key1<tab>notes1(1-132 chars)
key1<tab>notes1(133-265 chars)
key1<tab>notes1(266-531 chars)
.... so on

Regards,
Satish
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can use a server job or BASIC Transformer stage in a parallel job and the Fold() function or the Fmt() function in either.

Do you want to break at the exact character boundary, or preserve whole words on a single line? Both are possible.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

For lines that will never be more than a small multiple of 132, you could also use substrings onto multiple outputs of a Transformer stage (constrain each with an expression that guarantees existence of that line fragment) and combine those with a Funnel stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Network_CIS
Premium Member
Premium Member
Posts: 12
Joined: Thu Jul 30, 2009 1:33 am
Location: Melbourne

Post by Network_CIS »

Hi Ray,
Length in source data is variable could be anywhere between Empty to 4000 chars; however, target can only store 132 chars max for that column.

Could you please help me with a example of using either function, where I could still maintain following format.

'Key1<TAB>Note1'
'Key1<TAB>Note1'
'Key1<TAB>Note1'
'Key2<TAB>Note2'
'Key3<TAB>Note3'
'Key3<TAB>Note3'
.... so on

Regards,
Satish
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I'm sure if you Search on DSXchange you will be able to find some examples.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Network_CIS
Premium Member
Premium Member
Posts: 12
Joined: Thu Jul 30, 2009 1:33 am
Location: Melbourne

Post by Network_CIS »

Post Reply