|
RATCLIFFE Technical Services Limited |
NOTE: |
|
Issue 7. October 2001 |
Hints, tips, and experience for SAS(r) users |
|
|
Welcome to issue 7 of NOTE:. In this issue we have a wide range of topics to interest you. In the last couple of months there have been a lot of interesting developments here at RTSL. One of those is our recently inked agreement with complementSoft to market their innovative ASAP(tm) product in the UK and Europe. You can read more about ASAP in this issue of NOTE:. In this issue we have a focus on SAS's Integration Technologies (IT). We tell you how you can get a taste of its functionality by using it locally on your PC. This article caused more than its fair share of trouble. We have a small but dedicated band of reviewers who proof-read each issue of NOTE: before it is sent. On this occasion, after we'd overcome the shock for some in finding that local usage of the IT COM classes is free, we discovered a problem in the SAS software that gives the impression that IT must be licensed in order to use it locally. The problem is present in all MS-Windows versions of SAS for both V8.1 and V8.2. Though we offer our thanks to all of our reviewers, we should offer a particular big thank you to David Ward (President of InterNext Inc) for his persistence in tracking-down the source of this particular problem and finding the bypass for it. The problem is documented solely as a problem with IML Workshop, but it affects local usage of IT COM classes too - surely a much wider impact and worthy of its own Usage Note. The problem is not fixed for either V8.1 or V8.2, and I find that extremely disappointing. Using IT locally provides a wonderful array of opportunities for accessing SAS software from your own interfaces written in commonly-available languages such as VB and Java. Whilst SAS don't get any additional licence revenue from use of this, it must surely represent a sales opportunity. If the interface applications are deemed useful then there may be a demand to move SAS to the server to make the applications more accessible. Yet, SAS seem to have shot themselves in the foot by presenting customers wit a problem which gives the impression that they are not licensed to use SAS software in this way. See Integration Technologies is Free for more detail. NOTE: is free. If you find it useful, please forward it to your friends, colleagues, and clients. Encourage them to take-out their own subscription by sending a plain text email to listmgr@ratcliffe.co.uk with a subject of "subscribe-note.colon" (without the quotes). Or just click here. -Andrew |
|
|
New papers on our web site |
Quite recently I enjoyed a trip to Chicago and New Orleans, having been invited to speak at the SUCHI and SSU user group events. At each of the events I presented two papers: Debugging Made Easier and OOP Needs OOA And OOD. You can get copies of these from our corporate web site at www.ratcliffe.co.uk. They are in the Resources section, together with other papers and useful items. One of the tips from the Debugging paper is included in the Style section of this issue: type-mismatches. |
|
|
The best yet |
User group meetings are an excellent means of sharing knowledge and experience. This year's UK meeting was a two-day affair at the Hotel Intercontinental, Hyde Park Corner, London on September 25th to 26th. All of the delegates I spoke to said that they were finding the event very useful and informative. VIEWS has two more excellent events coming-up soon. On November 14th Greg Barnes-Nelson (STATPROBE, Inc) will be flying in from the States to present a day of papers on the new technologies surrounding the Internet. More details are on the VIEWS web site about this and about Lauren Haworth's day in February when she will be talking about ODS. |
|
|
Innovative software for SAS |
complementSoft recently introduced version 1.0 of their innovative SAS productivity tool - ASAP. With ASAP, SAS users can speed the documentation process through the program's automatic visualisation of the SAS program flow and data flow; optimise a SAS program by visually identifying and removing redundant operations, code, or function quickly, manage their SAS programs regardless of server location or OS platform using a drag and drop interface, and provide help desk features for common SAS programming errors. ASAP is the first purpose-built SAS program development environment to go beyond providing a simple text editor. The code visualiser is fully integrated with the editor allowing changes in the program flow and data flow to be reflected immediately in the visualiser. It not only enhances the SAS user's ability to build and execute Base SAS code, it also aids problem-solving, optimisation, and documentation. complementSoft chose RTSL to act as their UK and European marketing and distribution partners. If you would like more information about ASAP you can visit the RTSL web site at www.ratcliffe.co.uk. |
|
|
Use the EIT class-based interface to SAS from your VB programs |
I was recently asked if I could advise on a client who had looked towards the future and realised it did not include SAS/AF Frames (see issue 4). The client was considering the alternatives to Frames. They had ruled-out static HTML pages because they wanted dynamic flexibility in the content of the site; they had ruled-out SAS/IntrNet with AppDev Studio due to cost - they already had very many client licences and didn't want to invest extra cash into server licences too. One further option that they considered was to do their own coding and write their own version of SAS/IntrNet. They discarded that option since it still required a server copy of SAS and hence additional cost.
I advised them to consider using Integration Technologies (IT). IT has a significant price tag (understandably so when one considers the amount of functionality it provides - see side-bar), but the COM-based type libraries are part of SAS Base, i.e. they do not require an IT licence! So if your VB is running on your PC and you have SAS V8.x on the PC, the COM type libraries are yours for the taking. Thank you SAS Institute! If you want to use DCOM (distributed COM), then you need a license for IT; but if you want to use your local machine as a server as well as a client, then you can use the COM libraries that are licensed as part of Base SAS. The COM libraries can easily be installed in either of two ways. You can either 1) install them from the SAS Client-Side Components CD, or 2) install IT (regardless of the whether you are licensed or not). If you want to write your own SCL-based classes and surface the classes and their methods to VB then you'll need a copy of AppDev Studio too in order to create your class definitions (IDL) for defining to VB, but that's low cost anyway. If you simply want to run SAS macros then you don't need to define classes, etc. Try this: 1. Ensure the IT COM classes are installed (see above) 2. Open MS-Word and ensure macros are enabled by selecting Tools->Macro->Security and checking the Medium security level 3. Open the VBA editor from within MS-Word by selecting Tools->Macro->VisualBasicEditor (or by pressing Alt-F11) 4. Once in the VBA Editor, ensure the SAS type libraries are selected by selecting Tools->References and ticking:
5. Make sure that the code sheet is open in the VBA Editor (by selecting View->Code, or pressing F7, if necessary), then copy/paste this code into the VBA editor: Dim obWS As SAS.Workspace Dim obWSM As New SASWorkspaceManager.WorkspaceManager
Dim obConn As New ADODB.Connection Dim obRS As New ADODB.Recordset Dim errorString As String
Set obWS = obWSM.Workspaces.CreateWorkspaceByServer("Local", _ VisibilityProcess, Nothing, "", "", errorString)
obWS.LanguageService.Submit _ "data a; do x=1 to 10; y=10*x; output; end; run;"
Dim connString As String obRS.Open "work.a", obConn, adOpenStatic, adLockReadOnly, _ adCmdTableDirect
obRS.MoveFirst Dim sTable As String sTable = "<TABLE BORDER=0><TBODY><TR><TD class=Data>" Selection.TypeText sTable
"</TD></TR><TR><TD class=Data>") Selection.TypeText sTable sTable = "</TD></TR></TBODY></TABLE>" Selection.TypeText sTable
End Sub 6. Run the code by selecting Run->RunSub (or by pressing F5) 7. At this stage you will probably get the following message:
7a. The resolution to this problem is described in SAS note 005837. Type DCOMCNFG at a DOS/Windows command line. In the Distributed COM Configuration Properties box, select the Default Properties tab. Set the Default Impersonation Level to Impersonate. (when you start dcomcnfg you may need to reply 'yes' to a few questions about improperly registered Microsoft classes) 7b. Close the Distributed COM Configuration Properties box. Close the MS-Word document and start again from step 2. 8. You will see HTML to show the whole table written to the Word document.
Note that writing HTML as a Word document serves no productive purpose, and the example is very simple, but it shows that you can: 1. Start a SAS session 2. Use the session to submit code 3. Retrieve the contents of data sets Using IT in this way gives you a lot of useful functionality, and also forms a simple introduction to parts of the IT product. Having sampled this demonstration you may even see a business-case for implementing a client-server solution and licensing IT. |
|
|
Gain access to server-based SAS services at a competitive price |
Back in April of this year, InterNext announced the launch of Onyx - an application server that allows SAS applications to use a wide variety of front-ends including web pages (HTML and a scripting language), Java applets, and client-side applications. When using Onyx with the web, any .sas or .scl file or reference on a web server is executed using the SAS system, without the need to pass parameters to a CGI script explicitly. This creates clean URLs and programs that are easier to understand and develop: with Onyx the parameters and program to execute are passed intuitively. The range of features and functionality of this new product is too large to cover here, so take a look at the InterNext web site for more details: www.internext-inc.com/software/onyx. |
|
|
Keep on top of your variables' types |
Here's a tip from our recently presented Debugging Made Easier paper. The whole paper is on the RTSL web site in the Resources section. Make your syntax good: remove warnings such as type-mismatches. Consider removing messages like uninitialised variables. Compare the following two DATA steps. 1 data _null_; 2 numeggs = 12; 3 msg = 'Old Macdonald has ' 4 !! compress(numeggs) 5 !! ' eggs' ; 6 put msg= never=; 7 run;
NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column). 4:21 NOTE: Variable never is uninitialized. msg=Old Macdonald has 12 eggs never=.
8 9 data _null_; 10 numeggs = 12; 11 msg = 'Old Macdonald has ' 12 !! compress(putn(numeggs,'BEST.')) 13 !! ' eggs' ; 14 never = .; 15 put msg= never=; 16 run;
msg=Old Macdonald has 12 eggs never=. The second DATA step shows how to remove the type mis-match and the uninitialised variable message. The V8 SAS/AF SCL compiler has compile-time binding, thereby offering more validation at compile time |
|
|
Advertisement |
||
|
Useful SAS-related services and products |
|
|
|
|
If I were not constrained by the need to earn money by working(!), this diary provides a guide to some of the world-wide events I might like to attend. Those marked with an asterisk are those that I will be attending. If you plan to go to any of the listed events, please let me know - I'd be very grateful for any comments after the event. And it would be nice to meet if I am going too. As time passes I remove events from the top of the diary and move them to the bottom, signifying that those events have occurred and in anticipation of the following year's events. SUGA is one of those that I would expect to move from top to bottom; however, I note from the wrap-up section of the SUGA web site that the format for SUGA will change next year and it will be run as a road show. So SUGA has disappeared from the Diary. And... nothing is known about next year's VIEWS main conference, so I've not speculatively added anything to the Diary. Note that the SUGI 27 web site is now up and running. The hotels will accept your reservations now, but the conference organisers still have some work to do before they can start accepting SUGI Registrations. Book early, it's bound to be extremely popular. |
|
|
|
December April 2002
May 2002 June 2002 March 2003 |
|
|
|
You can subscribe and unsubscribe by visiting our web site at www.ratcliffe.co.uk. Or, to subscribe just click here and hit the Send button in your email client; and to unsubscribe, just click here and hit the Send button in your email client. Please do not include a message in the body of the email, it will not be seen by a human! Back issues are available on our web site at www.ratcliffe.co.uk. Please send comments to note.editor@ratcliffe.co.uk. NOTE:
(c) 2001 Ratcliffe Technical Services Limited. All
rights reserved. Republication by permission only. You may forward copies only if no fee is involved. Please encourage the recipients of the forwarded copy to subscribe and get their own free copy of NOTE:. NOTE: is a production solely of RTSL and has no affiliation with any other organisation. This edition of NOTE: was sent free to 481 subscribers worldwide. This is a valid HTML 4.01 Transitional document |
|