date function in parallel Job

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
anupam
Participant
Posts: 172
Joined: Fri Apr 04, 2003 10:51 pm
Location: India

date function in parallel Job

Post by anupam »

Hi,

I need some advice on date function in parallel extender. I want to have data for only the current quater from dataset.

My job would be

Full_Data_dataset ---> transformer/Filter_thisQuaterData ----> ThisQuaterData

Please let me know what is the solution.

I can do it using server routine but then unable to call the server routine from the Parallel Job.
----------------
Rgds,
Anupam
----------------
The future is not something we enter. The future is something we create.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

anupam,

if performance is not an issue, you can always use a BASIC transform stage in a parallel job and enjoy all the benefits of the ICONV/OCONV functions for date conversions.

You can use the builtin date conversions in Px such as DateToString to perform your cast to the new data column. Another way would be to keep the datatype until you do your database write and use to_char() in the SQL.
elavenil
Premium Member
Premium Member
Posts: 467
Joined: Thu Jan 31, 2002 10:20 pm
Location: Singapore

Post by elavenil »

MonthFromDate(<date in the full data set>) would give you month number and quarter can be derived based on the month number and you should have current quarter in a parameter. So current quarter can be filtered in the filter stage.

I have no idea whether this is better way of getting the quarter in PX.

HTWH.

Regards
Saravanan
anupam
Participant
Posts: 172
Joined: Fri Apr 04, 2003 10:51 pm
Location: India

Post by anupam »

Hi,

The way to find out the 1st date of this quater is not a problem

Oconv(QUARTER.FIRST(Oconv(date(), "D4Y"):"Q":Oconv(date(), "DQ")) ,"D-YMD[4,2,2]")

But the problem now is when using this code in server job it is absolutly working fine. But when i use this piece of code in Parallel Jobs then i am getting null in this particular column as an output.

Any Suggestions...
----------------
Rgds,
Anupam
----------------
The future is not something we enter. The future is something we create.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

anupam,

have you use a BASIC transformer stage and not a normal transformer stage in the Px job?
Post Reply