Joined: 14 Mar 2008 Posts: 74 Location: India,Chennai
I have an work in which I have to send an report in csv format (in mail). The report was mailed successfully. But in the report, for certain columns the leading zeros are suppressed. Is there any way we can retain the leading zeros. Can any one help me in this?
Are the leading zeros in the file before it is sent? If not, change the program generating the csv file to include the leading zeros. If they are there, then whatever is being done AFTER the report is received is getting rid of the leading zeros -- and you'll have to work with the report recipient to fix the issue.
but the CSV attachment doesnt have the leading zeros
How do you know this? If the mainframe report file has leading zeroes, there is nothing in the SMTP mail process that would strip them out. Have you brought the attachment up in Notepad (or other text editor) and looked at the raw data transferred?
You are not being clear with what you say. What does "alphanumeric data" mean to you -- typically, in COBOL (for example), alphanumeric data will NOT have leading zeros since it will be left-justified, filled with spaces to the right. Numeric data, depending upon the PICTURE clause used, will be justified to the decimal point (whether explicit or implicit) and will have leading zeros (unless they are suppressed).
It makes absolutely no sense to say
alphanumeric data (with leading zeros)
since this cannot happen in COBOL, nor in most other languages.
From the very beginning:
1. What are you using to verify the data looks correct on the mainframe BEFORE THE EMAIL IS SENT?
2. What are you using the verify the data looks correct AFTER THE EMAIL IS SENT?
3. What does "in the CSV report" mean -- mainframe? PC? Unix? before the email is sent? after the email is sent?
It is YOUR responsibility to be absolutely clear about what your problem is, and so far from what you have posted there is not even a problem to be looked at. You have not told us how you know the csv attachment does not have the leading zeros -- if you are looking at it via Excel, for example, Excel will automatically suppress leading zeros unless told not to. But you cannot even tell us that you're looking at the attachment with Excel.
Please -- either completely and totally describe every step of the process and why you think there is a problem with it, or stop wasting our time by refusing to post requested information.