Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004
    Posts
    19

    Unanswered: Fixed File Export

    hey

    Im trying to (from a command line) direct output to a file with a fixed format.
    Initially what I have done is padded all of my field strings with the correct number of blank spaces. Therefore if i could output each field side by side with no spaces inbetween them in one continuous string, that would be ideal. The closest thing I have got to this is exporting with DEL format, but then i would have to remove all of the quotations and commas with some program but my superiors do not want me to do this.

    I have also tried piping my results to a file but im unsure how to make each field a specific length.

    I am looking, i guess, for one of two answers

    1) How can I output all fields in one continuous string without any spaces inbetween?

    2) If i am just using standard output (or piping) how do i make a specific field a constant specified length?

    Thank you

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    If you do a select * and pipe the data to a file, the output length of each column will be fixed, although there will be spaces between the columns. The number of spaces between the columns may depend on the column heading (name), even if column headings are surpressed. You can then import the data using "non delimited ascii" format. You can use the graphical mapper to figiure out the starting and ending column postions of each item.
    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
    Aug 2004
    Posts
    19
    >>You can then import the data using "non delimited ascii" format. You can
    >>use the graphical mapper to figiure out the starting and ending column
    >>postions of each item.


    Could you please explain how to import using non delimited ascii format. And possibly give a little information regarding the graphical mapper. I have never used these tools before

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Using the Control Center, right click on the table name and select "import" Then select the "non delimited ascii" radio button. Then select the "columns" tab, and you can use the graphical mapper to define the starting and ending postion of each column. You will need to specify the data file where the data resides (the result of the "select *").
    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
  •