Date: Wed, 17 Sep 2008 08:54:00 -0400
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Nat Wooding <Nathaniel.Wooding@DOM.COM>
Subject: seeking information on DDE. was hi
Content-Type: text/plain; charset="US-ASCII"
First, welcome to the world of SAS. Not to pick on you but please offer a
more explanatory subject line than "Hi" since it was pure luck that I even
opened your posting.
As to DDE, what are you trying to do? Do you want to read data or write?
Are you working with Excel or Word or what?
I should also why you want to use DDE. While I use the tool, there are
newer methods of reading data from Excel into SAS and you may want to
One thing to remember with DDE is that it operates while both SAS and the
target software are running. Hence, if you are reading data from Excel,
Excel has to be running and the spreadsheet loaded.
Here is a sample job that reads data from a spreadsheet. There are fancier
ways to launch Excel but the one that I show works.
OPTIONS NOXWAIT NOXSYNC MPRINT; * NOTE THE NOXWAIT AND NOXSYNC!!;
/* THE DDE LINK IS ESTABLISHED WITH EXCEL */
DATA _NULL_ ; * YOU MAY HAVE EXCEL STORED UNDER A DIFFERENT PATH;
X " 'C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE11\EXCEL.EXE'
""C:\PARK\97JUN.XLS"" ";** THIS IS THE FILE TO OPEN
X=SLEEP(5); * PAUSE SAS PROCESSING FOR 5 SECONDS WHILE EXCEL OPENS AND
LOADS THE SHEET;
FILENAME GETDATA DDE "EXCEL|COND001!R5C2:R32C15"; * NOTE THE ROWS AND
COLUMNS. COND1 IS
*THE PORTION AFTER THE | IS
THE DDE TRIPLIT;
INFILE GETDATA DLM='09'X NOTAB DSD MISSOVER; * NOTE THE DLM. THIS SEPARATES
INFORMAT COL1 -COL11 $20.;
DATA _NULL_;** SHUT DOWN EXCEL;
FILENAME CMDS DDE 'EXCEL|SYSTEM';
PUT '[QUIT()]'; * THIS IS AN EXCEL VERSION 4 MACRO.;
Environmental Specialist III
Dominion, Environmental Biology
4111 Castlewood Rd
Richmond, VA 23234
Phone:804-271-5313, Fax: 804-271-2977
Sent by: "SAS(r) To
Please respond to
i am new bie to sas, i am strugling with dde option
can tell me syntax and hw to use that
CONFIDENTIALITY NOTICE: This electronic message contains
information which may be legally confidential and/or privileged and
does not in any case represent a firm ENERGY COMMODITY bid or offer
relating thereto which binds the sender without an additional
express written confirmation to that effect. The information is
intended solely for the individual or entity named above and access
by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying, distribution, or use of the
contents of this information is prohibited and may be unlawful. If
you have received this electronic transmission in error, please
reply immediately to the sender that you have received the message
in error, and delete it. Thank you.