BookmarkSubscribeRSS Feed
G_I_Jeff
Obsidian | Level 7

I'm getting nowhere fast. I have simple mainframe data that I want to chart, simple bar chart will do, and send via SMTP on z/OS. I've been playing around with the CHART and ODS but not getting anywhere. Does anyone perform this? Can you throw me a bone??

7 REPLIES 7
ballardw
Super User

An example of what you have been trying would be helpful.

Cynthia_sas
SAS Super FREQ

Yes, I agree. Seeing the code the OP is trying will be most helpful. And, the OP also has to know whether the z/OS startup options for SAS and SMTP are set correctly.

  This (older) note shows some of the options:

http://support.sas.com/kb/19/767.html

  Next, knowing what the preferred type of output is (HTML, RTF, PDF) for the email will help. Since it is a GRAPH image being sent, one downside of HTML is that you can't really embed an image in an HTML file (because HTML uses an <IMG> tag to point to the image location). I'd recommend the OP try out ODS PDF or ODS RTF -- RTF is a simple text file format and the image is converted to RTF image format; while PDF is a proprietary format and the image is also converted to PDF format -- but proprietary format. Look at Example 3 for sending an RTF file using z/OS: http://support.sas.com/kb/23/636.html

  This paper shows sending ODS HTML output using z/OS -- but with a text report, no graphs (http://www2.sas.com/proceedings/sugi30/170-30.pdf). And, here are some other papers and notes:

http://support.sas.com/kb/24/972.html

http://support.sas.com/kb/24/181.html

http://support.sas.com/kb/6/735.html

  If the OP searched on support.sas.com, there are probably other Tech Support notes and/or examples. Otherwise, since setting the startup options might require cooperation from a SAS administrator or systems (mail) person, another alternative is for the OP to open a Tech Support note, so someone in Tech Support can work with the mail/SAS person to make sure the startup options are correctly set.

  my .02 in bone currency,

cynthia

G_I_Jeff
Obsidian | Level 7

Cynthia/ballardw - yes I should have included an example of what I'm trying to do. I've changed my code so much to try different things.

Here is essentially what I'm trying to accomplish.

I have z/OS performance data from MXG in the following order:

(CECSER SYSTEM DATE HOUR PARTNCPU AVGCPU MAXCPU TOTCPU NRCPUS AVGZIP MAXZIP TOTZIP NRZIPCPU AVGPLAT TOTPLAT)

All I want to do (to start with) is create a simple bar chart, charting avgcpu by hour. Simple. I've attached a simple PDF I created from Excel to show what I'm trying to accomplish.

I am unclear on how to set the CHART procedure to accomplish this.

And yes, I can use the PDF format for ODS. Never used ODS at this point either. You can tell I'm brand new at SAS.....

Essentially I want to create a stacked chart with two of the variables above (avgcpu/avgzip) by hour for each system, output to PDF, then e-mail groups all from the mainframe SMTP.

Cynthia - thank you for the links. I will review them.

Regards,

Jeff

G_I_Jeff
Obsidian | Level 7

Ok, I have the basic CHART procedure working:

PROC CHART DATA=USER.xxxxxx;

VBAR AVGCPU / DISCRETE TYPE=PERCENT;

     BY HOUR;

WHERE SYSTEM='xxxx';

This produces a basic chart with the correct axis. Now I would like to incorporate the chart into the body of an e-mail. I have the e-mail functionality working. I would like to stay away from creating a PDF and attaching it to the e-mail though.

Jeff

Cynthia_sas
SAS Super FREQ

Hi:

  I'm confused...are you using PROC CHART or PROC GCHART??? Given the look that you want, I would expect you to be using PROC GCHART.

  It was my understanding that it was hard to "embed" images in email messages and that usually, your images/graphs were either embedded in RTF and/or PDF files and those were mailed as attachments; or you created a standalone image and attached the jpeg, png or gif image to a mail; or you made an HTML file and attached the HTML file and the image file to the email.

  Given what you want to do and the fact that Tech Support can actually test something on the mainframe based on your code, I would recommend that you work with Tech Support on this question.

cynthia

G_I_Jeff
Obsidian | Level 7

Cynthia,

I am initially working with the CHART procedure just to make sure I get the chart looking the way I want it. I figure that I would convert to the GCHART procedure and wrap the ODS statement around it. I actually tried the ODS HTML around the CHART procedure and e-mailed it, but it came out garbage. So now my question is basically can I send a bar chart created by the SAS procedure CHART/GCHART in an ODS format that will retain the chart? I would almost HAVE to believe someone is doing this already.

Jeff

Cynthia_sas
SAS Super FREQ

Hi:

  I wouldn't expect PROC CHART output to survive being sent very well. ODS RTF and ODS PDF are both output destinations in which the image you create is actually embedded in the RTF or PDF file. I believe that if you create ODS PDF, you may have to send the attachment as binary, but this would be something to check with Tech Support. If you use ODS HTML and make an ODS HTML file that contains an <IMG> tag, then you will need to attach both the HTML file and the graph file(s) that is referenced in the <IMG> tag.

  Many people do send email via SMTP. I believe that your best resource for this question is SAS Tech Support.

cynthia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 2556 views
  • 0 likes
  • 3 in conversation