Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hello,
Is this 2 separate questions? If yes, please post the second question as a new topic. If no, you need to clarify how the second post relates to the first. . .
Quote:
the leading zeros are removed..
By Excel or in the file that is transferred? If the mainframe removes the leading zeros, change the file create code. If Excel removes the zeros, you may need to work with the "import" to specify that you want to keep the zeros. Most of the Windows apps remove leading zeros for numeric fields. If you use a text field, you should be able to retain the zeros (as long as they are in the file).
The mainframe file has the leading zeros. but while the Excel attachment is creating via the JCL, the leading zeros are removed as the the numbers take Numeric field as default. But I need it to take Text field.
How can i specify this.... I ve tried giving text/plain in Content Type, Content Disposition etc... but nothing works..
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hello,
Are you clicking on the file to open it?
If yes, start Excel from the menu or an icon. Then, import the file and when the import gives you the chance to define the fields, define the fileds that are losing the leading zeros as text rather than numeric.
This needs to be done as part of the inport rather than after the file is loaded into the spreadsheet.
U method of opening the Excel file from the Start menu & selecting the Text option is working fine.... But the mail is to be sent to a group of clients,... & we cant tell them to open this way..... so i am trying ways to make it open in text format by default itself...
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hello,
Quote:
But the mail is to be sent to a group of clients,... & we cant tell them to open this way.
No, that would not make them happy. . .
Have you tried the method Robert suggested (placing quotes around these values)? If single-quotes don't work, try the double-quote.
How soon does this need to be in production? As a last resort, you could e-mail the file to yourself, import/format the data, and then send it to the client distribution. Not attractive, but might buy a little time to work on alternative if the production deadline is near. The problem is that once implemented, it may not be corrected and this would become a long-term waste. . .
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
I tested with quotes and Excel took them as numbers anyway. I've kept the leading zeroes but only by putting "' (double quote mark followed by tic mark) before the value and " (double quote mark) after the value. This preserves the leading zeroes but the tic mark shows up.
It sounds like you need to pose a question to Microsoft's Excel people about how to do what you want.