BookmarkSubscribeRSS Feed
deleted_user
Not applicable
When I use the above to get output from proc tabulate, the columns are not set out in excel properly - i just get everything in the column A cells - with values seperated by half pipe symbols eg: . 949| 528| 1043| 1031| 1132| 850| 899| 447|. Being new to this It could be an obvious fix.

I tried some sas example code which works fine, using the same ods statement/tagset, but example data so what's going on?

Cheers
5 REPLIES 5
garybald
Calcite | Level 5
Would you post the tabulate code please?
deleted_user
Not applicable
ods tagsets.excelxp file='y:\Extract.xml' style=minimal ;

rsubmit;
proc tabulate data = miu;
class stat_typ umony;
table stat_typ, umony*(N*F=5.)
/rts =5 nocontinued;


run;
endrsubmit;

ods _all_ close;
garybald
Calcite | Level 5
I noticed you don't have a var statement. Is umony your analysis variable?
deleted_user
Not applicable
I didn't use a var statement - as the statistic required is N ie a simple count, which the proc defaults to if var is omitted.
Peter_C
Rhodochrosite | Level 12
PBALL


problem is rsubmit

excelxp works only "locally"

you could create the xml on the remote server (put the ods tagsets statements inside the rsubmit block), and arrange "delivery" of the xml in any of a variety of ways, .
> rsubmit;
> ods tagsets.excelxp file="%SYSFUNC(PATHNAME(WORK))/Extract.xml" RS=NONE
> style=minimal ;
>
> proc tabulate data = miu;
> class stat_typ umony;
> table stat_typ, umony*(N*F=5.)
> /rts =5 nocontinued;
>
>
> run;
>
> ods _all_ close;
PROC DOWNLOAD INFILE= "%SYSFUNC(PATHNAME(WORK))/Extract.xml"
OUTFILE= 'y:\Extract.xml' ;
RUN ;
> endrsubmit;

UNFORTUNATELY, handling remote servers on z/OS is less easy to equate to remote server handling for unix or windows platforms, so the above is not good enoughif your remote server is on z/OS. (if you don't know the server platorm, check by submitting
rsubmit ; %put &sysscp &sysscpL &sysVLong ; endrsubmit ;



Alternatively, you could use remote library services to create your xml in the local session, like:

%let rserver = %sysfunc( getoption(remote)) ;
libname rwork remote slibref= work server= &rserver ;

> ods tagsets.excelxp file='y:\Extract.xml' style=minimal ;

proc tabulate data = RWORK.miu;

> class stat_typ umony;
> table stat_typ, umony*(N*F=5.)
> /rts =5 nocontinued;
>
>
> run;
>
> ods _all_ close;
LIBNAME RWORK ;

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
  • 5 replies
  • 920 views
  • 0 likes
  • 3 in conversation