BookmarkSubscribeRSS Feed
Chip
Calcite | Level 5
I have an xls spreadsheet that I am going to use as a template. It will consist of 1 tab and I'll call the tab Sheet1. What I would like to do is create a tab for each provider number that exists in a data set (called priority_scale below). I don't know what the activesheet syntax should be (other than it shouldn't be what I've written) and I'm sure I need a little help with the code after the first copy occurs. Any help is much appreciated.

Thanks!

OPTIONS NOXWAIT NOXSYNC;

X "'C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE'";

DATA _NULL_;
zzzz = SLEEP(2);
RUN;

FILENAME CMDEXCEL DDE 'EXCEL|SYSTEM';

DATA _NULL_;
FILE CMDEXCEL;
PUT "[OPEN(""N:\PUBLIC\Chip's Adhocs\MISC\priority_scale.xls"")]";
RUN;

%MACRO BYPRV(PROV);

data _null_;
file CMDEXCEL;
ACTIVESHEET.COPY AFTER:=ACTIVESHEET.NAME="&PROV";
RUN;

%MEND BYPRV;

data _null_;
set PRIORITY_SCALE;
BY PROV;
IF FIRST.PROV THEN DO;
call execute('%BYPRV('||PROV||')');
END;
run;
quit;
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
Your best bet for quick resolution of this question/problem is to contact Tech Support. To find out your options for contacting them, refer to:
http://support.sas.com/techsup/contact/index.html

cynthia

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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