Leading Zero in RCP Job
Moderators: chulett, rschirm, roy
Leading Zero in RCP Job
Hello,
I have created a RCP Job which is reading the Oracle table and generating the files at runtime.
The Job design is:-
Oracle connector --> Modify --> Seq
Modify stage is used to drop the unwanted columns.
The issue we have defined the column as Integer which is read as Number(38,0) and causing an issue with the File.
The input in the Oracle is as below
101 Test
102 Test
103 Test1
The output is coming as
00000000000000000000000000000000000101.
00000000000000000000000000000000000102.
00000000000000000000000000000000000103.
36 Zeros and . is added to the existing data.
How can I handle such issue in the RCP job where Metadata is not defied? The scheme file is also not used.
Regards
Neeraj
I have created a RCP Job which is reading the Oracle table and generating the files at runtime.
The Job design is:-
Oracle connector --> Modify --> Seq
Modify stage is used to drop the unwanted columns.
The issue we have defined the column as Integer which is read as Number(38,0) and causing an issue with the File.
The input in the Oracle is as below
101 Test
102 Test
103 Test1
The output is coming as
00000000000000000000000000000000000101.
00000000000000000000000000000000000102.
00000000000000000000000000000000000103.
36 Zeros and . is added to the existing data.
How can I handle such issue in the RCP job where Metadata is not defied? The scheme file is also not used.
Regards
Neeraj
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I should like to point out that the zeroes are perfectly correct; the correct decimal value will be stored in Oracle, irrespective of how it is displayed using View Data.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 7
- Joined: Mon Mar 29, 2010 1:36 pm
- Location: WASHINGTON, DC
It is not just the view data but the content of the file
The problem is not just with how the data looks in view data but how it appears in the seq file being created. All numeric data whether integers or decimal numbers are appearing in the file with unnecessary leading and trailing zeroes. One way to handle that would be to use DecimalToString(column_name, "suppress_zero") to transform the columns prior to writing to file. But since the original poster says he is using RCP to hide the metadata so that he/she could use the same job to generate multiple files, the metadata is not exposed and hence columns cannot be transformed. The question therefore is, how to handle this type of situation without resorting to explicitly defining the metadata and using transformations? Is abandoning RCP and explicitly defining metadata/using transformations the only solution?
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
They may be unnecessary (to you) but they're not wrong. What exactly is the problem?
DataStage puts them there driven by the precision and scale settings of the Decimal field.
DataStage puts them there driven by the precision and scale settings of the Decimal field.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Leading zeros shouldn't be a problem for the receiving tool. They are perfectly valid, as Ray noted, and the data is correct. With the data being pipe delimited, one would expect any tooling to be able to parse this just fine, whether leading zeros are there or not.
Ernie
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Something clever in sed or awk, or a simple job/routine to parse the entire line, or abandonment of the requirement that everything has to be generic and RCP driven.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
I'd probably write a server job to parse the whole line and clean it up as I need.
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: