Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2014
    Posts
    2

    Unanswered: .txt file formats

    Hi,

    I have data that is in the form of a fixed width .txt file. This .txt file was created using DB2. I am trying to read this file into SAS, I do not have DB2 to work with. These files have char, smallint, decimal, and date external fields on them.

    I've gotten these files before, and read in the character fields as EBCDIC and numeric fields as packed decimals. These were sent using DB2 Version 8. Since then they've updated to DB2 Version 10.

    Now the character fields look like EBCDIC when opened in a text editor but read into sas as just ASCII. The numeric fields I have had no luck with. They claim nothing was changed in the output process to .txt just the update to the new version of DB2.

    Did something change between those 2 versions of DB2 that would affect this? I don't have the process of how the .txt file was made so sorry for the lack of info. Is there a standard form used in DB2 when creating .txt files? And how would they read in a PC environment?

    Thanks for the help

  2. #2
    Join Date
    Apr 2014
    Posts
    2

    .txt file formats

    Hi,

    I have data that is in the form of a fixed width .txt file. This .txt file was created using DB2. I am trying to read this file into SAS, I do not have DB2 to work with. These files have char, smallint, decimal, and date external fields on them.

    I've gotten these files before, and read in the character fields as EBCDIC and numeric fields as packed decimals. These were sent using DB2 Version 8. Since then they've updated to DB2 Version 10.

    Now the character fields look like EBCDIC when opened in a text editor but read into sas as just ASCII. The numeric fields I have had no luck with. They claim nothing was changed in the output process to .txt just the update to the new version of DB2.

    Did something change between those 2 versions of DB2 that would affect this? I don't have the process of how the .txt file was made so sorry for the lack of info. Is there a standard form used in DB2 when creating .txt files? And how would they read in a PC environment?

    Thanks for the help

  3. #3
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    I presume db2 mainframe
    data is exported in ebcdic
    transfer file to unix/linux/windows
    use dd to convert to ascii (check google convert ebcdic ascii unix)
    use whatever command/tool (cat,vi..)to display/edit the file
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

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