Datastage function

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
atulgoel
Participant
Posts: 84
Joined: Tue Feb 03, 2009 1:09 am
Location: Bangalore, India

Datastage function

Post by atulgoel »

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
Atul
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

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'
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Why don't you try it out ?

Right oriented zero padded 8 digit output.

Your output will be '10'.

Note - I have not tried it. So it is just my guess.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
major
Premium Member
Premium Member
Posts: 167
Joined: Mon Nov 26, 2007 12:21 am

Post by major »

The simple way to know ourselves how a particular function works is to write a test routine with it and test it
Post Reply