Cobol PIC X field to MS Excel cell

  • boo 23 Mar 2005 11:47:08 13,901 posts
    Seen 7 days ago
    Registered 18 years ago
    Bit sad, but anybody familiar with these two? I'm fine on the Cobol, but don't understand Excel.

    I've got a PIC X(6) containing numeric data which gets ported over to Excel just fine.
    But there's also a PIC X(20) field, also with numeric data, and Excel treats this like a large numeric and puts it in as an overflow, i.e. 81211111000000000000 comes out as 8.12222 E+19.

    I'm not doing any math with the fields, I just need them ported straight over.
    The Excel fields have a format of 'General'.

    /wishes he's never agreed to test this for the 'mad genius of Tech Support'
  • Deleted user 23 March 2005 15:34:57
    Format them as text maybe?
  • mal 23 Mar 2005 16:25:13 29,326 posts
    Seen 4 years ago
    Registered 20 years ago
    boo wrote:
    But there's also a PIC X(20) field, also with numeric data, and Excel treats this like a large numeric and puts it in as an overflow, i.e. 81211111000000000000 comes out as 8.12222 E+19.

    I'm not doing any math with the fields, I just need them ported straight over.
    But 8.12222E+19 is 81222200000000000000, which is the same as 81211111000000000000, give or take. I expect the data is getting ported over fine, it's just a presentation issue.

    /doesn't really know excel. Doesn't really know what a PIC X is, or how it would releate to COBOL.
  • unwashed 23 Mar 2005 16:26:49 1,857 posts
    Seen 14 years ago
    Registered 18 years ago
    Boo: Excel is just displaying the number using scientific notation. When you click on the cell you should see the original number (to 14 places) in the entry bar at the top of Excel. If you must see it as entered in the spread sheet then format the cell as a number.
Sign in or register to reply

Sometimes posts may contain links to online retail stores. If you click on one and make a purchase we may receive a small commission. For more information, go here.