BookmarkSubscribeRSS Feed
herbman
Obsidian | Level 7

Hello,

 

I have two different projects both can run correctly under HTML,  but when _odsdest had values defined as PDF and Word, somehow one can have right Word and PDF file generated and another was only with messy code displayed. I appreciate any help on how to fix the bad one. I compared all SAS macro variables and looked they are the same.

 

Thank you!

 

Limin Shu

%macro print;

%if %upcase(&_odsdest) eq PDF %then %do;
%let rc = %sysfunc(stpsrv_header(Content-type,application/vnd.pdf));
%let rc = %sysfunc(stpsrv_header(Content-disposition,attachment%str(;) filename=mypdf.pdf));
%let _odsdest=PDF;
%end;
%else %if %upcase(&_odsdest) eq HTML %then %do;
%let _odsdest=html;
%end;
%else %if %upcase(&_odsdest) eq HTML2WORD %then %do;
%let rc = %sysfunc(stpsrv_header(Content-type,application/msword));
%let rc = %sysfunc(stpsrv_header(Content-disposition,attachment%str(;) filename=report.doc));
%let _odsdest=RTF;
%end;

%STPBEGIN;

%Super_2pt;

%Plotout;

%STPEND;

%done:
%mend print;
%PRINT;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 0 replies
  • 402 views
  • 0 likes
  • 1 in conversation