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 

FTP - DB2 UDB - Mainframe compatible data types

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


Joined: 30 Jan 2007
Posts: 14
Topics: 8

PostPosted: Sun Nov 04, 2007 2:21 pm    Post subject: FTP - DB2 UDB - Mainframe compatible data types Reply with quote

Hi All,

I have a requirement where in i need to receive a file from UNIX. There is one table in DB2 UDB sitting on the UNIX box, which will be unloaded on a daily basis and will be sent it across to the mainframe. The table contains the below mentioned data types
1. Bigint - size 8 bytes
2. Smallint - size 2 bytes
3. Varchar
4. Decimal

To define my copybook in mainframe, i need to know the compatible data types on mainframe. Could anybody let me know those details?

Thanks
Haritha
Back to top
View user's profile Send private message
dr_te_z
Beginner


Joined: 08 Feb 2007
Posts: 18
Topics: 3

PostPosted: Mon Nov 05, 2007 3:59 am    Post subject: Reply with quote

Do not try to walk that road:"using native database formats and expect them to be handled well during 'unload/ftp/ascii ebcdic translation / load' process"

Guide your data trough that process. Use "cast" to flatten (is that english?) your data into readable format. Simple: if a human can read it a computer can easaly translate it to another code-set. DB2-SQL offers a rich syntax to cast to-and-from CHAR in your unload/load jobs.
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 Nov 05, 2007 10:42 am    Post subject: Reply with quote

haritha_e,


Here are the equivalent data types

BIGINIT = S9(10) through S9(18 ) COMP which is a Binary double-word (8 bytes)
SMALLINT = S9(1) through S9(4) COMP Binary half-word (2 bytes)
VARCHAR = will contain 2 components the length field and the actual field size.
Code:
 
01 varcharcol
   49 varcharcol-len-LEN      PIC S9(4) USAGE COMP.
   49 varcharcol-text         PIC X(???).


DECIMAL = Comp-3 (packed decimal)
DECIMAL(i+d,d) = S9(i)V9(d) COMP-3

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
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities 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