View previous topic :: View next topic
|
Author |
Message |
SHAILESH OZA
New User
Joined: 10 Jun 2005 Posts: 21 Location: Mumbai
|
|
|
|
Hi
I am trying to Unload the data from DB2 table to Flat File using Unload Utility. While doing the Unload, I need to convert a field from SMALLINT data type from DB2 to Numeric value of 4 digit PIC 9(4) of corresponding cobol Clause.
I tried to use the Cast Function like CAST(Field name) As Interger and CAST(Field name) As decimal (4,0) But I am getting the value as ...
Is there any way to get the result as a numeric. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
SHAILESH OZA wrote: |
Hi
I am trying to Unload the data from DB2 table to Flat File using Unload Utility. While doing the Unload, I need to convert a field from SMALLINT data type from DB2 to Numeric value of 4 digit PIC 9(4) of corresponding cobol Clause.
I tried to use the Cast Function like CAST(Field name) As Interger and CAST(Field name) As decimal (4,0) But I am getting the value as ...
Is there any way to get the result as a numeric. |
Isn't this a DB2 question, not a Cobol question? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
everyday i see proof,
that if you only used the correct terminology,
you could find the answer, yourself.
DB2 numeric data type SMALLINT is Binary
Decimal is PACKED-DECIMAL.
both are numeric.
COBOL PIC 9(4) DISPLAY is for all intents and purposes, an alphanumeric field.
The corresponding DB2 data type is CHAR.
and when you say:
value as ...
only shows how very very little you know. you should have posted in the beginners' forum
and not have wasted our time here. |
|
Back to top |
|
|
|