Page 1 of 1

Problem in Reading DECIMAL fields

Posted: Fri Jun 27, 2008 4:13 pm
by 199542
Hi Everybody ,
Thank you all for solving many of my problems.

Now i am facing another problem .

My job design

Seq ----------->>> Trans ----------->> oracle

I have some decimal fields in the input sequential field .The format i specified

for decimal fields is ---- packed=no(overpunch) signposition ( trailing ).

I am able to read data correctly through view data.But ,in the input file i am

getting data differently its getting rejected.

Suppose field F1 DECIMAL(4,0 ) is there ....

If data in input field is 1234 ------->> view data o/p 1234

data in input field is 34 --------->> data getting rejected .Because i am getting 2 spaces in the input data .

I want this 34 to be loaded into the target .
Could anybody help how to load it into the target oracle stage without getting rejected .??

Thank you all advance

Posted: Fri Jun 27, 2008 4:27 pm
by ray.wurlod
Are you using Sequential File stage or Complex Flat File stage?

Your mention of packed and sign position properties suggests the latter.

Posted: Fri Jun 27, 2008 5:41 pm
by 199542
ray.wurlod wrote:Are you using Sequential File stage or Complex Flat File stage?

Your mention of packed and sign position properties suggests the latter. ...
Thank you ray for your response .

I am using sequential file stage only .I think we have those properties i mentioned in the sequential file also .I am facing problem in reading a decimal
field when i am having spaces within that field data.I am reading FIXED width file .

Thank you .

Posted: Sat Jun 28, 2008 2:48 am
by ray.wurlod
Sounds like you have not specified the field widths accurately.

Re: Problem in Reading DECIMAL fields

Posted: Sun Jun 29, 2008 4:12 am
by ersunnys
199542 wrote: If data in input field is 1234 ------->> view data o/p 1234

data in input field is 34 --------->> data getting rejected .Because i am getting 2 spaces in the input data .
Mate,

It seems like the source file you are getting is having wrong format of data. In fixed width, if you have a decimal field which have values "34 " is wrong, it should be "0034" because there is nothing like space in decimal value.

In this scenario, The only way to read the data properly is to read all the columns as CHAR and then in transformer, trim the value and convert it to decimal.

I hope this will solve your problem.

Sunny

Posted: Sun Jun 29, 2008 11:47 am
by 199542
Hi Sunny ,
Thanks for your reply .Actually whats happening is .........

I am having a EBCDIC binary file and i am converting it into ASCII --1 st job

In 2nd job i am reading the o/p of first job and parsing into different fields .

The o/p of first job is char(250) ---- fixed width , no delimiter

I am parsing char(250) in to different fields like F1,F2,F3,F4,F5.

Here F2 is a 9(3)v9(4) .So , I specified as DECIMAL(7,0) in the sequential file of second job.

But o/p of second job is containing data like

99 ---- (1,2) --------F1

' 34' ---(3,9) ---- F2

please note that i kept the data in single quotes for better understanding.I am getting some spaces and 34 for field F2 .

Since i am specifying it as decimal that record getting rejected .Is there any way to handle it . I understand that we can read it as a char and in transformer make necessary changes .Is there any other way ??Request you people to give your valuable suggestions .

Thank you all