BookmarkSubscribeRSS Feed
Inp
Obsidian | Level 7 Inp
Obsidian | Level 7
Hi Dear,
I have created a pdf file from the mainfram, then I am trying to sent as attachment as pdf file, but I couldn't. Can any one please help me out. I am able to send as text file but not able to send a pdf file. Here is my JCL.For security reason, I change the mailserver ip address and email name. Thank you for help in advance.

Thanks

Inpu
//RST EXEC SAS,
// OPTIONS='EMAILHOST=qq.9.22.10',OUT=ICOUT
//DATA1 DD DSN=SB900.GIPRIC.VQ959.PDFTESTX,
// DISP=SHR
//SASLIST DD SYSOUT=A
//SASLOG DD SYSOUT=A
//SYSIN DD *
FILENAME TEMP EMAIL 'ANTON.roger@vista.COM'
SUBJECT='TESTING MAIL INTERFACE'
TYPE='TEXT/PLAIN'
ATTACH=("VQRRR.DUPSAS.VQ959.PDFTESTX" NAME='TEST REPORT'
EXTENSION='PDF');
DATA _NULL_;
FILE TEMP;
PUT 'THIS IS TESTING';
RUN;
8 REPLIES 8
Cynthia_sas
SAS Super FREQ
Hi:
You might check out the documentation or companion for your operating system. This document has some e-mail examples:
http://support.sas.com/rnd/base/ods/templateFAQ/MVSODS3.pdf

Perhaps Tech Support can be of more help, if this doesn't resolve your problems.

cynthia
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
It is unclear from your post - exactly what problem are you experiencing? Also, how are you generating the PDF document on the z/OS mainframe system? Is the problem / error with opening the attachment when received by your EMAIL client, or possibly the EMAIL is not being received at all? And what SAS version are you running?

Scott Barry
SBBWorks, Inc.
Inp
Obsidian | Level 7 Inp
Obsidian | Level 7
Hi
when I Ftp this fileI(VQ959.VQ3.PDFTESTX) as pdf with binary format , I am able to view from adobe reader, but when I email the file(JCL and SAS coding attached) to my Lotus notes email application and open it , then it pop up the following message.

Adobe Reader couldn't open "VQ3.PDFTEST.PDF" because it either not a supported file type or because the file has been damaged(for example , it was sent as an email attachment and wasn't correctly decoded).

Since I was not able to open from lotus notes, I saved in my c drive, and then I try to open it , and I got the same error message.

Please note that my
Mainfram SAS is version 8.2

I need this help big time,

My JCL for creating PDF file is follows

//*--------------------------------------------------------------------
//SCRATCH2 EXEC PGM=RESTART,
// PARM='VQ959.VQ3.PDFTESTX'
//*--------------------------------------------------------------------
//*********************************************************************
//STEP1 EXEC SAS
//PDFTEST DD DSN=VQ959.VQ3.PDFTESTX,
// DISP=(NEW,CATLG,DELETE),UNIT=PUBLIC,
// DCB=(RECFM=VB,LRECL=259,BLKSIZE=27998),
// SPACE=(TRK,(5,5),RLSE)
//SYSIN DD DATA,DLM=##
***************************************
OPTIONS ERRORABEND MISSING=' ' ;

DATA MASTER;
INPUT @1 REC $CHAR30.;
CARDS;
aaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbb
cccccccccccccccccc
dddddddddddddddddd
eeeeeeeeeeeeeeeeee
;
RUN;

OPTIONS ORIENTATION=LANDSCAPE;
OPTIONS PAPERSIZE=LEGAL;
OPTIONS LS=138;
OPTIONS NODATE NONUMBER ;


ODS LISTING CLOSE;
ODS PDF FILE=PDFTEST;
PROC PRINT DATA=MASTER;
FORMAT REC $CHAR30.;
RUN;
ODS PDF CLOSE;
ODS LISTING;

ENDSAS;
##


My jcl for email is as follows

//********************************************
//RST EXEC SAS,
// OPTIONS='EMAILHOST=11.0.72.99',OUT=ICOUT
//DATA1 DD DSN=VQ959.VQ3.PDFTESTX,
// DISP=SHR
//SASLIST DD SYSOUT=A
//SASLOG DD SYSOUT=A
//SYSIN DD *
FILENAME TEMP EMAIL 'ANTON@ROGERS.COM'
SUBJECT='TESTING MAIL INTERFACE'
TYPE='TEXT/PLAIN'
ATTACH=("VQ959.VQ3.PDFTESTX"
EXTENSION='PDF');
DATA _NULL_;
FILE TEMP;
PUT 'THIS IS TESTING';
RUN;
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
I ran your code in SAS 9.1.3 SP4 and it worked -- I was able to open the EMAIL attachment with no problem. So, you may want to consider SAS HOTFIX maint to address known PDF related problems on z/OS with SAS 8.2, or look at upgrading to a more current (and supported) SAS version.

Scott Barry
SBBWorks, Inc.
deleted_user
Not applicable
PDF files are not text files, but you have coded ‘TYPE=TEXT/PLAIN’. Try ‘TYPE=APPLICATION/PDF’.
Inp
Obsidian | Level 7 Inp
Obsidian | Level 7
Hi Bobmorley,
I tried by putting TYPE='APPLICATION/PDF' but it doesn't work,


Thanks

Inp
deleted_user
Not applicable
I’ve just checked my working code, and you want the original TYPE=’TEXT/PLAIN’ on the FILENAME statement itself and the suggested TYPE=APPLICATION/PDF’ goes inside the ATTACH.

Thinking about this, you want the body of the email as text but the attachment has different characteristics.
Inp
Obsidian | Level 7 Inp
Obsidian | Level 7
Hi Bobmorley2,
Thank you so much. When I put type=application /pdf inside the attachement , it didn't work, but when I put CT=APPLICATION/PDF it work fine. Finally you get me thorough. Thanks so much Bobmorley2 and other people who try to help me for this issue.


Thanks again guys.

regards

Inp

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 2778 views
  • 0 likes
  • 4 in conversation