If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > How to FTP pack decimal data field to PC?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-05-09, 08:20
nnescafe nnescafe is offline
Registered User
 
Join Date: Aug 2009
Posts: 3
Question How to FTP pack decimal data field to PC?

I have a database file on AS/400 which consists of some pack decimal data and would like to download to PC as ASCII text. I try to use FTP command to do it and use convert table from EBCEDIC to ASCII, but still can not read those pack decmial data field.

Anyway, if I try to use Data transafer on Client access to transfer. It's look ok, the pack decimal data value can transfer to ASCII type as zone decimal.

Ex. my data in pack value is length 19,0 when transfer to ASCII I can see the nice value with actual length 19 digits.

Who know the way to solve. Kinldy, please advise me.
Thank you so much.
Reply With Quote
  #2 (permalink)  
Old 08-05-09, 08:28
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
If the data is in DB2 for iSeries (DB2/400) then do a connection from your PC using DB2 Windows client to the remote iSeries db, and do an export to your PC (after connecting to the database, do "db2 export to file-name of DEL select * from table-name".

You can use IXF or DEL format. You will need a license for DB2 Connect to make a connection from your PC using DB2 client for Windows to the iSeries database.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #3 (permalink)  
Old 08-05-09, 08:43
Stealth_DBA Stealth_DBA is offline
Registered User
 
Join Date: May 2009
Posts: 472
nnescafe, I am going to assume that your database file was unloaded from a DB2 table. If this is correct, does the unload you are using have an EXTERNAL format option? If it does, this will convert the packed decimal into a readable (character numbers) format that you can FTP and Load to the PC without any problems.

If you don't have the EXTERNAL format option, you can (probably) do the conversion in the SELECT with a Function on the column(s) to get character numbers as output.
Reply With Quote
  #4 (permalink)  
Old 08-05-09, 21:39
nnescafe nnescafe is offline
Registered User
 
Join Date: Aug 2009
Posts: 3
Question

Thank you for you all reply.

My database is DB2 on OS/400 which created by RPG language.

Now I use the command FTP of OS/400 to connect the PC and transfer the database directly, is it need to prepare the file by converting the pack decimal data into character number before transfer?

Thanks
Reply With Quote
  #5 (permalink)  
Old 08-06-09, 02:11
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Quote:
Originally Posted by nnescafe
Thank you for you all reply.

My database is DB2 on OS/400 which created by RPG language.

Now I use the command FTP of OS/400 to connect the PC and transfer the database directly, is it need to prepare the file by converting the pack decimal data into character number before transfer?

Thanks
What I suggested is that you use the DB2 for Windows client to connect to the OS/400 database, and do an export from the DB2 Windows Command Line. This will convert all the EBCIDIC data to ASCII in a format that DB2 for Linux, UNIX, Windows can use and place the data in the export file.

If you intend to load the data to DB2 for Linux, UNIX, Windows then I would recommend doing the export with IXF format. If you need the data for some other purpose, then do a DEL format. Check the Command Reference for info on the EXPORT command (DB2 for Linux, UNIX, Windows).

You will need a DB2 Connect License in order to connect from DB2 Windows client to the OS/400 database.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On