Hi Everyone, I have below sample program, which basically download the xlsx file on webbrowser via sasweb(sas/intrnet).
** Test 2: create xlxs file; ods excel file=_webout style=plateau; data _null_; rc=appsrv_header('Content-type','application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); rc=appsrv_header('Content-disposition','attachment; filename=test2.xlsx'); run; proc print noobs label data=sashelp.class; run; ods excel close;
I need to use this sample in mainframe dataset having 72-character length dataset as default. Since as above rc= value is more than 72 characters, so I thought to use into variable by defining into %let,but looks like macro variable is not resolving currectly. Can someone help me, what I am doing wrong. Error message is atatched.
options symbolgen; %let string1="appsrv_header('Content-type','application/vnd.openxml"; %let string2="formats-officedocument.spreadsheetml.sheet')"; %let string3=appsrv_header('Content-disposition','attachment;; %let string4=filename=test2.xlsx'); ods excel file=_webout style=plateau; data _null_; rc=&string1.&string2.; rc=&string3.&string4.; run; proc print noobs label data=sashelp.class; run; ods excel close;
Error message:
33 +options symbolgen;
34 +%let string1="appsrv_header('Content-type','application/vnd.openxml";
35 +%let string2="formats-officedocument.spreadsheetml.sheet')";
36 +%let string3=appsrv_header('Content-disposition','attachment;;
37 +%let string4=filename=test2.xlsx');
38 +ods excel file=_webout style=plateau;
39 +data _null_;
40 +rc=&string1.&string2.;
SYMBOLGEN: Macro variable STRING1 resolves to "appsrv_header('Content-type','application/vnd.openxml"
SYMBOLGEN: Macro variable STRING2 resolves to "formats-officedocument.spreadsheetml.sheet')"
41 +rc=&string3.&string4.;
SYMBOLGEN: Macro variable STRING3 resolves to appsrv_header('Content-disposition','attachment;;%let string4=filename=test2.xlsx')
SYMBOLGEN: Unable to resolve the macro variable reference &string4
41 +rc=&string3.&string4.;
The SAS System
--------
22
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant, a missing value, arrayname, (, +, -, INPUT, NOT, PUT, ^, _NEW_, ~.
41 +rc=&string3.&string4.;
--------
201
ERROR 201-322: The option is not recognized and will be ignored.
WARNING: Apparent symbolic reference STRING4 not resolved.
... View more