Page 1 of 1

Iconv Oconv

Posted: Tue Feb 21, 2006 12:49 am
by Nick_6789
Hi there,

There's nothing new about this topic... Except I am super new to parallel jobs having just recently hop from server jobs.

I tried doing something too simple that is :

seq file -> transformer -> seq file.

1 field involved oni. Source seq file is type varchar and des file is type integer.

I just wanted to convert the source data into an integer using iconv.

hence the statement Iconv(thefieldname, "D YMD").

I have not run the job yet but yet it highlights that field in red in the transformer. What gives?

I tried this in server jobs environment there's no problem. Only in parallel. Am I missing something?

regards,
Nick.

Posted: Tue Feb 21, 2006 1:31 am
by elavenil
These functions are available only in Server jobs not in Parallel.

HTWH.

Regards
Saravanan

Posted: Tue Feb 21, 2006 1:39 am
by kcshankar
Hi Nick,
I just wanted to convert the source data into an integer using iconv
Modify stage will do that conversion.

regards
kcs

Iconv Oconv

Posted: Tue Feb 21, 2006 1:59 am
by Nick_6789
Sorry guys I have a bad habit of not posting all my thoughts in a single post... here goes:

What i wanted to do is this. I get a source:

200600212

First 4 fields - year
next 3 - month
last 2 - date

This is in integer format and from a source file.

I wanted to bring this into a transformer and use iconv oconv function to change it into date format and then plus the day by 1 and then reoutputting it as integer again in the above format.

I could do this manually by I had to take note of the no. of days diff between month... so that can be super troublesome especially for FEB date. cause there could be in a leap year.

Any idea guys?

Thanks in advanced.

Posted: Tue Feb 21, 2006 2:41 am
by kumar_s
Use Basic Transformer to get the privilage of Iconv function. (But not advisable in parallel exectuion)

Posted: Tue Feb 21, 2006 2:54 am
by kumar_s
Alternatively you can use

Code: Select all

StringToDate(Input.link[1,4]:Inpu.Link[6,9],"%yyyy%mm%dd")
to convert to date.

Iconv Oconv

Posted: Tue Feb 21, 2006 3:13 am
by Nick_6789
kumar_s wrote:Alternatively you can use

Code: Select all

StringToDate(Input.link[1,4]:Inpu.Link[6,9],"%yyyy%mm%dd")
to convert to date.
Hi thanks kumar. I've also thought of this. However, i am still searching for a pre-default function that will add the days I want into the date.

Date() + 1 doesn't seem to work.

Thanks.

Posted: Wed Feb 22, 2006 12:30 pm
by kumar_s
Hmm... Another pritty workaround. Once Converted into do date,Convert into Julian date, which is an integer so that you can perform mathamatical operations. 8)