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

Need Rexx/DB2 Program to send mail as XLS attachment


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Divakar R

New User


Joined: 19 Feb 2013
Posts: 9
Location: India

PostPosted: Sun Feb 24, 2013 7:39 pm
Reply with quote

We have a requirement to retrieve few rows from DB2, and to generate an email attachment as XLS file. Also Needs to know how to run it in test environment?

I'm a beginner in REXX programming. And also I know how to do it in jcl, Here I need to code only in REXX.


Please advise on how to code this kind of Programs.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Sun Feb 24, 2013 8:03 pm
Reply with quote

You will make the most out of the question You ask
when dealing with <common> issues related to the zOS platform

asking how to code from scratch an application is out of the bounds of forum questions

usually we gladly share our experience on problems we have faced ( and usually also quickly )

chances to receive specific advice for this kind of requirements are usually pretty slim

also the problem should not have been assigned to a beginner

anyway if You really have the need proceed for stages and little steps

usin DSNREXX start fetching the rows You need,
google on how how to create using REXX an XML file
googlr on how to send an EMAIL with attachment using REXX or ...
better involve the powers of Your organization in order to INSTALL the
XMITIP package ( google for it )
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: Sun Feb 24, 2013 9:07 pm
Reply with quote

XLS is a specific file format which Microsoft uses over 1000 pages to describe. You would be MUCH better off either (1) getting your site to buy a package that runs on the mainframe to generate XLS files, or (2) write comma-delimited data and let Excel convert the comma-delimited data to XLS.

There is much, both on this forum and the Internet, on doing what you want -- yiou need to spend some time doing research.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Mon Feb 25, 2013 9:19 am
Reply with quote

Hi Divakar,

You don't need rexx to do this. I don't understand why even rexx is needed.

What you need is,
1. Unload data in a CSV/External format, which would open the file in excel when the attachment is double clicked.
2. A JCL step to send an mail, which you can ask your support team.

As the size of the email attachment gets bigger, it is not advisable to send that much of data through an email from mainframe, in that case you may have to FTP it to a specific location.

Thanks,
Sushanth
Back to top
View user's profile Send private message
Divakar R

New User


Joined: 19 Feb 2013
Posts: 9
Location: India

PostPosted: Mon Feb 25, 2013 10:23 am
Reply with quote

Hi Sushanth,

Thanks for your reply.

Here as they are following the same from so long. They don't want me to change the way they are. Can anyone atleast tell me how to execute REXX in Test environment? Even in the pgm , We have arg parm receiving thru JCL.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Mon Feb 25, 2013 11:47 am
Reply with quote

Hi Divakar,

Below are couple of links pointing to more links which would answer your question,

JCL To Execute A REXX Program

How to execute REXX code

Quote:
Can anyone atleast tell me how to execute REXX in Test environment?

If you are working in a Plex environment, you would have production in a different plex and development in different plex, so if you have your rexx code in dev plex and run it there, means you are running your code in test environment, there is nothing like SSID in DB2 where you specify the environment, you want to run the program in.

If your are working in a multi-Lpar system, where production and development are in different lpar, same thing applies as above, if you have your rexx code in test lpar and run it there, means you are running your code in test environment

Let me know if i have misunderstood your question.

Regards,
Sushanth
Back to top
View user's profile Send private message
Divakar R

New User


Joined: 19 Feb 2013
Posts: 9
Location: India

PostPosted: Tue Feb 26, 2013 2:11 pm
Reply with quote

Hi Sushanth,

Yes, We are working in a multi-Lpar system, where production and development are in different lpar.

As of now, I can able to run REXX pgm. Thanks alot.
In our project we dont have any Debuggers, Is there any way to debugg REXX pgms? If so, Can you kindly expalin (apart from displays) ?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Feb 26, 2013 2:16 pm
Reply with quote


  1. Write Good Code
  2. Check all Return Codes etc
  3. Enrico has provide very nice examples of "wrappers" for different "environments"
  4. Use Trace in its variants
  5. If you still feel the need for a debugger, your program is either too complicated, or not good enough
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Feb 26, 2013 2:17 pm
Reply with quote

if You had cared to look at the manuals You would have discovered the wonders of the
TRACE statement icon_cool.gif
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 Feb 26, 2013 6:37 pm
Reply with quote

hello and welcome to the forum,

Quote:
Here as they are following the same from so long.
Why not simply clone one that already works and modify for your requirement?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top