BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,
I'm very much a newbie to SAS.
I have a sequential file of data on the IBM mainframe. I am using SAS within JCL to email the output to me. It arrives in text format.
Is there anyway I can use a very, very basic sas routine in my JCL to convert the file to PDF, so I can email the file in pdf file format?
Thanks,
Steve
5 REPLIES 5
Bill
Quartz | Level 8
Posting "deleted"

Message was edited by: Bill Message was edited by: Bill
deleted_user
Not applicable
there will be Samples in the Knowledge Base http://support.sas.com/resources which demonstrate sending email directly from SAS on an IBM mainframe. One usage note raised to clarify changed handling between SAS8 and SAS9 relates to email attachment content types ... see http://support.sas.com/kb/14/361.html.

The ODS PDF destination should prepare your data (created through proc print?), and after closing that destination, a data step should make sending the PDF straightforward..... see the examples

Good Luck

peterC
deleted_user
Not applicable
Hi Bill and Peter,

I have scoured the SAS knowledge database, but have not had any luck.
I have tried tampering with my email send using the job below....

//STEP4 EXEC SAS,REGION=4M
//SYSIN DD *
FILENAME MYMAIL EMAIL "GDD324@toms.com.au"
TO=("GDD324@toms.com.au")
SUBJECT="Code Reviews etc"
ATTACH=("GDD324.COBOL.LISTING"
NAME="COBOL CODE in text format"
EXT="TXT")
ATTACH=("cobollst/cobollist.pdf"
NAME="COBOL CODE in PDF format"
EXT="PDF")
RUN;
DATA _NULL_;
FILE MYMAIL;
ods listing off;
ods pdf file="cobollst/cobollist.pdf";
proc print;
run;
ods close _all_;
---------------

I get quite a few errors... some of these are:

ERROR: Error in the FILENAME statement.
ERROR 23-2: Invalid option name RUN.
ERROR 22-322: Syntax error, expecting one of the following: EXCLUDE, SE
ERROR 76-322: Syntax error, statement will be ignored.
14 ods pdf file="cobollst/cobollist.pdf";
ERROR: Unable to open filename cobollst/cobollist.pdf. ODS PDF initiali
ERROR: Unable to resolve current directory: UNIX Services MVS: No such file or directory exists. Reason code: 00000000.
ERROR: Physical file does not exist, GDD324.MYMAIL.DATA.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: The DATA statement used 0.03 CPU seconds.
15 proc print;
ERROR: There is not a default input data set (_LAST_ is _NULL_).
16 run;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: The PROCEDURE PRINT used 0.00 CPU seconds.
17 ods close _all_;
ERROR 180-322: Statement is not valid or it is used out of proper order

--------------------------

Still a little confused.... how does my COBOL program get threaded through to the cobollst/cobollist.pdf file? Or will ODS do this automagically?

Thanks for your help!

Steve
deleted_user
Not applicable
there used to be a problem when there was more than one attachment. I don't know if the platform inconsistency over ATTACH syntax was fixed. So that might be your FILENAME problem.

You have the wrong idea for the data step and those ODS statements.
Place those ODS statements which define the Listing and PDF, before the step which fills these files. (and follow those creation steps with ODS _all_ CLOSE;)
Your datastep that sends the email, needs no ODS but does need to write to the email file: something like: [pre] data _null_ ;
file mymail ;
put 'message body goes here.' ;
put 'good luck.' ;
run;[/pre]
That should take you forward.
Among the samples for MVS or ZOS did you see something like [pre] TRANTAB= ASCII [/pre] I think it belongs on the file or filename statements, but may be more relevant to the ODS PDF or ATTACH= definitions. Wherever it goes, you probably need something to tell the mainframe not to do EBCDIC to ASCII translation of the at least the PDF attachment.

You have quite a lot of issues still, to complete the whole picture. I'm surprised that what you seek is not part of the Samples for the platform /ODS. I think it is certainly needed.

Lots of Luck

PeterC
deleted_user
Not applicable
The TRANTAB=ASCII option is not required for PDF output, even when created on the mainframe. But you WOULD need it for (say) RTF. There may be something about how PDF documents are processed that renders EBCDIC meaningless.

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
  • 5 replies
  • 1972 views
  • 0 likes
  • 2 in conversation