transforms need to replace OConv and FMT

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
pongal
Participant
Posts: 77
Joined: Thu Mar 04, 2004 4:46 am

transforms need to replace OConv and FMT

Post by pongal »

Hi,
currently i am using OConv and FMT transforms in Basic Transformer.
now i wanted to use normal transformer(parallel) with the same transforms.
but it is not allowing OConv and FMT transforms.
are there any other transform that suits best for parallel transformer.
for eg:-
1) i wanted to convert from internal date format to USFormat in Transformer.
2). format 3 chars length field value to 5 chars length padded with leading zero's .
3). how to call server routine in parallel transformer.
4). how to convert decimal value to numeric value in parallel transformer.
eg:- 45.67 to 46 nearest whole number

Can anybody help me out
lshort
Premium Member
Premium Member
Posts: 139
Joined: Tue Oct 29, 2002 11:40 am
Location: Toronto

Post by lshort »

Do a search on "Date Conversion". This topic has been covered quite extensively in this forum.

8)
Lance Short
"infinite diversity in infinite combinations"
***
"The absence of evidence is not evidence of absence."
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Read the Parallel Job Developer's Guide chapters on Modify stage - particularly the list of data type conversion functions, such as decimal_from_string or decimal_from_decimal.

When you use the expression editor in the Transformer stage you are presented with a set of functions, one class of which are data conversion functions. You can read about these in the same manual.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Hi,
Parallel transformer also have option to do this.
You can surf for the options like, juliandayfromdate,stringtodate,datetostring,padstring,ceil,abs..

regards
kumar
pongal
Participant
Posts: 77
Joined: Thu Mar 04, 2004 4:46 am

Post by pongal »

thanks all of you for your information.
but i could not find exact parallel function
for 1) Ereplace.
Convert funtion is there, but it is not exactly matching my requirement.
eg:-
field = "4778 "J" STREET SW" should be formatted to
"4778 ""J"" STREET SW" in a csv file.
here Ereplace was working fine if i use basic transformer like this
Trim(Ereplace(In_VEND.THIRD_PARTY_N,'"','""'))
but i wanted the same functionality in parallel transfomer with parallel functions.
2)OConv date conversion
i was using to format date in basic transformer like this
Trim(OConv(@Date,"DMD[2,2]")," ","A"):Trim(OConv(@Time,"MT"),":","A"): FMT(@OUTROWNUM,"6'0'R")

eg:- 08211642000001

is there any function in parallel transformer to get the above date and time format?

3) I wanted to insert the date and time in oracle9i timestamp field, what would be the exact parallel function.

Thanks in advance
Amos.Rosmarin
Premium Member
Premium Member
Posts: 385
Joined: Tue Oct 07, 2003 4:55 am

Post by Amos.Rosmarin »

Hi,

To replicate the Iconv/Oconv "D" option you can use the

Code: Select all

DaysSinceFromDate
function - Returns the number of days from source date to the given date where the source date is 1967-12-30 (iconv = 0)

This will transform your date from int representation to date and vice versa.

You can do the same for the iconv time options by using

Code: Select all

SecondsSinceFromTimestamp 
with midnight as base_timestamp.

You have functions that brings you the current time/date like

Code: Select all

CurrentDate() , CurrentTime()
. you just have to play with the formats to get your need.



HTH,
Amos
Post Reply