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
 

 

How to select FLOAT type column from a table in to flat file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Mon Oct 25, 2010 8:33 pm    Post subject: How to select FLOAT type column from a table in to flat file
Reply with quote

Dear Experts,

I have column with a datatype "FLOAT" in a DB2 table.

I like to unload the specified columns along with this FLOAT datatype column into a flat file (all other columns are alpha-numeric).

Please suggest me ,
how to write the query ?
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Oct 25, 2010 8:44 pm    Post subject:
Reply with quote

what is your problem?

do you want to 'convert' cast the float column to something else,
or do you want to have a receiving field defined as float?
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Oct 26, 2010 2:53 pm    Post subject:
Reply with quote

Once you answer the questions Dick has, M K K, this link might interest you: Equivalent SQL and COBOL data types.
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Tue Oct 26, 2010 3:31 pm    Post subject:
Reply with quote

Dear dbzTHEdinosauer,

In the table column is defined as float.
If I write the Query like

SELECT col1, col2
FROM table-name

Col2 is of datatype FLOAT, The values unloaded from a table to flat file are not readable format, How to achieve this ??
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Oct 26, 2010 3:35 pm    Post subject:
Reply with quote

That means:
Quote:
you want to 'convert' cast the float column to something else
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Oct 26, 2010 4:02 pm    Post subject:
Reply with quote

Quote:
The values unloaded from a table to flat file are not readable format


that is not true. you don't know how to read it
and it seems that you are not going to try.

if the required results are to be just a display type of report,
do as Anuj suggested and cast to another numeric datatype - that you can read

if the data is to be used as input to a program and the integrity of the value is of concern,
suggest you leave it as float,
and define it as such in the program processing the file.

you should also take the novel approach of reading the manual
concerning the loss of precision when casting float datatype columns.
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


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