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
Guide or tutorial to write Datastage Routines
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 12
- Joined: Thu Jul 30, 2009 1:33 am
- Location: Melbourne
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 12
- Joined: Thu Jul 30, 2009 1:33 am
- Location: Melbourne
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
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
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 12
- Joined: Thu Jul 30, 2009 1:33 am
- Location: Melbourne
Thanks Ray.
Few relative links I found on DSX are:
viewtopic.php?t=126737&highlight=fmt
viewtopic.php?t=114616&highlight=
viewtopic.php?t=111302&highlight=
Cheers!!
Few relative links I found on DSX are:
viewtopic.php?t=126737&highlight=fmt
viewtopic.php?t=114616&highlight=
viewtopic.php?t=111302&highlight=
Cheers!!