The SAS Output Delivery System and reporting techniques

re: ODS PDF Error: No Ouput

Reply
Regular Contributor
Posts: 221

re: ODS PDF Error: No Ouput

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;

Grand Advisor
Posts: 10,204

Re: re: ODS PDF Error: No Ouput

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?

Regular Contributor
Posts: 221

Re: re: ODS PDF Error: No Ouput

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.

Grand Advisor
Posts: 10,204

Re: re: ODS PDF Error: No Ouput

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.

SAS Super FREQ
Posts: 8,717

Re: re: ODS PDF Error: No Ouput

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

Regular Contributor
Posts: 221

Re: re: ODS PDF Error: No Ouput

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;

Ask a Question
Discussion stats
  • 5 replies
  • 1282 views
  • 6 likes
  • 3 in conversation