STYLE=SASWEB or MINIMAL or anything else
STYLE element gives a predefined style. If you need customized styles you may need to use PROC TEMPLATE to edit the styles.
Actually I have detailed records in one ps file and the header record in one ps file.
The PS file containing the detailed records is processed from the SAS code which I have shown earlier in the above link provided.
The header record is just a normal PS file written manually with comma separated format.
I use SORT fields=copy and merge the above two dataset, then use one more SAS code to send mail of the resultant dataset.
Can I use the formats which you have mentioned in the SAS code that which sends mail....?
STYLE=SASWEB or MINIMAL or anything else
STYLE element gives a predefined style. If you need customized styles you may need to use PROC TEMPLATE to edit the styles.
Actually I have detailed records in one ps file and the header record in one ps file.
The PS file containing the detailed records is processed from the SAS code which I have shown earlier in the above link provided.
The header record is just a normal PS file written manually with comma separated format.
I use SORT fields=copy and merge the above two dataset, then use one more SAS code to send mail of the resultant dataset.
Can I use the formats which you have mentioned in the SAS code that which sends mail....?
So here is my code below where I have concatenated the detailed record and the Header record:
DATA NAMES;
INFILE MAILADDR;
INPUT
@001 NAME $CHAR60.
;
DATA _NULL_;
FILE EMAIL;
SET NAMES END=LAST;
LENGTH FIRSTNAME $20;
FIRSTNAME=SCAN(NAME,1,'.');
RETAIN FROMNAME ***@***.COM';
PUT '!EM_FROM!' FROMNAME;
PUT '!EM_TO!' NAME;
PUT '!EM_SUBJECT! sub name;
PUT 'Hi, ';
PUT ' ';
PUT 'PLEASE FIND ATTACHED.';
PUT '!EM_ATTACH!' "(***.***.FINAL.CNTRLM.RPT'
NAME='CONTROL-M DOCUMENT' CONTENT_TYPE='TEXT/CSV' EXT='CSV' )";
PUT ' ';
PUT '*************************************************************';
PUT 'Note : Please do not respond to this mail. ';
PUT 'It is automatically generated from an unattended Mailbox. ';
PUT '*************************************************************';
PUT '!EM_SEND!';
PUT '!EM_NEWMSG!';
IF LAST THEN PUT '!EM_ABORT!';
;
RUN;
/*
So where can I use the formatting in these two steps so that the header is highlighed.
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
Hello,
It all seems to make sense now..
Did not knew that the previous post was related to this one.
As I understand, now you are writing the required output to a dataset via the put statement: You are manually generating a CSV file.
Code:
PUT
@1 CHNGTYPE $3.
@4 C $1.
@5 JBNAME $8.
.
.
.
A better and easier solution would be, just comment out the PUT statement altogether & don't write the CSV file to a PS file.
Have this step after the DATA step. This code basically creates a XML formatted file similar to the PUT statement & writes it to a PS file WELLS.PS.FILE.LRECL-10000.RECFM-VB
After this step Have a SAS email step like the one below. This step emails the XML file WELLS.PS.FILE.LRECL-10000.RECFM-VB.
Code:
//emailstep EXEC SAS
//HTMLOUT DD DSN=WELLS.PS.FILE.LRECL-10000.RECFM-VB,DISP=SHR
//SYSIN DD *
FILENAME EMAIL EMAIL
FROM = ("wells@yolo.com")
TO = ("wells@yolo.com"
"wells2@yolo.com")
REPLYTO=("wells@yolo.com")
SUBJECT="This is a nice formatted instream email."
TYPE='TEXT/HTML';
DATA _NULL_;
FILE EMAIL;
INFILE HTMLOUT;
INPUT;
PUT _INFILE_;
RUN;
The above email step sends the report as instream email.
If you want the report as attachment, then there are small tunings on the EMAIL step with ATTACH keyword.
Hello,
It all seems to make sense now..
Did not knew that the previous post was related to this one.
As I understand, now you are writing the required output to a dataset via the put statement: You are manually generating a CSV file.
Code:
PUT
@1 CHNGTYPE $3.
@4 C $1.
@5 JBNAME $8.
.
.
.
A better and easier solution would be, just comment out the PUT statement altogether & don't write the CSV file to a PS file.
Have this step after the DATA step. This code basically creates a XML formatted file similar to the PUT statement & writes it to a PS file WELLS.PS.FILE.LRECL-10000.RECFM-VB
After this step Have a SAS email step like the one below. This step emails the XML file WELLS.PS.FILE.LRECL-10000.RECFM-VB.
Code:
//emailstep EXEC SAS
//HTMLOUT DD DSN=WELLS.PS.FILE.LRECL-10000.RECFM-VB,DISP=SHR
//SYSIN DD *
FILENAME EMAIL EMAIL
FROM = ("wells@yolo.com")
TO = ("wells@yolo.com"
"wells2@yolo.com")
REPLYTO=("wells@yolo.com")
SUBJECT="This is a nice formatted instream email."
TYPE='TEXT/HTML';
DATA _NULL_;
FILE EMAIL;
INFILE HTMLOUT;
INPUT;
PUT _INFILE_;
RUN;
The above email step sends the report as instream email.
If you want the report as attachment, then there are small tunings on the EMAIL step with ATTACH keyword.
Also in the Email step you have specified TYPE='TEXT/HTML' what does HTML mean here. is it relating to some webpage...? Also in the TO line can I specify a dataset containing the Email ID's obtained through REXX PANEL where the user specifies the email-id's to which the document has to be sent mail. can you show me how will the code in case of attachment.....
Hello,
It all seems to make sense now..
Did not knew that the previous post was related to this one.
As I understand, now you are writing the required output to a dataset via the put statement: You are manually generating a CSV file.
Code:
PUT
@1 CHNGTYPE $3.
@4 C $1.
@5 JBNAME $8.
.
.
.
A better and easier solution would be, just comment out the PUT statement altogether & don't write the CSV file to a PS file.
Have this step after the DATA step. This code basically creates a XML formatted file similar to the PUT statement & writes it to a PS file WELLS.PS.FILE.LRECL-10000.RECFM-VB
After this step Have a SAS email step like the one below. This step emails the XML file WELLS.PS.FILE.LRECL-10000.RECFM-VB.
Code:
//emailstep EXEC SAS
//HTMLOUT DD DSN=WELLS.PS.FILE.LRECL-10000.RECFM-VB,DISP=SHR
//SYSIN DD *
FILENAME EMAIL EMAIL
FROM = ("wells@yolo.com")
TO = ("wells@yolo.com"
"wells2@yolo.com")
REPLYTO=("wells@yolo.com")
SUBJECT="This is a nice formatted instream email."
TYPE='TEXT/HTML';
DATA _NULL_;
FILE EMAIL;
INFILE HTMLOUT;
INPUT;
PUT _INFILE_;
RUN;
The above email step sends the report as instream email.
If you want the report as attachment, then there are small tunings on the EMAIL step with ATTACH keyword.
Also if I add this below code instead of PUT in the SAS code how will give the length for each field and calculation made for each field using CATX....
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
You don't need the CATX steps as well.
In your original approach
1. You read some data from external file
2. Append some spaces using CATX.
3. Write the appended values into output ps file.
4. read the output file in email step
In the approach that I am suggesting,
1.Read the file
2. create XML file using ODS.
3. email the file.