This preview shows page 1. Sign up to view the full content.
Unformatted text preview: /*
*/ Now that we have the text file, we copy it to the server where it will run against the Oracle database. A Cron job
monitors the remote directory and periodically runs the queries that land there.
%** Copy needed macro variables to the server.;
%** Move the file to the server. ;
%** infile fileref created when text file was created. ;
filename psc4106 "&_remoteDir/sql_select_query_&_aprimoID..txt"; proc upload
filename psc4106 clear;
To run the query we simply %INCLUDE it in a SAS program. Not shown is code that parses the file name and
creates the macro variable &_aprimoID.
proc sql threads noprint feedback;
connect to oracle (path='mktgprod' user="&_dbUser" pass="&_dbUserPwd"
%include &_remoteDir/sql_select_query_&_aprimoID..txt" / source2;
SAS and Word are a powerful combination. This paper showed how easily you can use SAS and DDE to read a
bookmarked W ord document and presented a code generator that exploits that capability. Now that you know how
to read from Word, with a little experimentation you can reverse engineer the technique to write to it. 9 SAS Global Forum 2013 Foundations and Fundamentals REFERENCES, RESOURCES, AND RECOMMENDED READING
SAS Institute. “Using Dynamic Data Exchange under Windows”. Available at
DelGabbo, Vince. 2003. “A Beginner's Guide to Incorporating SAS Output in Microsoft Office
Applications.” Proceedings of the SAS Users Group International Conference 28. Cary NC: SAS Institute.
Gilmore, Jodie. 1998. “Using Dynamic Data Exchange with Microsoft Word.” Proceedings of the SAS Users
Group International Conference 22. Cary NC: SAS Institute.
SAS Institute. 2010. SAS 9.2 Companion for Windows, Second Edition. Cary NC: SAS Institute.
Zhou, Jay. 2009. “Importing Data from Microsoft Word into SAS®.” Proceedings of the 2009 PHARMASUG
Conference. Cary NC: SAS Institute. ACKNOWLEDGMENTS
Thanks to Jodie Gilmore for writing her DDE with Word paper back in 1998. It was a big help getting me started.
And thanks also to my enlightened bosses over the years who had the vision and foresight to send me to SAS
training and conferences. . CONTACT INFORMATION
John E. Bentley
Wells Fargo Bank
Charlotte NC 28226
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS
Institute Inc. in the USA and other countries. ® indicates USA registration.
Other brand and product names are trademarks of their respective companies.
The views and opinions expressed here are those of the author and do not necessarily reflect the views and opinions
of Wells Fargo Bank. Wells Fargo Bank is not, by means of this article, providing technical, business, or other
professional advice or services and is not endorsing any of the software, techniques, approaches, or solutions
presented herein. This article is not a substitute for professional advice or services and should not be used as a
basis for decisions that could impact your business . 10...
View Full Document
This test prep was uploaded on 03/30/2014 for the course CGS 1000 at Hillsborough.