Strip $ sign from Sequential file

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
rxs0005
Participant
Posts: 18
Joined: Fri Oct 07, 2005 4:29 am

Strip $ sign from Sequential file

Post by rxs0005 »

hi

I have sequential text files that have $ amounts prefixed to the value and there are several columns.

How do i strip them before i laod them to orcale tables.

Should i define the COLA under seq stage as varchar2 and in oracle as a regular number(8,3)

EG:

Col A ColB ( in oracle )

$4455.444 4455.444


thanks

rxs0005
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Re: Strip $ sign from Sequential file

Post by DeepakCorning »

use this function in transformer and then load it in the table -->

Convert("$","",Column A)
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Strip $ sign from Sequential file

Post by chulett »

rxs0005 wrote:Should i define the COLA under seq stage as varchar and in oracle as a regular number(8,3)
Yes. There are many ways to strip the dollar sign, one such way would be to use the EReplace function.
-craig

"You can never have too many knives" -- Logan Nine Fingers
manojkumarnayak
Participant
Posts: 21
Joined: Fri Nov 04, 2005 11:31 am

Re: Strip $ sign from Sequential file

Post by manojkumarnayak »

several ways are there .
you can use shell script to remove $

sed 's/\$//g' < file name>

you can use this script for other files.

it is faster.


regards
manoj
Post Reply