Iconv Oconv

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
Nick_6789
Participant
Posts: 32
Joined: Thu Jan 05, 2006 2:07 am

Iconv Oconv

Post 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.
elavenil
Premium Member
Premium Member
Posts: 467
Joined: Thu Jan 31, 2002 10:20 pm
Location: Singapore

Post by elavenil »

These functions are available only in Server jobs not in Parallel.

HTWH.

Regards
Saravanan
kcshankar
Charter Member
Charter Member
Posts: 91
Joined: Mon Jan 10, 2005 2:06 am

Post 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
Nick_6789
Participant
Posts: 32
Joined: Thu Jan 05, 2006 2:07 am

Iconv Oconv

Post 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.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Use Basic Transformer to get the privilage of Iconv function. (But not advisable in parallel exectuion)
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post 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.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Nick_6789
Participant
Posts: 32
Joined: Thu Jan 05, 2006 2:07 am

Iconv Oconv

Post 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.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post 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)
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply