Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Sending CSV file in mail.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PC Guides & IT News
View previous topic :: :: View next topic  
Author Message
passion_sujesh

New User


Joined: 14 Mar 2008
Posts: 74
Location: India,Chennai

PostPosted: Tue Dec 14, 2010 9:10 pm    Post subject: Sending CSV file in mail.
Reply with quote

Hi,

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?

Sujesh.
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Tue Dec 14, 2010 9:34 pm    Post subject: Reply to: Sending CSV file in mail.
Reply with quote

Use a different format (possibly .slk?) for the data layout. Or, use some reverse-engineering logic and see if there is a way with .csv.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7908
Location: Bellevue, IA

PostPosted: Tue Dec 14, 2010 9:37 pm    Post subject:
Reply with quote

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.
Back to top
View user's profile Send private message
passion_sujesh

New User


Joined: 14 Mar 2008
Posts: 74
Location: India,Chennai

PostPosted: Tue Dec 14, 2010 10:01 pm    Post subject: Reply to: Sending CSV file in mail.
Reply with quote

The MF report file has leading zeros in them, but the CSV attachment doesnt have the leading zeros. Please help

Thanks,
Sujesh
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7908
Location: Bellevue, IA

PostPosted: Tue Dec 14, 2010 10:20 pm    Post subject:
Reply with quote

Quote:
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?
Back to top
View user's profile Send private message
passion_sujesh

New User


Joined: 14 Mar 2008
Posts: 74
Location: India,Chennai

PostPosted: Tue Dec 14, 2010 10:28 pm    Post subject: Reply to: Sending CSV file in mail.
Reply with quote

In the CSV report if the colum has alphanumeric data (with leading zeros), the leading zeros are present. But if the column has numeric data all the leading zeros are suppresed.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7908
Location: Bellevue, IA

PostPosted: Tue Dec 14, 2010 10:45 pm    Post subject:
Reply with quote

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
Quote:
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.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Dec 14, 2010 10:46 pm    Post subject: Re: Reply to: Sending CSV file in mail.
Reply with quote

passion_sujesh wrote:
In the CSV report if the colum has alphanumeric data (with leading zeros), the leading zeros are present. But if the column has numeric data all the leading zeros are suppresed.


What are you using to view the CSV file that is leading you to the conclusion that the leading zeros are missing?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Dec 14, 2010 10:55 pm    Post subject:
Reply with quote

Hello,

Suggest you look at the csv file after the download using a simple text editor. The leading zeros will be in place.

Then you need to look at how this file is imported - and probably change the way the fields are defined for the import.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Dec 14, 2010 11:00 pm    Post subject:
Reply with quote

ms excel strikes again.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Tue Dec 14, 2010 11:11 pm    Post subject: Re: Reply to: Sending CSV file in mail.
Reply with quote

passion_sujesh wrote:
In the CSV report if the colum has alphanumeric data (with leading zeros), the leading zeros are present. But if the column has numeric data all the leading zeros are suppresed.

Try prefixing these data with a single quote. This should indicate to Excel that what looks like a number is in fact a string.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PC Guides & IT News All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us