IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Email sending in JCL as excel attachment.


IBM Mainframe Forums -> PC Guides & IT News
Post new topic   This topic is locked: you cannot edit posts or make replies.
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
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

Moderator Emeritus


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

PostPosted: Mon Dec 15, 2008 10:00 pm
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Dec 16, 2008 8:39 am
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

Moderator Emeritus


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

PostPosted: Tue Dec 16, 2008 8:43 am
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
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
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

Moderator Emeritus


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

PostPosted: Tue Dec 16, 2008 9:52 am
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
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

Moderator Emeritus


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

PostPosted: Tue Dec 16, 2008 11:15 am
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Dec 16, 2008 5:55 pm
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: 2481
Location: @my desk

PostPosted: Tue Dec 16, 2008 8:54 pm
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
nani821

New User


Joined: 07 Nov 2022
Posts: 4
Location: India

PostPosted: Wed Nov 16, 2022 10:00 pm
Reply with quote

Hi All,

Pleas help me to send a mail with excel attachment. I am using the IEBGENER with below code, but its sending the text mail only without attachment.

HELO TSOM.uboc.com
MAIL FROM: <XXXXY@XXX.COM>
RCPT TO: <XXXXY@XXX.COM>
DATA
FROM: <XXXXY@XXX.COM>
SUBJECT :"Data Excel"
--boundary_characters
CONTENT-TYPE: application/msexcel;
name= "data.xls"
Content-Transfer-Encoding: 64bit
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Thu Nov 17, 2022 12:09 am
Reply with quote

nani821 wrote:
Hi All,

Pleas help me to send a mail with excel attachment. I am using the IEBGENER with below code, but its sending the text mail only without attachment.

HELO TSOM.uboc.com
MAIL FROM: <XXXXY@XXX.COM>
RCPT TO: <XXXXY@XXX.COM>
DATA
FROM: <XXXXY@XXX.COM>
SUBJECT :"Data Excel"
--boundary_characters
CONTENT-TYPE: application/msexcel;
name= "data.xls"
Content-Transfer-Encoding: 64bit


Make it a new topic in this forum.

And: do not place it into the "Mainframe Jobs" section!!!
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Thu Nov 17, 2022 11:12 am
Reply with quote

Locked and please don’t tailgate old posts. Instead as directed start a new post.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PC Guides & IT News

 


Similar Topics
Topic Forum Replies
No new posts Converting fixed length file to excel... IBM Tools 7
No new posts mail attachment with excel format All Other Mainframe Topics 2
No new posts REXX to send an email in Mainframe wi... CLIST & REXX 3
No new posts REXX to send an email in Mainframe CLIST & REXX 4
No new posts Problem while sending special charact... JCL & VSAM 4
Search our Forums:

Back to Top