COBOL PIC 9(18) COMP Complex Flat File Conversion Problem

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
katerina_se
Premium Member
Premium Member
Posts: 9
Joined: Thu Jan 15, 2004 8:49 am

COBOL PIC 9(18) COMP Complex Flat File Conversion Problem

Post by katerina_se »

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
bcarlson
Premium Member
Premium Member
Posts: 772
Joined: Fri Oct 01, 2004 3:06 pm
Location: Minnesota

Post by bcarlson »

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.
katerina_se
Premium Member
Premium Member
Posts: 9
Joined: Thu Jan 15, 2004 8:49 am

Post by katerina_se »

Thank you, we could have only positive values, but please clarify your recommendation: change the format in Cobol or in DataStage and to what?
bcarlson
Premium Member
Premium Member
Posts: 772
Joined: Fri Oct 01, 2004 3:06 pm
Location: Minnesota

Post by bcarlson »

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 :wink:

Brad.
katerina_se
Premium Member
Premium Member
Posts: 9
Joined: Thu Jan 15, 2004 8:49 am

Post by katerina_se »

Thank you again, but unfortunately there are no separate datatypes (like int and uint) for Server 7.5 only Integer, SmallInt and BigInt and I already tried all of them.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

If you right-mouse click on the column and "edit row" you will come to a screen where you can specify more details on the column. Make sure that the USAGE is indeed COMP and that your sign indicator is unsigned.
Post Reply