Page 1 of 1

Basic Transformer in Parallel job Processing palette

Posted: Thu Mar 20, 2008 12:39 pm
by Nagin
Hi,
I have two questions -

1. I am not able to see Basic Transformer in the Parallel job processing palette, So I tried to customize and added the the Transformer from the server job processing palette, It gets added to the palette but not available to use. Its grayed out. Is there something else I need to do to make it available?

2. In the Parallel job developers guide, I saw the following note in the Basic Transformer section -"You can only use BASIC transformer stages on SMP systems (not on MPP or cluster systems)".
Now, If it is true that I can not use it on MPP systems, how do i deal with it? I have my development environment in SMP and the production environment in MPP.

I appreciate your help in regards to this.

Thanks,
Nagin.

Posted: Thu Mar 20, 2008 12:42 pm
by DSguru2B
Dont use it if your code is going to end up in an MPP enviornment. What functionality do you want to sqeeze out of a basic transformer?

Posted: Thu Mar 20, 2008 1:01 pm
by Nagin
DSguru2B wrote:Dont use it if your code is going to end up in an MPP enviornment. What functionality do you want to sqeeze out of a basic transformer?
I need a bunch of functions actually, like .. getting a month and year from a given date and getting a month and year out of SYSDATE-Xnumber of months. I got it all working in a server job, I was going to develop a sequence with a combination of server jobs and parallel jobs. But, the standards here require using only parallel jobs. So, I am trying to use a Basic Transformer in the job.

Posted: Thu Mar 20, 2008 1:18 pm
by chulett
Nagin wrote:But, the standards here require using only parallel jobs.
That's a silly 'standard'. Use whatever job type is appropriate to the task.

Posted: Thu Mar 20, 2008 1:25 pm
by Nagin
chulett wrote:
Nagin wrote:But, the standards here require using only parallel jobs.
That's a silly 'standard'. Use whatever job type is appropriate to the task.
Apart from the standards, My production system is in MPP, So, seems like I can't use the Basic Transformer eitherway. Any other thoughts as of how to achieve that functionality?

Posted: Thu Mar 20, 2008 1:26 pm
by Nagin
chulett wrote:
Nagin wrote:But, the standards here require using only parallel jobs.
That's a silly 'standard'. Use whatever job type is appropriate to the task.
Apart from the standards, My production system is in MPP, So, seems like I can't use the Basic Transformer eitherway. Any other thoughts as of how to achieve that functionality?

Posted: Thu Mar 20, 2008 1:37 pm
by chulett
You haven't really detailed exactly what functionality you are looking for that you think is missing.

Posted: Thu Mar 20, 2008 1:54 pm
by Nagin
The functionality I am looking for is -
1. Given a date , I need to get month and year from that
2. Given a date (D) and number of months (X), I need to do subtract 'X' from 'D' and get the year and month at that point in time.

Posted: Thu Mar 20, 2008 1:59 pm
by DSguru2B
Nagin wrote:1. Given a date , I need to get month and year from that
Use DateToString() to convert your date to text and then parse out your month and year using substring functions.
I am not currently on a px site but I believe the following should work

Code: Select all

DateToString(in.Date, "%yyyy%') for year 
DateToString(in.Date, "%mm%') for month
Nagin wrote:2. Given a date (D) and number of months (X), I need to do subtract 'X' from 'D' and get the year and month at that point in time.
How did you accomplish this in a server job? If using Ray's AddMonths() routine or some other logic?

Posted: Thu Mar 20, 2008 2:44 pm
by Nagin
I just found out these two functions - MonthFromDate() and YearFromDate() that would work in Parallel Transformer.

About, how I figured out the Month and Year from D-X in server job is thru a series of manipulations.

Here is how it goes -

D - System Date
X- number of months

((YearFromDate(D)*12)+MonthFromDate(D))-X, this whole thing divided by 12. Now, if D=2008 and X=16, I would get 2006.916666 as the answer. I used Field function for getting the first four digits for year, in this case its - 2006. Then the decimal part (0.916666)*12 gives me 10.99999, I rounded this with FMT() function that gave me 11 for month.

I know that looks like a lenghty way to do, but I could not think of any other way to do that.

If I were to do the same thing in the Parallel transformer, I could not get some BASIC functions working in the Parallel Transformer. Functions like SDiv, FMT and Field etc. Probably coz all those are Basic functions.

You think I can use similar C functions in the Parallel Transformer..?

Posted: Thu Mar 20, 2008 3:14 pm
by DSguru2B
Sure. If thats the logic you are using then you can still use Field() function in px transformer, for rounding you can use StringToDecimal and round it up.

Posted: Thu Mar 20, 2008 5:00 pm
by Nagin
DSguru2B wrote:Sure. If thats the logic you are using then you can still use Field() function in px transformer, for rounding you can use StringToDecimal and round it up.
Cool, I got it working. I used ceil function to round up.

Thanks alot for the help.