Problem in Reading DECIMAL fields

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
199542
Participant
Posts: 41
Joined: Sat Dec 29, 2007 2:42 am

Problem in Reading DECIMAL fields

Post 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
gikjpjj
ray.wurlod
Participant
Posts: 54582
Joined: Wed Oct 23, 2002 10:52 pm

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
199542
Participant
Posts: 41
Joined: Sat Dec 29, 2007 2:42 am

Post 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 .
gikjpjj
ray.wurlod
Participant
Posts: 54582
Joined: Wed Oct 23, 2002 10:52 pm

Post by ray.wurlod »

Sounds like you have not specified the field widths accurately.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ersunnys
Participant
Posts: 29
Joined: Wed Sep 13, 2006 1:39 pm

Re: Problem in Reading DECIMAL fields

Post 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
Regards,
Sunny Sharma.
199542
Participant
Posts: 41
Joined: Sat Dec 29, 2007 2:42 am

Post 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
gikjpjj
Post Reply