View previous topic :: View next topic
|
Author |
Message |
rajatbagga
Active User
Joined: 11 Mar 2007 Posts: 199 Location: india
|
|
|
|
Hello,
I am trying the read the data from the file IN1 and want to put it as it is in the email body and email it via SAS. I am using the JCL below but I am not getting the email body data in the same format, However i am getting the email.
Code: |
//STEP1 EXEC SAS
//IN1 DD *
###############################################################
THE BATCH MILESTONES HAVE BEEN PROUDLY BROUGHT TO YOU BY: ##
########################################### ##
########################################### RAJAT BAGGA ##
########################################### ##
###############################################################
/*
//SYSIN DD *
FILENAME MAIL EMAIL
FROM = "BATCH MILESTONE REPORT <RAJAT.BAGGA@EMAIL.COM>"
TO = "RAJAT.X.BAGGA@EMAIL.COM"
SUBJECT = "TEST EMAIL FROM SAS"
CONTENT_TYPE = "TEXT/HTML"
// DD *
IMPORTANCE = "HIGH"
// DD *
;
DATA MLREP; INFILE IN1;
INPUT @1 LINE_DATA $CHAR80.;
RUN;
DATA _NULL_;
FILE MAIL;
INFILE IN1;
INPUT;
PUT _INFILE_;
RUN;
/*
|
Present output (email body)
Code: |
############################################################### THE BATCH MILESTONES HAVE BEEN PROUDLY BROUGHT TO YOU BY: ## ########################################### ## ########################################### RAJAT BAGGA ## ########################################### ## ############################################################### |
Expected output should as in the instream :-
Code: |
###############################################################
THE BATCH MILESTONES HAVE BEEN PROUDLY BROUGHT TO YOU BY: ##
########################################### ##
########################################### RAJAT BAGGA ##
########################################### ##
###############################################################
|
Please assist.
Regards,
Rajat |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Change to
Code: |
CONTENT_TYPE = "TEXT/PLAIN" |
|
|
Back to top |
|
|
rajatbagga
Active User
Joined: 11 Mar 2007 Posts: 199 Location: india
|
|
|
|
Hello Rohit,
thanks, I tried this already but the output in this case will be :-
Code: |
###############################################################
THE BATCH MILESTONES HAVE BEEN PROUDLY BROUGHT TO YOU BY: ##
########################################### ##
########################################### RAJAT BAGGA ##
########################################### ##
###############################################################
|
I want he expected output to be :-
Code: |
###############################################################
THE BATCH MILESTONES HAVE BEEN PROUDLY BROUGHT TO YOU BY: ##
########################################### ##
########################################### RAJAT BAGGA ##
########################################### ##
###############################################################
|
Thanks Rajat |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
I hope you do realize that the expected output you want is not possible, at least not in the way you want it to be. The font for the email is controlled by the email client, NOT by the mainframe. If you change your email font to Courier then you'll get fixed-width characters; the default (as you have seen) is proportional-width characters. This is not an option under mainframe control - it is ENTIRELY the email client. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
Try this gimmicky code
Code: |
//STEP1 EXEC SAS
//IN1 DD *
Hey I just met you
And this is crazy
But here s my number
So call me maybe
It s hard to look right at you baby
But here s my number
So call me maybe
/*
//SYSIN DD *
FILENAME EMAIL EMAIL
FROM = ("vasanthz@trolland.com")
TO = ("vasanthz@trolland.com")
REPLYTO=("vasanthz@trolland.com")
SUBJECT="SOME SAMPLE TEST REPORT"
CONTENT_TYPE = "text/html"
// DD *
IMPORTANCE = "HIGH"
// DD *
;
data _null_;
file email;
infile in1 end=last;
INPUT;
IF _N_ = 1 THEN DO;
put '<html>';
put '<head>';
put '<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">';
put '</head>';
put '<body>';
put '<b>';
put '<span style="font-size: 12pt;';
put 'font-family: "Courier","serif";">';
END;
put _INFILE_;
put '<br>';
IF LAST THEN DO;
put '</body>';
put '</html>';
END;
run;
/* |
|
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
Back to top |
|
|
rajatbagga
Active User
Joined: 11 Mar 2007 Posts: 199 Location: india
|
|
|
|
vasanthz wrote: |
Try this gimmicky code
Code: |
//STEP1 EXEC SAS
//IN1 DD *
Hey I just met you
And this is crazy
But here s my number
So call me maybe
It s hard to look right at you baby
But here s my number
So call me maybe
/*
//SYSIN DD *
FILENAME EMAIL EMAIL
FROM = ("vasanthz@trolland.com")
TO = ("vasanthz@trolland.com")
REPLYTO=("vasanthz@trolland.com")
SUBJECT="SOME SAMPLE TEST REPORT"
CONTENT_TYPE = "text/html"
// DD *
IMPORTANCE = "HIGH"
// DD *
;
data _null_;
file email;
infile in1 end=last;
INPUT;
IF _N_ = 1 THEN DO;
put '<html>';
put '<head>';
put '<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">';
put '</head>';
put '<body>';
put '<b>';
put '<span style="font-size: 12pt;';
put 'font-family: "Courier","serif";">';
END;
put _INFILE_;
put '<br>';
IF LAST THEN DO;
put '</body>';
put '</html>';
END;
run;
/* |
|
Hello vasanthz, Thanks for the code, infact i tried a similar code already and it does changes the font size to 12pt and font to courier however the spaces are lost in the transition. Meaning i still get the same output even though the font is changed.. I don't know if it is possible to retain the spaces, it is just squeezing up all the spaces to 1 space.
Regards, Rajat
Output with your code:-
Code: |
###############################################################
THE BATCH MILESTONES HAVE BEEN PROUDLY BROUGHT TO YOU BY: ##
########################################### ##
########################################### RAJAT BAGGA ##
########################################### ##
###############################################################
|
Regards, Rajat |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Why do you need SAS desperately anyways to send emails? There are simpler other ways to do it. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
Well,certainly SAS is easier than most of them. It is flexible, powerful. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
IEBGENER, This is mostly used everywhere based on my experience and forum discussion which is very easy, less coding, no need to know SAS and powerfull. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
This one works fine. Made changes to font.
Code: |
//STEP1 EXEC SAS
//IN1 DD *
Hey I just met you
And this is crazy
But here s my number
So call me maybe
It s hard to look right at you baby
But here s my number
So call me maybe
/*
//SYSIN DD *
FILENAME EMAIL EMAIL
FROM = ("vasanthz@trolland.com")
TO = ("vasanthz@trolland.com")
REPLYTO=("vasanthz@trolland.com")
SUBJECT="SOME SAMPLE TEST REPORT"
CONTENT_TYPE = "text/html"
// DD *
IMPORTANCE = "HIGH"
// DD *
;
data _null_;
file email;
infile in1 end=last;
INPUT;
IF _N_ = 1 THEN DO;
put '<html>';
put '<body>';
put '<pre style="font: monospace">';
END;
put _INFILE_;
IF LAST THEN DO;
put '</pre>';
put '</body>';
put '</html>';
END;
run; |
|
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
Quote: |
IEBGENER, This is mostly used everywhere based on my forum experience and forum discussion which is very easy, less coding, no need to know SAS and powerfull. |
Guess it is just personal preference. Or maybe I am biased by my joy in SAS programming. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Yeah, could be.
I hope what you suggested works or TS better be switching over to something else than wasting time around SAS programming unless force to do only by SAS and that's came someone called LEAD. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
I wonder why everybody is wasting time on a stupid cosmetics issue |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
The question isn't why but why not. Finer touches add value. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
enrico-sorichetti wrote: |
I wonder why everybody is wasting time on a stupid cosmetics issue |
In modern LUW programming, whether the application fails is irrelevant; what counts is whether it fails prettily. We're just trying to get the legacy systems down to that standard |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
what counts is whether it fails prettily |
Yeah? I've been dealing with a Java dump trace in a z/OS MF function -- and that is NOT pretty no matter how much paint you slap on that pig! |
|
Back to top |
|
|
rajatbagga
Active User
Joined: 11 Mar 2007 Posts: 199 Location: india
|
|
|
|
vasanthz wrote: |
This one works fine. Made changes to font.
Code: |
//STEP1 EXEC SAS
//IN1 DD *
Hey I just met you
And this is crazy
But here s my number
So call me maybe
It s hard to look right at you baby
But here s my number
So call me maybe
/*
//SYSIN DD *
FILENAME EMAIL EMAIL
FROM = ("vasanthz@trolland.com")
TO = ("vasanthz@trolland.com")
REPLYTO=("vasanthz@trolland.com")
SUBJECT="SOME SAMPLE TEST REPORT"
CONTENT_TYPE = "text/html"
// DD *
IMPORTANCE = "HIGH"
// DD *
;
data _null_;
file email;
infile in1 end=last;
INPUT;
IF _N_ = 1 THEN DO;
put '<html>';
put '<body>';
put '<pre style="font: monospace">';
END;
put _INFILE_;
IF LAST THEN DO;
put '</pre>';
put '</body>';
put '</html>';
END;
run; |
|
Thanks a LOT, This works perfectly well, and Yeah this is off course the test data, I have lot of other stuff which needed to be displayed one below the other in the body of the email so the alignment of data was really very important.
Now its looking all good.
Coming onto selection of SAS, Well i am reading the data and depending on the data/stat I want to email I am marking the importance of the email as IMPORTANCE = "HIGH" !! , this is not possible to achieve in the normal SMTP/IEBGENER scenario.
Thanks Again,
Regards,
Rajat |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
How about IMPORTANCE : HIGH for IEBGENER? |
|
Back to top |
|
|
|