fmt FROM SERVER TO PARALLEL
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 160
- Joined: Tue May 02, 2006 7:49 am
fmt FROM SERVER TO PARALLEL
hI
I WANT TO USE THE SAME FUNCTION IN THE PARALLEL,,,
fmt(trim(LINK1.TEST),"9'0'R")
That is not possible PARALLRL JOBS beacuse of fmt function is not thier.
Can you please tell me how can we use the same login in the parallel jobs.
Thanks and Regards,
Suresh
I WANT TO USE THE SAME FUNCTION IN THE PARALLEL,,,
fmt(trim(LINK1.TEST),"9'0'R")
That is not possible PARALLRL JOBS beacuse of fmt function is not thier.
Can you please tell me how can we use the same login in the parallel jobs.
Thanks and Regards,
Suresh
As you've seen, the FMT function does not exist in Parallel jobs unless you choose to use a BASIC transform stage; but that is not recommended.
In your case you wish to format the number with leading zeroes to 9 places. You can do this simply by
assuming your output is a VarChar data type and your input is a string or a valid datatype that can implicitly be converted to a string.
In your case you wish to format the number with leading zeroes to 9 places. You can do this simply by
Code: Select all
RIGHT('000000000':LINK1.TEST,9)
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 160
- Joined: Tue May 02, 2006 7:49 am
Suresh, the FMT function does not exist in parallel jobs; so you cannot just use the same logic. The function I suggested does the same thing as the FMT() but if you don't wish to use it then that is up to you.
What you are trying to do is somewhat like converting a PASCAL program to C++ and having a requirement that "the code is not be to changed". Server and Parallel are different products and cannot be converted without changing the code.
What you are trying to do is somewhat like converting a PASCAL program to C++ and having a requirement that "the code is not be to changed". Server and Parallel are different products and cannot be converted without changing the code.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 160
- Joined: Tue May 02, 2006 7:49 am
ok fine...
my source data is
Source
1
2
3
4
5
.
.
.
100
101
...so on
i want to make the output for that column like this
Output
000000001
000000002
000000003
.
.
.
.
000000100
000000101
........and so on...
Please give the solution. How can i convert in parallel.
Sorry for keep on asking same thing...i am new to the parallel.
i dont know two many functions in the parallel and also how to use them ....
my source data is
Source
1
2
3
4
5
.
.
.
100
101
...so on
i want to make the output for that column like this
Output
000000001
000000002
000000003
.
.
.
.
000000100
000000101
........and so on...
Please give the solution. How can i convert in parallel.
Sorry for keep on asking same thing...i am new to the parallel.
i dont know two many functions in the parallel and also how to use them ....
I give up. I posted the solution in my first reply. Perhaps someone else can post another one which will satisfy Suresh.
(Addendum)
I think that I now understand, my original post is "Premium Content" and that part of the reply might not be visible to Suresh. The solution I proposed involves looking at the column as a string and doing your own formatting on that.
(Addendum)
I think that I now understand, my original post is "Premium Content" and that part of the reply might not be visible to Suresh. The solution I proposed involves looking at the column as a string and doing your own formatting on that.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 160
- Joined: Tue May 02, 2006 7:49 am
Hi,
i am trying with the below function
STR('0',9 - Len(DSLink4.test1)) : DSLink4.test1
i am finding the length and minus with 9.
the difference will be repated that many times and placed the zeros and finally concatenated with actual value.
But i am not getting the zeros, only getting the same source as output..
sample
Input column value = 319
STR('0',9-3):319
ANS: 319
But I NEED TO GET THE BELOW OUTPUT
000000319
Please give me some solutions...
Thanks
Suresh
i am trying with the below function
STR('0',9 - Len(DSLink4.test1)) : DSLink4.test1
i am finding the length and minus with 9.
the difference will be repated that many times and placed the zeros and finally concatenated with actual value.
But i am not getting the zeros, only getting the same source as output..
sample
Input column value = 319
STR('0',9-3):319
ANS: 319
But I NEED TO GET THE BELOW OUTPUT
000000319
Please give me some solutions...
Thanks
Suresh
What data types are your input and output columns?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 160
- Joined: Tue May 02, 2006 7:49 am
Put in an explicit DecimalToString() function and see if it works.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 160
- Joined: Tue May 02, 2006 7:49 am
Suresh - try a test job that outputs your DecimalToString along with the original decimal to a test file and experiment until you get it working. Nobody here can magically solve your problem until you are able to successfully convert your decimal to a string.
It is usually useless to post a "it didn't work" without explaining what you tried.
It is usually useless to post a "it didn't work" without explaining what you tried.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 160
- Joined: Tue May 02, 2006 7:49 am
I tried in this way.
i crated a one stage variable which calculates the length of the coulmn.
i created one more stage variable which minus with 9.
The final integer value will be passed to STR function. value
First Stage variable name:sta1
data type: integer
Derivation: Len(link.col1)
Second stage variable name:sta2
Data type:integer
Derivation:9- sta1
in the tranformer stage
Str(0,sta2)
========
Source input(Decimal)= 123
Output(Varchar)=000000000
i tried with decimaltostring function, it is returning zero values...
i tried with STR function. the value is repeating but it is not taking the actual value.
How can i get the value repeated values ( 9 - len(col1))....Please let me know...
i crated a one stage variable which calculates the length of the coulmn.
i created one more stage variable which minus with 9.
The final integer value will be passed to STR function. value
First Stage variable name:sta1
data type: integer
Derivation: Len(link.col1)
Second stage variable name:sta2
Data type:integer
Derivation:9- sta1
in the tranformer stage
Str(0,sta2)
========
Source input(Decimal)= 123
Output(Varchar)=000000000
i tried with decimaltostring function, it is returning zero values...
i tried with STR function. the value is repeating but it is not taking the actual value.
How can i get the value repeated values ( 9 - len(col1))....Please let me know...
You are doing far too many things at the same time to debug your problem. Start with a simple test to check the DecimalToString() function. Once you have converted your DSLink4.test1 column from decimal to a string then yoursuresh_dsx wrote:i tried with decimaltostring function, it is returning zero values...
Code: Select all
STR('0',9 - Len(DSLink4.test1)) : DSLink4.test1
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>