Hi All,
Cobol file, that was copied from OS390 to Windows, has one of the fields defined as PIC 9(18) COMP. Complex Flat File Stage in Designer 7.5 converts it to Native Type BINARY and then to SQL type: Integer(18). But the original values that greater than 2000000000 (10 digits) are converted incorrectly to negative values -76612353. Values smaller than 2000000000 are converted correctly.
Please let me know what data type could be used for the correct conversion.
Thanks a lot,
--Katrin
COBOL PIC 9(18) COMP Complex Flat File Conversion Problem
Moderators: chulett, rschirm, roy
-
katerina_se
- Premium Member

- Posts: 9
- Joined: Thu Jan 15, 2004 8:49 am
Do you know if the input data can have negative values? If not, then you need to specify the field as an unsigned integer. A signed integer can 'hold' the same number of values as an unsigned, but it is split between negative and positive whereas the unsigned is just positive numbers.
Take a 2-byte integer (aka a smallint, on most systems). It can hold the numbers 0 - 255 in an unsigned format, or -125 to 125 in a signed format.
Brad.
Take a 2-byte integer (aka a smallint, on most systems). It can hold the numbers 0 - 255 in an unsigned format, or -125 to 125 in a signed format.
Brad.
-
katerina_se
- Premium Member

- Posts: 9
- Joined: Thu Jan 15, 2004 8:49 am
Make the datatype change in DataStage to force your integer to be unsigned.
Now, please bear with me - I haven't worked with Server, only the Parallel version of DataStage, so I am not entirely familiar with the datatypes available within DataStage Server. I saw your message and realized we have run into the exact same thing so I am assuming the solution will be the same. Whereever you define your import and the incoming layout is where you should change the datatype. I am guessing that there are options that can be set for each incoming field, some generic options and some specific to the datatype, right?
In the Parallel version, a signed integer and an unsigned integer are treated as separate datatypes (like int and uint). Do you have this as well? Or there may be an option to select that says the input data in unsigned.
Sorry I can't be of more specific help. Maybe someone from the Server side can step in here and translate my PX-speak
Brad.
Now, please bear with me - I haven't worked with Server, only the Parallel version of DataStage, so I am not entirely familiar with the datatypes available within DataStage Server. I saw your message and realized we have run into the exact same thing so I am assuming the solution will be the same. Whereever you define your import and the incoming layout is where you should change the datatype. I am guessing that there are options that can be set for each incoming field, some generic options and some specific to the datatype, right?
In the Parallel version, a signed integer and an unsigned integer are treated as separate datatypes (like int and uint). Do you have this as well? Or there may be an option to select that says the input data in unsigned.
Sorry I can't be of more specific help. Maybe someone from the Server side can step in here and translate my PX-speak
Brad.
-
katerina_se
- Premium Member

- Posts: 9
- Joined: Thu Jan 15, 2004 8:49 am
</a>