Basic Transformer in Parallel job Processing palette

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Nagin
Charter Member
Charter Member
Posts: 89
Joined: Thu Jan 26, 2006 12:37 pm

Basic Transformer in Parallel job Processing palette

Post 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.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Nagin
Charter Member
Charter Member
Posts: 89
Joined: Thu Jan 26, 2006 12:37 pm

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Nagin
Charter Member
Charter Member
Posts: 89
Joined: Thu Jan 26, 2006 12:37 pm

Post 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?
Nagin
Charter Member
Charter Member
Posts: 89
Joined: Thu Jan 26, 2006 12:37 pm

Post 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?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You haven't really detailed exactly what functionality you are looking for that you think is missing.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Nagin
Charter Member
Charter Member
Posts: 89
Joined: Thu Jan 26, 2006 12:37 pm

Post 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.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Nagin
Charter Member
Charter Member
Posts: 89
Joined: Thu Jan 26, 2006 12:37 pm

Post 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..?
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Nagin
Charter Member
Charter Member
Posts: 89
Joined: Thu Jan 26, 2006 12:37 pm

Post 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.
Post Reply