Hi....I am trying to create a pdf file and when the program has finished running, there is no ouput or the file hasn't been created. I inserted a RUN Statement as suggested in the log and it still won't create the file......any suggestions how to correct this...Thanks
1012 QUIT;
1013 RUN;
1014 ODS PDF CLOSE;
NOTE: ODS PDF printed no output.
(This sometimes results from failing to place a RUN statement before the ODS PDF
CLOSE statement.)
1015 ODS LISTING;
1016 ODS RESULTS;
You might want to show all of the code between your ODS PDF statement and the ODS PDF CLOSE;
Also if you leave the ODS LISTING, since it appears you may have turned that off, open do you get results?
Hi....I re-ran the same code with slightly different data and it works. I was able to determine that in the previous query run that no output or file was created because theresults from the qyuery produced no data and therefore no output. Is it possible to have a pdf file created even though there might not be any output for the pdf file since I would still like for the title and footnotes to be displayed in the pdf file.
If you are using SAS Title and Footnote statements the default behavior is to include them on all output until changed. If you have no output at all going to the destination that's going to be bit tricky. We'll need more of the code you are using to recommend options.
HI:
Generally, if you don't have any observations, a procedure will not run. And therefore, no titles or footnotes will be created. Many people will write a macro program to test the existence of a file or the number of observations in the file. If they discover that output will not be created, then one way of dealing with this situation is to run a "dummy" PROC PRINT with an error message so that an output file will be created. If this is what you need, then I know there have been previous postings about this type of program. I think a search in the Communities Forum should net you some examples.
cynthia
Hi Ballardw.....Here is the code that I am using.....thanks
ODS _ALL_ CLOSE;
ODS LISTING CLOSE;
ODS NORESULTS;
OPTIONS ORIENTATION=PORTRAIT CENTER NODATE NONUMBER NOBYLINE
TOPMARGIN=".5IN"
BOTTOMMARGIN=".5IN"
LEFTMARGIN=".5IN"
RIGHTMARGIN=".5IN";
%LET RSTR = %STR( );
%LET TSTR = %SYSFUNC(REPEAT(&RSTR,50));
ODS ESCAPECHAR='^';
ODS PDF FILE="%sysfunc(pathname(project))\&FILENAME Report (&rundate).PDF" STYLE=JOURNAL NOTOC BOOKMARKGEN=NO BOOKMARKLIST=NONE;
TITLE1 JUSTIFY=CENTER BOLD HEIGHT=12PT FONT="Arial" "Client History";
TITLE2 " ";
TITLE3 JUSTIFY=LEFT HEIGHT=9PT FONT=Arial "Client Name: &NAME" JUSTIFY=RIGHT "Report Date From: &FROMDATE";
TITLE4 JUSTIFY=LEFT HEIGHT=9PT FONT=Arial "ID #: &ID" JUSTIFY=RIGHT "Report Date End: &TODATE";
TITLE5 " ";
TITLE6 "^{style[bordertopwidth=2px bordertopcolor=black] &tstr}";
PROC REPORT DATA=SUMMARY NOWD HEADLINE HEADSKIP MISSING ps=43 ls=108
STYLE(REPORT)={frame=box}
STYLE(HEADER)={font_weight=bold background=lightgrey font_face=Arial
font_size=8pt borderwidth=1px bordercolor=black just=CENTER}
STYLE(COLUMN)={background=white font_face=Arial font_size=7pt borderwidth=1px
bordercolor=black just=CENTER}
STYLE(LINES)={JUST=C FONT_WEIGHT=BOLD FONT_SIZE=11PT};
FOOTNOTE1 HEIGHT=7pt FONT=Arial JUSTIFY=LEFT "NOTE: The information contained in this Report is intended to be received by the Requestor: &cmedoff.”;
COLUMN (PURCHASE_DATE CLIENT_SURNAME CLIENT_GIVEN PROD_NUMB PROD_NAME METRIC_QTY);
DEFINE PURCHASE_DATE / DISPLAY 'Purchase Date';
DEFINE CLIENT_SURNAME / DISPLAY 'Client Surname';
DEFINE CLIENT_GIVEN / DISPLAY 'Client First Name';
DEFINE PROD_NUMB / DISPLAY 'Product Number' STYLE(COLUMN)={TAGATTR='00000000'};
DEFINE PROD_NAME / DISPLAY 'Product Name';
DEFINE METRIC_QTY / DISPLAY 'Quantity';
RUN;
QUIT;
ODS PDF CLOSE;
ODS LISTING;
ODS RESULTS;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.