Date: Sun, 11 Jul 2010 18:02:47 -0400
Reply-To: Lizette Koehler <starsoul@MINDSPRING.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Lizette Koehler <starsoul@MINDSPRING.COM>
Subject: Re: REvised: How to send a PROC REPORT using SAS EMAIL (with
code)
In-Reply-To: <0D1A8785-409D-46C3-BC93-4AD134C9823C@alumni.stanford.org>
Content-Type: text/plain; charset="us-ascii"
I am still a little manual under the PC. So I cut and paste the results
from the ODS output use EG.
However, under z/OS if I attach a file it works but not what I wanted. And
the format is not exactly what I want. It is close as an attachment, but
the headers and balancing of the columns is a little off. When I get this
working, I will be adding 3d and color to this report. It is for a manager
after all ;-D
So I was trying to create the report in the body of the email. Since I do
not use this process all that much, I cannot figure out how to get the PROC
REPORT results in ODS HTML and then have that in the body of the email
rather than an attachment. It is good as an attachment. Just not in the
body of the email (much like this text is).
Lizette
> -----Original Message-----
> From: Jack Hamilton [mailto:jfh@alumni.stanford.org]
> Sent: Sunday, July 11, 2010 5:35 PM
> To: Lizette Koehler
> Cc: SAS-L SAS-L
> Subject: Re: [SAS-L] REvised: How to send a PROC REPORT using SAS EMAIL
> (with code)
>
> Are you saying that when you run the same code under Windows the output
> appears in the message body, but when you run it under z/OS is appears
> as an attachment? That does seem odd. Does it open correctly as an
> attachment?
>
> What happens if you write directly to email instead of attaching the
> file?
>
>
> --
> Jack Hamilton
> jfh@alumni.stanford.org
> Caelum non animum mutant qui trans mare currunt.
>
>
>
>
> On Jul 11, 2010, at 14:18 , Lizette Koehler wrote:
>
> > I know how to send email when it is attached as a file. But how do I
> imbed
> > a SAS PROC REPORT output in the email? I can make it go via an
> attachment,
> > but I would prefer it to be in the body of the email itself.
> >
> >
> >
> >
> >
> >
> >
> > I have tried creating the PROC REPORT with OUT=emailit but the
> results
> > would need to be reformatted.
> >
> >
> >
> > Is there an easy way to get the results from the PROC REPORT into the
> body
> > of the email?
> >
> > Or do I just need to take the date from the OUT= in the PROC REPORT
> step and
> > then use PUT statements with HTML?
> >
> >
> >
> > This is running on a mainframe running z/OS V1.9 and SAS 9.1.3. I
> have been
> > working with ODS but it is not doing what I want.
> >
> >
> >
> > The proc report will display as:
> >
> >
> >
> > REPORT FOR CA PRODUCT USAGE
> >
> >
> >
> > CA
> >
> > SYSTEM PRODUCT
> >
> > DATE HOUR NAME CODE PRODUCT NAME
> >
> > -----------------------------------------------------------------
> >
> >
> >
> > 07JUL10 0 LPAR1 RS CA-RC/SECURE
> >
> > 08JUL10 0 LPAR1 RA CA-RECOVERY_ANALYZER
> >
> > RS CA-RC/SECURE
> >
> > RW CA-REPORT_FACILITY_FOR_TSO
> >
> > 09JUL10 0 LPAR1 RA CA-RECOVERY_ANALYZER
> >
> > RW CA-REPORT_FACILITY_FOR_TSO
> >
> >
> >
> >
> >
> > However, with OUT=newdsn they are just one liners and I would need to
> > reformat it to look like the above. If I use ODS with HTML, XML, RTF,
> or
> > LISTING it just does not display at all.
> >
> >
> >
> > I have done this process with PC quite successfully. However, doing
> this on
> > the Mainframe is proving more challenging. I have been reading the
> SUGI
> > papers and others, but cannot seem to work the magic.
> >
> >
> >
> >
> >
> > The code:
> >
> >
> >
> >
> >
> >
> >
> > SASHTML is a PDSE dataset with LREC=8196 and RECFM=VB. BODY will
> be the
> > member name
> >
> >
> >
> >
> >
> > DATA PC ;
> >
> > label ca_prod = 'CA Product Code'
> >
> > ca_prod_title = 'CA Product Name'
> >
> > ;
> >
> > INPUT Date JULIAN7. Hour
> >
> > LPAR $ CA_PROD $3. CA_PROD_TITLE $35. ;
> >
> > CARDS ;;
> >
> > 2010181 00 LPA1 RS CA-RC/SECURE
> >
> > 2010182 00 LPA1 RA CA-RECOVERY_ANALYZER
> >
> > 2010182 00 LPA1 RS CA-RC/SECURE
> >
> > 2010182 00 LPA1 RW CA-REPORT_FACILITY_FOR_TSO
> >
> > 2010183 00 LPA1 RA CA-RECOVERY_ANALYZER
> >
> > 2010183 00 LPA1 RW CA-REPORT_FACILITY_FOR_TSO
> >
> > ;
> >
> >
> >
> > proc sort ;
> >
> > by Date Hour lpar ;
> >
> >
> >
> > PROC PRINT ;
> >
> > id Date ;
> >
> > format Date date7. ;
> >
> >
> >
> > ODS HTML PATH=SASHTML(URL=NONE)
> >
> > BODY='BODY'(URL="BODY.HTML")
> >
> > rs=none
> >
> > ;
> >
> >
> >
> > PROC PRINTTO PRINT=CAPRODS ;
> >
> >
> >
> > PROC REPORT DATA=PC HEADLINE HEADSKIP ;
> >
> > COLUMN Date Hour LPAR CA_PROD CA_PROD_TITLE ;
> >
> > DEFINE Date / GROUP FORMAT=DATE7. ;
> >
> > DEFINE Hour / GROUP WIDTH=4 FORMAT=HOUR4.0 ;
> >
> > DEFINE LPAR / 'SYSTEM NAME' GROUP WIDTH=6 ;
> >
> > DEFINE CA_PROD / 'CA PRODUCT CODE' GROUP WIDTH=10 ;
> >
> > DEFINE CA_PROD_TITLE / 'PRODUCT NAME' GROUP WIDTH=30 ;
> >
> > RBREAK AFTER / UL ;
> >
> > TITLE1 'REPORT FOR CA PRODUCT USAGE ' ;
> >
> > ODS HTML CLOSE ;
> >
> >
> >
> > FILENAME MYMAIL EMAIL ;
> >
> > DATA _NULL_;
> >
> > FILE MYMAIL
> >
> > TO=('lkoehler@scana.com')
> >
> > SUBJECT='TESTING EMAIL FROM A SAS PROGRAM'
> >
> > ATTACH=("TSO.SAS.HTML(BODY)"
> >
> > EXT='HTM' TYPE='TEXT/HTML')
> >
> > ;
> >
> > PUT 'TESTING EMAIL USING SAS';
> >
> > RUN;
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Any help is appreciated.
> >
> >
> >
> >
> >
> > Lizette
|