syslput aprimoidaprimoid syslput

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: /* /* /* IS004 IS006 IS012 IS027 IS037 IS045 ESB001 ESB002 ESB003 ESB005 ESB006 ESB007 ESB010 ESB011 ESB012 ESB013 ESB014 ESB015 ESB021 ESB022 ESB023 ESV002 */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ 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.; %syslput _aprimoID=&_aprimoID; %syslput _remoteDir=%bquote(&remoteDir); %** Move the file to the server. ; %** infile fileref created when text file was created. ; RSUBMIT kwood; filename psc4106 "&_remoteDir/sql_select_query_&_aprimoID..txt"; proc upload infile=psc4106 outfile=psc4106; run; filename psc4106 clear; ENDRSUBMIT; 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" readbuff=5000); %include &_remoteDir/sql_select_query_&_aprimoID..txt" / source2; quit; CONCLUSION 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 http://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#dde.htm ® ® 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 john.bentley@wellsfargo.com 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.

Ask a homework question - tutors are online