MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Conversion of numeric to DB2 Compatible Integer or Small Int

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
prabhutp
Beginner


Joined: 02 Feb 2005
Posts: 20
Topics: 11

PostPosted: Mon Mar 28, 2005 11:12 am    Post subject: Conversion of numeric to DB2 Compatible Integer or Small Int Reply with quote

Hi

I need to convert numeric to integer or smallint in cobol.This will be used in the loading of a table. Can anybody please help me out!!!!Apart from the length check Its the conversion from numeric to small int or integer which is troubling me!!!!!!
_________________
tp
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Mar 28, 2005 11:40 am    Post subject: Reply with quote

prabhutp,

A smallint in db2 is equivalent to s9(04) comp in cobol and an INTEGER in DB2 is equivalent to S9(09) comp in cobol. Define your variables accordingly and move your numeric values into them.

Check this link which explains the equivalent SQL and COBOL data types

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNAPH11/2.4.3.7?SHELF=&DT=20010710165542&CASE=

Hope this helps..

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
prabhutp
Beginner


Joined: 02 Feb 2005
Posts: 20
Topics: 11

PostPosted: Mon Mar 28, 2005 12:07 pm    Post subject: Reply with quote

Hi

Thanks for the instant reply...I need to load my external file into a DB2 Table.This file is declared as X(1000)..So What I was looking at is converting my numeric field to Small Int or Integer Format and then straightly place it in the output file and load the table.Is it possible?Kindly explain
_________________
tp
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group