Taking Advantage of the SAS® System Release 6.11 for Personal Computers

Carol Williams Rigsbee, SAS Institute Inc., Cary, NC

ABSTRACT lease. We plan to update Release 6.11 to provide production support for Windows NT This paper describes enhancements to the and Windows 95. In addition, in order to li­ SAS System for Release 6.11 that utilize the cense the Windows 95 Logo, this release features. available with Windows will provide additional enhancements. For and OS/2®. Interapplication operability example, we will replace some of the com­ through OLE 2.0, ODBC and the continuing mon dialogs in order to reflect the new user support for electronic mail through products interlace provided by Windows 95 and will such as Microsoft Mail and Lotus Notes are continue to expand the NT support. discussed. An overview of new user inter­ face features such as the new Libraries Throughout this paper, SAS AWS refers to dialog is presented. the container window of the SAS System. SAS application windows refer to the win­ dows contained within the SAS AWS. INTRODUCTION

This paper provides an overview of the new IMPROVED GUI FEATURES Release 6.11 enhancements. You should view this paper as an introduction but you Additional GUI enhancements to the Re­ should refer to the Envi­ lease 6.11 SAS System provide a more na­ ronment: Changes and Enhancements of tive familiar to PC users. the SAS System, Release 6.11 and the Some of the new GUI features include OS/2 Environment: Changes and Enhance· , large and small tools, a Libraries ments of the SAS System, Release 6.11 for dialog, two monospaced TrueType fonts, a more details. Additionally, refer to most recently used files list, and keyboard "Enhancements to the Graphical User Inter­ editor enhancements. face for the SAS System on Personal Com­ puters' for a summary of GUI enhance­ Tooltips provide concise 'help information for ments added in Release 6.10. the tools on the SAS AWS , the command bar and the status line. The Release 6.11 continues to provide incre­ tooltips display as you move your mouse mental enhancements to the user interlace over these controls. Additional de­ of the SAS System. In order to create a PC tailed help simultaneously displays on the application that best utilizes the PC feature status line. You can disable the in­ set, we follow the GUI standards docu­ formation through the Preferences dialog or mented in The Windows Interface, An Appli­ though the TOOL TIP command. The Tool cation Design Guide and the Common User Editor allows you to modify tooltip Access Guide to Design. text as you modify your default tool settings.

Release 6.11 targets OS/2 Warp and Win­ dows 3.x using the Win32s extensions. The WindOWS version does not currently run on OS/2 Warp because the SAS system re­ quires a later release of Win32s. In addi­ tion, Release 6.11 supports Windows NT and Windows 95 as an experimental re-

1328 You can choose to display the SAS AWS toolbar with either large or small tools. You can specify your preference either through the Preferences dialog or the TOOLLARGE command. On devices with a resolution of 640x480 or greater, the SAS system will use large tools by defautt. Release 6.11 for Windows provides two new TrueType fixed pitch fonts, SAS Monospace The Libraries dialog displays when you se­ and SAS Monospace Bold. These fonts con­ lect the file cabinet tool on the tool bar tain several extended ASCII line drawing (Windows only). This dialog allows you to characters in positions that are normally un­ quickly create and delete libnames using the defined in an ANS I font. The Sasfont bitmap familiar PC user interface. Using the font also contains these characters at the "Advanced" mode of this dialog allows you same character positions. As a result, you to easily create concatenated libraries and can use one FORMCHAR option to access specify engine information. You can also these characters in any of the three fonts. display' existing lib names with the associ­ Using these line drawing characters with ated physical directories and display the proc TABULATE provides a smooth line contents of a library. The context sensitive drawing capability resutting in tabular output popup menus allow you to display variables that is more visually appealing. Since the within a data set and entries within a cata- Sasfont bitmap font displays faster and . log. looks better on the display, it is the defautt display font when you install the SAS sys­ tem. Since the SAS Monospace font looks better in printed output and because it scales to many point sizes, it is the defautt printer font. For similar reasons, the SAS Monospace font is the default font used in the Rich Text Format (RTF) clipboard for­ mat. The RTF clipboard format, new in 6.11 , allows you to copy selected text and tables to the clipboard and to paste them into other applications while preserving the correct appearance. In other words, copying a table generated by proc TABULATE and pasting it into Microsoft Word will produce a table in the Word document. RTF uses the SAS Monospace TrueType font when the defautt display font is either Sasfont or SAS Mono-

1329 space. Otherwise, RTF uses the defauH drag selected text out of the log, Output display font. and all editor windows (Program Editor, Notepad, SCl editor, etc.). You can drag Release 6.11 provides a list of most recently text into all editor windows. If you use non­ used files on the File . Each time you default dragging, you choose to either move open a file with the Open dialog or save a or copy the text. Default dragging uses file with the SaveAs dialog, this list is up­ mouse one (usually the left button) dated. If you want to open the file again, and non-default dragging uses mouse but­ you simply select the file name in the list. ton two (usually the right button). Dragging a Four file names display by default but you file into any editor window includes the file. If can change this number through the Prefer­ you use non-default dragging, you choose to ences dialog. You can also disable this fea­ either include or submit the file. Dragging a ture through Preferences. file into any other Display Manager window submits the file for execution. If you move There are several keyboard editor en­ your mouse pointer next to the border of a hancements in Release 6.11. PC-DOS us­ window while you are dragging text, the ers requested a key to delete from the cur­ window will automatically scroll in the direc­ rent cursor position to the end of the current tion you are pointing. Dragging tabular out­ line. In Release 6.04, the END key provided put into another application will preserve the this functionality. This capability is now tabular information as mentioned previously available with the AH+Delete key. Double in the RTF discussion. There are some im­ clicking on a word selects the word. You can plementation differences between OS/2 and use drag and drop to move text. The up Windows; you should refer to the documen­ and down arrow keys will scroll the log and tation for more details. Output windows.

Prior to Release 6.11, if you closed the Out­ IMPROVED HELP put window using the system menu and then displayed output to this window, the Output The SAS System help facility uses the Mi­ window. did not reopen. You provided feed­ crosoft Windows Help (winhelp) under Win­ back that this behavior confused you. With dows and Information Presentation Facility Release 6.11, if you closethe Output win­ (IPF) under OS/2 to display the help text. dow it will reopen when output displays to The resuH is. a help system with a look and the window. feel native to the particular operating sys­ tem. Usage notes, all of the SAS sample By defau H, command lines are not available programs, and the SAS system require­ in the SAS application windows. However, if ments are available in native help format. you prefer to use command lines, you can select "Command Line" in the Preferences dialog. Prior to Release 6.11, choosing CONFIGURING YOUR GUI "'; "Command Line" resuHed in application menus no longer being available on the SAS While most PC users expect an interactive AWS . Now menus and command way to configure the SAS GUI, SAS/Af® lines are available simuHaneously. programmers need programmatic control. Commands exist for all the interactive set­ The filename in the Program Editor, log and tings. Also, additional commands exist to Output title bar is now just the filename in­ control the appearance or behavior of the stead of the entire path. SAS AWS and the SAS application win­ dows. These commands allow you to create applications using the SAS System and then DRAG AND DROP SUPPORT remove any trace of the SAS System, creat­ ing the appearance of a stand-alone appli­ Release 6.11 provides several enhance­ cation. ments to drag and drop support. You can

1330 The following commands are new for Re­ Programming Interlace). You can use only lease 6.11: one mail system per SAS system invoca­ o DLGDDE Invoke DOE triplet dialog tion. Most popular e-mail packages provide o DLGENDLIB Close the Libraries dialog support for either VIM or MAP!. o DLGLlB Invok~ Ubraries dialog o DLGLlBMAINT Invoke New U~rary or The Send Mail dialog allows you to enter a Modify Ubrary dialog note describing the mail message. Data oWCOPY Executes either store or and reports, which are the actual contents of gstore the messages, are sent as attachments. At­ oWPASTE Executes either paste or tachments are files that you saved previ­ gpaste ously. oWMRU last x files in menu (Ioggle and allow x to be 0.9) o TOOLLARGE Display sman or large tools o TOOLTIPS Display Iooltips

With the option $NOSLEEPWINDOW, you can prevent the information window from displaying when using the SLEEP or WAKEUP functions.

SAS/AF users may find the option $1 ;,DECURSOR useful. With this option, you can prevent the text cursor from dis­ You can also access e-mail through the playing in output only windows. In the Log FILENAM E statement using the Device type and Output windows only a gray cursor dis­ of EMAIL. Additionally, you can embed a plays. Additionally the text cursor does not set of directives in put statements to allow display. when over a constant or protected even more flexibility when writing a data field, a control (like a ), or if no step that sends muttiple e-mail messages field exists at the current cursor location. conditionally.

Using the option $NOSTATUSWIN prevents the status window from displaying in batch APPLICATION .INTEGRATION mode Release 6.11 provides increased application integration through several new methods. PRINTING The SAS System supports named pipes, unnamed pipes, DOE, OLE 1.0, system clip­ The option -SYSPRINTFONT is new for board, and Media Control Interlace with Release 6.11. This font allows you to pro­ Release 6.08. Additionally, Release 6.10 grammatically specify the font name and provides support for ODSC, extemal DLL point size for a particular printer. access, and the ability to support import and export of graphics to and from common PC file formats. Release 6.11 adds support for E-MAIL SUPPORT several new access engines, including Lotus Notes. OLE 2.0 is also fully supported. E-mail support is available interactively through the Send Mail dialog or program­ LOTUS NOTES matically through the OAT A step or SCL. This implementation supports both industry Release 6.11 provides a new access engine standards VIM (Vendor-Independent Mes­ that allows you to add new documents to an saging) and MAP I (Messaging Application existing Lotus Notes database. The

1331 FilENAME statement and the device type SCl Sample Automation Code NOTES DB provide this functionality. The support for lotus Notes is experimental in LAUNCHXL: Release 6.11 and is available for both Mi­ hostel z loadclass(,sashelp.fsp,hautol; call send (hostel, '_NEW_·. excelobj. D, crosoft Windows and OS/2. 'Excel.Application,5'); call send (excelobj,:"'SET_DATA_·:Visible·.True·); return; OLE SUPPORT CREATEWS: call send (excelobj.:"'GET_DATA_'.Workbooks·, Beginning with Release 6.08, the SAS Sys­ wbsobj); tem for Windows provides an OLE 1.0 con­ call send (wbsobj, :"'00_'. 'Add'); tainer for OLE objects through SAS/AF. call send (excelobj.:"'GET_DATA_':ActiveSheer, Since OLE 2.0 technology provides OLE 1.0 wsobj); support, you can use either OLE 1.0 or 2.0 dsid::open('sasuser .class'. 'i'}; can set(dsid); servers with SAS/AF prior to Release 6.11. rc=fetch(dsid); The main functionality of OLE 1.0 is the nvar=attrn(dsid, 'NVARS'); ability to embed or link an OLE object in an nobs-attrn(dsid. 'NOBS'); OLE container. With Release 6.11, the SAS do colz 1 to nvar; call send (wsobj. :...COMPUTE.:..·. ·CeIIs·,l.col.retcell); system fully exploits OLE 2.0. New func­ varcvarname(dsid.col); tionality available in Release 6.11 (by ex­ call send (retcen:_SET_DATA_·. 'Value' .var); ploiting the new technology available in OLE end; 2.0) includes support for drag and drop of do while (rc ne -1); OLE objects, visual editing, automation of do row = 1 to nabs; do col = 1 to nvar; objects and OLE control (OCX) support. An T=row+l ; experimental OLE server is also available. call send (wsobj. '_COMPUTE_', 'Cells'. r ,col, With OLE 2.0, you can either edit in place reteell); (also known as visual editing) or edit in a if vartype(dsid.col) eq 'N' then var-getvarn(dsid,col); else var-getvarc(dsid.col); separate window (also known as open edit­ call send (retcen:_SET_DATA_'. 'Value' ,var); ing). Visual editing simply allows you to edit end; an OLE object in the container application. rc=fetch(dsid); When you edit the object, the container ap­ end; plication takes on the user interface of the end; return; object's application. The menu, and status line all switch to the ones normally QUITXL: provided by the object's application. call send (excelobj:_GET_DATA_·. 'ActiveWorkbook'. awbobj ); call send (awbobj. :"'DO_', ·Close·. 'False'); Automation provides a mechanism to control call send (excelobj:_DO_', 'Quit·); (script) other applications. This functionality call send (excelobj.:"'TERM_'); is similar to the functionality currently pro­ return; vided through DOE. Five new SCl methods provide the SAS system' interface to OLE 'Many applications use Visual Basic to automation. These methods include: automate OLE servers so information is readily available. For example, you could _NEW_: Create an OLE Automation object use the macro recorder in Excel to captu re _SET_DATA_: Set the value of a property, the Visual Basic code. You can quickly _GET_DATA_: Retrieve the value of a property. translate this code to SCL. Included below is _DO_: Execute method with no return value. _COMPUTE_: Execute method with a return value. the Visual Basic code required to perform the equivalent Excel Automation sequence. For example, the following SCl code in­ vokes Microsoft Excel, creates a worksheet, Visual Basic Sample Code populates data in the worksheet using val­ ues in a SAS dataset and closes Microsoft (general)( declarations) Excel. Dim excelobj As Object Private Sub LAUNCHXL_ClickO

1332 'Launch Excel and make it visible. support will provide you with access to more Set excelobj _ CreateObject("ExceI.Application.S") native controls. SAS/AF applications excelobj.Visible = True End Sub . can use any available OCX. In addition with Release 6.11, we will supply two OCX's, a Private Sub CREA TEWS _ CIlck.O text entry and a . Third party Dim wbsobj, wobj As Object vendors may not supply these OCX's and Dim nvar, nabs, col, raN, cellvalue As Integer these are the most often user requested Dim colname As String native controls. 'Create a new worksheet. Set wbsobj "" excelobj.Workbooks We are currently researching an OLE server wbsobj.Add implementation by prototyping PROC In­ Set wsobj '" excelobj.ActiveSheet sight as an OLE object. The following 'Note: Instead of reading from a SAS Dataset screen dump shows an Insight rotating plot , we just simulate the process by embedded within a Microsoft Word docu­ generating random numbers for the data. ment. Double clicking on the graph acti­ nvar=5 nabs:: 20 vates the object in place, allowing you to modity the graph. This is a sample of pos­ Write out the column headers. sible functionality provided by an OLE In­ For col:: 1 To nvar sight Object. coloame :: ·Column • & 001 wsobj.Cells(l, coI).Value _ colname Next 001 Randomize Write out the data. For row = 1 To nabs For col '" 1 To ovar cellvalue _ Int(loo" Rnd) wsobj.Cells(raw + 1, col).Value '" cellvalue Next col Next row End Sub

Private Sub EXITXL_Click() excelobj.ActiveWorkbook..Close ("False") excelobj.Quit End SUb

D&ru.:e...... c~lIIme .OSkfti....ioclh:"'" ",.4clEHICAcr = DllUG AGE.. """'"" 06::0l;J ...... - Visual Basic programmers are familiar with 1I1d1a ...... ~ia.bloodrn ...... the concept of VBX's. Third party vendors provide VBX's to extend the control set of Visual Basic. OLE 2.0 developers felt this concept was good but needed expansion. The expanded design resulted in OLE con" trois (also known as OCX's, the three letter ODec SUPPORT DOS extension). The next release of Visual Basic will support OCX's and third party ODBC is an industry standard for interoper­ vendors will convert existing VBX's to ability between databases from different OCX's. Some of the major differences be­ vendors. SAS supports this standard as tween an OLE object and an OCX are both a client and server, allowing data to be events and ambient properties. The OCX retrieved from other databases that support generates events to the OLE container. the standard as well as surfacing SAS data Ambient properties allow a communication sets to PC applications that utilize the inter­ between the container and the OCX for face as clients. "Integrating the SAS System properties such as font or color changes. for Personal Computers into Your Enter­ For example, if the font in the container prise" covers the ODBC functionality for changes, the container notifies the OCX so Release 6.11. Please see that paper for it can also change its font if applicable. OCX additional details.

1333 ACCESSING EXTERNAL Dll'S SAS and SASIAF are registered trademarks or trademarks of SAS Institute I nco in the You can access extemal Dll's through the USA and other countries. OS/2 is a regis­ DATA step or SCl with the MODULE family tered trademark or trademark of Interna­ of SAS call routines and functions. This tional Business Machines Corporation. ® functionality allows you to access either ex­ indicates USA registration. temal Dll's that you create or Dll's that you purchase. You can even access operat­ Other brand or product names are regis­ ing system DlL's. To use, you create a tered trademarks or trademarks of their re­ SASCBTBL attribute table that describes spective companies. the DLL routine you want to access.

CONCLUSIONS

This paper summarized some of the many features available in Release 6.11 of the SAS System under OS/2 and Microsoft Windows. Please refer to the Microsoft Win­ dows Environment: Changes and Enhance­ ments of the SAS System, Release 6.11 and the OS/2 Environment: Changes and Enhancements of the SAS System, Release 6.11 for more details.

REFERENCES

Rigsbee, Carol Williams (1994), "Enhancements to the Graphical User Inter­ face for the SAS System on Personal Com­ puters", Proceedings of the Nineteenth An­ nual SAS Users Group International Confer­ ence, 410-418

Microsoft Corporation (1987, 1992), The Windows Interface, An Application Design . Guide, Redmond, Washington: Microsoft Press

IBM Corporation (1989, 1991), Common User Access Guide to User Interface De­ sign, Cary, North Carolina: IBM Corporation

Kolb, David (1995), "Integrating the SAS System for Personal Computers into Your Enterprise", Proceedings of the Twentieth Annual SAS Users Group International Con­ ference

1334