Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Convert an Alphanumeric to a Float datatype

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Convert an Alphanumeric to a Float datatype
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: 3158
Location: Tucson AZ

PostPosted: Wed May 02, 2007 1:01 pm    Post subject:
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    Post subject:
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    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 Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am
No new posts Convert CLIST to REXX cvnlynn CLIST & REXX 12 Tue Jun 27, 2017 2:06 am
No new posts Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us