Hi All,
I have a field that has its length as Char(10), for this field if it has the data length that is coming in is 7 characters and the remaing space it has to get filled with the values AAA
Could you please tell me how can we achieve this.
Thanks in advance
Best Regards
Cherry
Fill the remaining spaces
Moderators: chulett, rschirm, roy
A Char(10) field cannot have 7 characters. This will only work if your source field is defined as CHAR(7), in which case your derivation will be "In.Char7Field:'AAA'".
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Maybe the o/p is saying that input is char(10) of which it has 7 non-blank chars and 3 blank chars (which is to be replaced by 'AAA')
Something like
Something like
Code: Select all
inputField[1, 7] : 'AAA'
Re: Fill the remaining spaces
Why not you try "PadString" function
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
A more general solution would have regard for the length of the inbound string. I'd use something like If InLink.TheString is likely to contain more than ten characters this expression will return only the leftmost 10 of them. If this is not the requirement, please adapt the expression to suit.
Code: Select all
Left(InLink.TheString : Str("A",10), 10)
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.