View previous topic :: View next topic |
Author |
Message |
haritha_e Beginner
Joined: 30 Jan 2007 Posts: 14 Topics: 8
|
Posted: Sun Nov 04, 2007 2:21 pm Post subject: FTP - DB2 UDB - Mainframe compatible data types |
|
|
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 |
|
 |
dr_te_z Beginner
Joined: 08 Feb 2007 Posts: 18 Topics: 3
|
Posted: Mon Nov 05, 2007 3:59 am Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Mon Nov 05, 2007 10:42 am Post subject: |
|
|
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 |
|
 |
|
|