Page 1 of 1

transforms need to replace OConv and FMT

Posted: Fri Aug 19, 2005 1:45 am
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

Posted: Fri Aug 19, 2005 2:46 pm
by lshort
Do a search on "Date Conversion". This topic has been covered quite extensively in this forum.

8)

Posted: Fri Aug 19, 2005 5:23 pm
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.

Posted: Fri Aug 19, 2005 11:41 pm
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

Posted: Sun Aug 21, 2005 6:12 am
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

Posted: Mon Aug 22, 2005 5:17 am
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