Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Convet SmallInt value to Numeric by using DB2 function

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
SHAILESH OZA

New User


Joined: 10 Jun 2005
Posts: 21
Location: Mumbai

PostPosted: Thu Dec 22, 2011 4:21 pm    Post subject: Convet SmallInt value to Numeric by using DB2 function
Reply with quote

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
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Dec 22, 2011 4:37 pm    Post subject: Re: Need to convet SmallInt value to Numeric by using DB2 fu
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Dec 22, 2011 4:40 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts What is the Extract Function in JCL dharmaraok JCL & VSAM 3 Wed Jun 14, 2017 9:12 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us