IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Convert an Alphanumeric to a Float datatype


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
neelus.s

New User


Joined: 05 Apr 2007
Posts: 4
Location: Minneapolis

PostPosted: Wed May 02, 2007 12:02 pm
Reply with quote

Hi All,

I have two fields in a PS file which are alphnumeric.
The data in these 2 fields have to be loaded into a DB2 table. The datatype of these 2 fields in the DB2 table is FLOAT.

This conversion have to be done in a COBOL program as per the requirement.
Sample data:
Field-1 : 48.67634567 (There is a space after this data in the file which indicates it as a positive field)
Field-2: -67.78897678

Pleas help me

Regards,
Neelima
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed May 02, 2007 1:01 pm
Reply with quote

Convert the number to a numeric and load it.
Look at the NUMVAL intrinsic.
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Wed May 02, 2007 1:43 pm
Reply with quote

Have you created DCLGEN for this table. I you did then it will declare the variable as equivalent COBOL variable. Move the alphanumeric field in to the COBOL variable and load the table.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
No new posts convert file from VB to FB and use tr... DFSORT/ICETOOL 8
No new posts Convert HEX to Numeric DB2 3
Search our Forums:

Back to Top