BookmarkSubscribeRSS Feed
harshpatel
Quartz | Level 8

Hello Folks,

I am trying to run the below code in SAS Studio in SAS Viya

data _null_;
rc = appsrv_header('Content-type','application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
rc = appsrv_header('Content-disposition','attachment; filename=test.xlsx');
run;

ods excel file = _webout ;


title "&title";
proc print data=sashelp.class;
run;
ods excel close;

But it is showing error that 

Program error.
68-185: The function APPSRV_HEADER is unknown, or cannot be accessed.

Actually i want to link this code with my graphs to download the excel file.

Please help

 

Regards,

Harsh Patel

2 REPLIES 2
harshpatel
Quartz | Level 8

Thank You for your answer.

But what is the solution of my question whether i could download the excel file with this code or any alternate code?

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Develop Code with SAS Studio

Get started using SAS Studio to write, run and debug your SAS programs.

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