BookmarkSubscribeRSS Feed
saspert
Pyrite | Level 9

Hi,

I have a stored process code in the following format -

*ProcessBody;

%include "/sasdev/.../sas_parms.sas";

LIBNAME TEST ORACLE  PATH=&SASLIBPATH SCHEMA=&SASLIBSCHEMA USER=&SASLIBUSERID password="&SASLIBPW";

%include '/sasdev/.../excltags.sas';

%macro _createpage;

.....put statements writing javascript code

put '<form name="my_form"';
put ' method="post"';
put ' action="http://sasdev.myclient.com:8080/SASStoredProcess/do" >';

put '<input type="hidden"';
put ' name="_program"';
put ' value="//Foundation/BIP
Tree/ReportStudio/Shared/Reports/StoredProcesses/..../completion_weekly">';

.....put statements writing javascript code

%mend _createpage;


%macro output;
%let _ODSDEST=tagsets.ExcelXP;
/*%let _DEBUG=log,trace; When using this... the %let RV= statements need to be commented out which will redirect the output to a HTML window rather than MS Excel*/
%let RV=%sysfunc(stpsrv_header(Content-type, application/vnd.ms-excel));
%let RV=%sysfunc(stpsrv_header(Content-disposition, attachment;filename="Boeing_HA_Completion_Weekly.xls")); 

/***************************NOW START ADDING CODE HERE ********************************/

%STPBEGIN;
ods tagsets.ExcelXP file=_webout style=sasweb options(doc="help");
ods tagsets.ExcelXP options(sheet_name='Male Students' sheet_interval='none'); 
proc print data=sashelp.class;    
where (sex eq 'M'); 
run; quit; 
proc print data=sashelp.class;    
where (age eq 15); 
run; quit; 

ods tagsets.ExcelXP options(sheet_name='Female Students' sheet_interval='none'); 
proc print data=sashelp.class;   
where (sex eq 'F'); 
run; quit;
proc print data=sashelp.class;    
where (age eq 14); 
run; quit; 

ods tagsets.ExcelXP close;
%STPEND;

/***************************NOW FINISH ADDING CODE HERE ********************************/


data _null_;
file _webout;
put '<center><a href="http://sasdev.uhc.com:8080/SASStoredProcess/do?&_program=//Foundation/BIP Tree/ReportStudio/Shared/Reports/StoredProcesses/Optum/rpt/phi/shr_stp/ha_completion_weekly">
<img src="http://unitedteams.uhc.com/SCS/URN/OSSA/Pictures/SAS%20Store%20Process%20Images/Prompt.bmp" border="0" />
</a></center>';
run;

%mend output;

%macro main;
%if %symexist(refresh_submit) %then
%do;
%if &refresh_submit ne 1 %then
  %do;
  %create_page;
  %end;
%else 
  %do;
  %output;
  %end;
%end;
%else
%do;
%create_page;
%end;
%mend;
%main;

When I run this code with the _debug=log,trace , I am getting an xml errror

The XML page cannot be displayed

Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.

--------------------------------------------------------------------------------

Only one top level element is allowed in an XML document. Error processing resource 'http://sasdev.uhc.com:8080/SASStoredPr...

<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
-^
AN> ss:ID="systemtitle5__c" ss:Parent="systemtitle5">
  <Alignment ss:WrapText="1" ss:Horizontal="Center" />

Any help would be appreciate.

Thanks,
saspert.

1 REPLY 1
Cynthia_sas
SAS Super FREQ

Hi:

  I'd recommend that you work with Tech Support on this question. There is too much going on in your stored process and much of what is happening needs to be debugged and/or tested with environment and configuration specific information.

cynthia

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 744 views
  • 0 likes
  • 2 in conversation