Intelligent word wrapping

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

antonyraj.deva
Premium Member
Premium Member
Posts: 138
Joined: Wed Jul 16, 2008 9:51 pm
Location: Kolkata

Post by antonyraj.deva »

Hi Ray,

Learnt one more new thing today.Thanks for that. :D

Shah,
The path for the Basic Transformer is

Repository---->Stage Types---->Parallel---->Processing--->Basic Transformer

-Tony
Shah_h
Participant
Posts: 21
Joined: Fri Sep 11, 2009 6:06 am

Post by Shah_h »

Sainath.Srinivasan wrote:If you wish to fold the text, what will happen to the key fields ?....
Hi Sainath,

I am not breaking the column into multiple rows, but a single column into multiple columns of smaller length. So the output would be a single record per input but with more no. of columns.
Shah_h
Participant
Posts: 21
Joined: Fri Sep 11, 2009 6:06 am

Post by Shah_h »

Hi Ray,

Thanks. Your suggestion of using Fmt() function in BASIC transformer helped. Resolved my problem.

I was just wondering if there any alternate approach to achieve this as BASIC transformer has its own limitations like running on a local node only.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Of course: there's always the alternative of creating your own (parallel) routine.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

If you are going to break into multiple columns, you must be knowing the max number of possible columns.

On that basis, you may be able to do the following

Code: Select all

stgMaxColLength = 4000
stgCol1End = 
  If Count(inputCol[1, stgMaxColLength], " ") = 0 
  Then stgMaxColLength 
  Else Index(inputCol, " ",Count(inputCol[1, stgMaxColLength], " "))
stgCol2Begin = stgCol1End + 1
stgCol2End = 
  If Count(inputCol[stgCol2Begin, stgMaxColLength + stgCol2Begin - 1], " ") = 0 
  Then stgMaxColLength 
  Else Index(inputCol[stgCol2Begin,999999], " ",Count(inputCol[stgCol2Begin, stgMaxColLength + stgCol2Begin - 1], " "))
and continue till for all your columns.

I am sure this will be faster than dragging a basic transfer into your pallette.

Also check index with negative number, -1. I think it does reverse scan.

Do not have DS now to check.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

just out of curiosity, will 40 columns be enough to store 800 char long string with word wrapping?
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
Shah_h
Participant
Posts: 21
Joined: Fri Sep 11, 2009 6:06 am

Post by Shah_h »

@ Sainath,

Sorry, was not able to view your complete post as it is marked as premium content and i am not a premium member.

The maximum columns defined are 20 and each column length is 40. i.e.20*40 = 800 characters.
Shah_h
Participant
Posts: 21
Joined: Fri Sep 11, 2009 6:06 am

Post by Shah_h »

priyadarshikunal wrote:just out of curiosity, will 40 columns be enough to store 800 char long string with word wrapping?
Yes, the maximum columns defined as per requirement is 20 (40 char each) only. However, we assume that the input field (800Char) will not be greater than 650 char in any case. Hence this would suffice.
Post Reply