Hi,
Can anyone please tell me what would be the output of the below given function and how is ir working?
INPUT is DECIMAL of 8 Length
OUTPUT is VARCHAR of 2 Length
INPUT= 10990001
OUTPUT = FMT(INPUT,"R%8")
Thanks in Advance!
Thanks
Atul
Datastage function
Moderators: chulett, rschirm, roy
Datastage function
Atul
Page 164 of the [u][i]BASIC Programmers Guide[/i][/u] details what you want to know. The R format is right-justified. the % shows zeroes. I can't check now, but I think the format clause is wrong, the length (8) should be first. i.e. '8%R'
<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
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
In spite of Arnd's doubts, "R%8" is also correct. The width parameter is not required if there is a mask, and "%8" is a shorthand way of specifying "%%%%%%%%" as a mask. "R%8" displays the rightmost eight characters of the input, left padding with zeroes as required.
To answer your original question, the data will appear unchanged, since there are already eight characters - no leading zeroes would be required.
To answer your original question, the data will appear unchanged, since there are already eight characters - no leading zeroes would be required.
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.