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
 

 

Email sending in JCL as excel attachment.

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

New User


Joined: 01 Sep 2008
Posts: 32
Location: chennaii

PostPosted: Mon Dec 15, 2008 2:34 pm    Post subject: Email sending in JCL as excel attachment.
Reply with quote

HI

I am able to send Email with an Excel attachment successfully. The problem is if the data is plain number.. the leading zeros are removed..

I want the numbers to be displayed as 000089 instead of just 89.

Please help me in solving this issue.
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: Mon Dec 15, 2008 10:00 pm    Post subject:
Reply with quote

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

New User


Joined: 01 Sep 2008
Posts: 32
Location: chennaii

PostPosted: Tue Dec 16, 2008 8:21 am    Post subject: Reply to: Email sending in JCL as excel attachment.
Reply with quote

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

Global Moderator


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

PostPosted: Tue Dec 16, 2008 8:39 am    Post subject:
Reply with quote

Have you tried putting quotes around the numbers with the leading zeros? This will make them text fields.
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 16, 2008 8:43 am    Post subject:
Reply with quote

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

New User


Joined: 01 Sep 2008
Posts: 32
Location: chennaii

PostPosted: Tue Dec 16, 2008 8:49 am    Post subject:
Reply with quote

Robert I will try ur way.. & will tell u if it works
Back to top
View user's profile Send private message
kothai

New User


Joined: 01 Sep 2008
Posts: 32
Location: chennaii

PostPosted: Tue Dec 16, 2008 9:39 am    Post subject:
Reply with quote

dick scherrer,

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...

Anywayz thanks for the solution
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 16, 2008 9:52 am    Post subject:
Reply with quote

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. . . icon_smile.gif

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

New User


Joined: 01 Sep 2008
Posts: 32
Location: chennaii

PostPosted: Tue Dec 16, 2008 10:57 am    Post subject:
Reply with quote

Robert... ,

Moving single quote or double quote enclosing the numbers doesnt make it as text... instead the quote themselves were displayed at the output..

I tried MOVE ' " ' to PRE-FILLER & POST-FILLER &

MOVE " ' " to PRE-FILLER & POST-FILLER
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 16, 2008 11:15 am    Post subject:
Reply with quote

Hello,

If your delimited data is like:
Code:
AAA,000555,DDD,01234
this is when the values show as 555 and 1234 in Excel (rather than 000555 and 01234)?

Try changing the file to
Code:
AAA,'000555',DDD,'01234'

or
Code:
AAA,"000555",DDD,"01234"
and see if the values are handled properly.

It you can copy/paste a few of your records (nothing proprietary please), i'll try to run an experiment in the morning.
Back to top
View user's profile Send private message
kothai

New User


Joined: 01 Sep 2008
Posts: 32
Location: chennaii

PostPosted: Tue Dec 16, 2008 11:21 am    Post subject:
Reply with quote

Hi...

I changed the code the same ways u have specified
but the quotes (be it single or double) are displayed

"AAA"
"BBB"
"CCC"

or like

'AAA'
'BBB'

in each cell of the excel
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Dec 16, 2008 5:55 pm    Post subject:
Reply with quote

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

Moderator


Joined: 17 Oct 2006
Posts: 2180
Location: @my desk

PostPosted: Tue Dec 16, 2008 8:54 pm    Post subject:
Reply with quote

Robert,

Even a single quote before the numeric field does the same.
Code:
'00123,AA,'00234
icon_sad.gif
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 Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm
No new posts Reading data from PS file and send it... rajatbagga All Other Mainframe Topics 18 Fri Sep 23, 2016 12:51 pm
No new posts How to sending system service request... lind sh IMS DB/DC 5 Sun Apr 10, 2016 12:02 am
No new posts How to send email with Rich Text usin... santhosh5983 JCL & VSAM 4 Fri Apr 08, 2016 2:30 am
No new posts Issue in sending zip file as mail att... ajithajt JCL & VSAM 8 Thu Apr 07, 2016 9:11 am


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