The SAS Output Delivery System and reporting techniques

Convert file to PDS thru JCL

Reply
N/A
Posts: 0

Convert file to PDS thru JCL

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
Super Contributor
Posts: 291

Re: Convert file to PDS thru JCL

Posting "deleted"

Message was edited by: Bill Message was edited by: Bill
N/A
Posts: 0

Re: Convert file to PDS thru JCL

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
N/A
Posts: 0

Re: Convert file to PDF thru JCL

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
N/A
Posts: 0

Re: Convert file to PDF thru JCL

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_ CLOSESmiley Wink
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
N/A
Posts: 0

Re: Convert file to PDS thru JCL

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.
Ask a Question
Discussion stats
  • 5 replies
  • 760 views
  • 0 likes
  • 2 in conversation