Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2009
    Posts
    3

    Question Unanswered: 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.

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

  3. #3
    Join Date
    May 2009
    Posts
    508
    Provided Answers: 1
    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.

  4. #4
    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

  5. #5
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •