Broadening Your Choices get lolder &idx of disk &disk as string; In Desktop Solutions: folder =%SYSGET ( SYSRSLT ); The SAS® System for output; %end;run; Terrie Linker %mend folders; SAS Institute, Inc., Cary, NC This macro scans a disk by name and returns the names of the folders at the root of the disk, and ABSTRACT then stores the names in a data set provided by the caller. Release 6.10 of the SAS System for Macintosh brings the world of SAS software to the Macintosh You can also use the %SYSEXEC macro as an platform. This paper will discuss several technical action in the toolbar palette. You can customize the topics, such as why the SAS System requires toolbar to add icons and actions associated with .5 of MacOS, how AppleScript is those icons. Using the %SYSEXEC macro puts an supported, drag-and-drop issues, and how to AppleScript command right into the toolbar, create a double-clickable SAS "application." Also accessible at any time with a click of your mouse. discussed are technical aspects of several features that are unique to the Macintosh version of the SAS Another way to use AppleScript from SAS is System, and some future directions. through the X statement. These commands execute immediately. An example of using the X INTRODUCTION command is: With the shipment of Release 6.10 of the SAS System for Macintosh, users gain a new choice in X ~ell application "" to empty trash'; desktop computing. This paper will go into some detail on several technical topics regarding A third way to interface with AppleScript is through integrating the SAS System for Macintosh into your the CALL SYSTEM routine. The advantage of this enterprise. There are some general technical interface is that it can be done inside a data step. issues, some issues relating to ways the SAS Here is an example of a data step that uses System exploits the Macintosh environment, and AppleScript commands: also some issues regarding features of the system that are unique to the Macintosh version. Finally, data _nulL; set answer. week; this paper will discuss some future directions of the if resp = 'y' then do; product. call system (~ell application "Finder" to empty trash); TECHNICAL ISSUES REGARDING end; run; FEATURES THAT EXPLOIT THE Drag-and-drop support MACINTOSH ENVIRONMENT SAS takes advantage of the Macintosh drag-and­ AppleScript support drop technology in several ways. Drag·and-drop SAS allows you to invoke AppleScript commands to text editing is supported. You can select text and perform Macintosh-specific tasks. You can issue drag it from one SAS window to another or even AppleScript commands in several ways. You can drop it in the Trash. invoke the %SYSEXEC macro, use the X statement or use the CALL SYSTEM routine. In each case, Drag-and-drop support also exists at another level. the result of the AppleScript command is available SAS files can be dragged and dropped on the SAS for testing in an environment variable, SYSRSLT, icon, which will launch SAS. Depending on what after the script completes. the type of the file is that is dropped on the SAS icon, different actions occur. For example, when a The %SYSEXEC macro takes as its argument an text file is dropped on SAS, the text from the file is AppleScript command. Here is an example of using included in the Program Editor (but not submitted). the %SYSEXEC macro and SYSRSLT: When a SAS data set is dropped on the SAS icon, PROC FSEDIT (full screen data viewer) is invoked %macro folders ( disk, ds ); on the data set. data &ds; %SYSEXEC tell application "Finder" to SAS allows you to modify the default drop actions count folders of disk &disk; for different types of SAS files. You can also add %Iet count = %SYSGET ( SYSRSLT ); new types and actions to customize your %do idx = 1 %to &count; environment. %SYSEXEC tell application "Finder" to

1290 File. Preferences. Customize Drop GSFNAME= graphics option, the DEVICE= and Rctions ••• allows you to view the default actions GACCESS= graphics options and using and make changes or additions. File types currently File. I mport ... and File. Ellport ... from a supported are text, SAS data set, SAS catalog, Graph window. Once you specify a FILENAME SAS data set index, SAS data set view, JMP® table statement, you use the filename you assigned in and SAS stored program. There are default actions the GSFNAME= graphics option. If you use the for when each of these is dropped onto the SAS DEVICE= graphics option, you then use the icon. GACCESS= graphics option to specify the graphics format. The following formats are supported for Printing import and export: Printing from SAS is supported via the Macintosh Printing Model, so all Macintosh printers are PICT (Macintosh Picture Format) supported. The interface provided makes printing PPM, PGM, PBM (Portable Anymap) very simple. You must use the Chooser to specify a TIFF (Tagged Image File Format) default printer, and then choose EPSI (Encapsulated PostScript Interchange) File. Page Setup ... in SAS to select or review GIF (Graphics Interchange Format) printer options. Then, in most situations, when you BMP (MicroSoft Windows Bitmap) choose File. Print ... , a print dialog pops up. You may choose Print from there, and your output is The following formats are supported for import only: routed to the printer you chose. You may also use the PRINTER device keyword on a FILENAME TGA (Truevision Targa) statement to route output directly to a plain text file. PCX (PC Paintbrush In this case, the data will be spooled to disk as well XWD (X11 Window Dump) as to the printer. Here is an example of code to do this: Using "Sapp" files FILENAME myfile PRINTER A "Sapp" file is a file that has "Sapp" as its file type, 'My Disk:my folder:my output file'; and that has an associated resource which SAS data _nulL; file myfile; interprets to determine the actions to take with the do 1=1 to 100; put 1=; end; run; file. This type of file can be used to customize your SAS environment in several ways. You can create a Traditional SAS printing is also supported via the double-clickable SAS job that runs and creates PRINTUSEFORM option. This option will cause the output without ever bringing SAS up in the full­ active SAS form to control output characteristics. screen environment. Once the SAS statements The SASIGRAPH® driver library is also available to have been processed, SAS shuts down, leaving create binary files for specific devices. So, you the output in files for you to see. This is done by have choices in printing from SAS for Macintosh. putting SAS statements in your Sapp file and modifying the corresponding resource to instruct Previewing graphics output SAS to handle the Sapp file as input. You can Graphics output can be previewed before printing customize autoexec processing by constructing the using the TARGETDEVICE= graphics option. corresponding resource to instruct SAS to handle These are the values of this option that should be Sapp file as an autoexec file. You can customize used for the Macintosh: configuration file processing by having your Sapp file contain configuration options and constructing GOPTIONS TARGETDEVICE=MACPRTM the resource to instruct SAS to handle the Sapp file for a monochrome printer as a configuration file. GOPTIONS TARGETDEVICE=MACPRTG for a gray scale printer A "Sapp" application is actually a text file that has its GOPTIONS TARGETDEVICE=MACPRTC file type changed using ResEdit, making it appear to for a color printer SAS to be a SAS file. It contains nothing but SAS GOPTIONS TARGETDEVICE=MACPLOT statements or configuration options. It has an for a plotter aSSOCiated STR resource that specifies a "command line" which determines how the text contents of the To actually print the graph, you can choose file will be processed. Currently, you must use File. Print ... directly from the graphics output ResEdit in the creation of a Sapp file. We plan to window. enhance the usability of Sapp files by eliminating the need to use ResEdit to create and edit them. A Importing and exporting graphics TS Notes document will be available that will The SAS System for Macintosh supports graphics describe how to create and use Sapp files. import and export via the FILENAME statement and

1291 Graphical User Interface "Flavors" You may also invoke the Option Editor from within a The default graphical user interface for the Macintosh version of SAS is one that utilizes much SAS session. Choosing Edit. Preferences. of the native Macintosh features. These include Customize Global Options ... will invoke the button and control styles. You may want to change Option Editor. You may make changes to global the style of these items, to be more Windows-style system options that will take effect in the current or X-Windows-style. This is possible through session as soon as you choose File • RP ply or options available in the Option Editor. These· press COMMAND-A. Configuration options may be options are listed under the group named "flavors· changed, but will not take effect until a new SAS in the Option Editor, and affect such things as session is launched. When both SAS and the check box style, radio button style, push button Option Editor are running, selecting File. Rpply style, icon button style and font. You can tailor from the Option Editor and these interface items to best suit your environment. Edit. Preferences. Customize Global These "flavors" do not affect the functionality of Options ... from SAS will transfer control and SAS applications, only their visual appearance. option data between the two. You can simply click out in a SAS window to transfer control to SAS, but TECHNICAL ISSUES REGARDING any options you changed in the Option Editor will FEATURES THAT ARE UNIQUE TO THE not take effect unless you transfer control via MACINTOSH File. Rpply. Option Editor You may save a new configuration file containing The Option Editor is a standalone application for the the options you have specified in the Option Editor management 01 SAS system options and the manipulation of configuration files. It can act as an at any time, by choosing File. Saue. This will alternative mechanism to configuration files and also create or update a configuration file that can then be used by a SAS session, or dropped on the Option be a preferences dialog during SAS sessions. The Option Editor is a useful tool for customizing SAS Editor for future editing. sessions for particular persons or groups in your enterprise. Toolbar and Command Palettes The Toolbar Palette (shown in Figure 1) is a The Option Editor can be invoked in three ways. It Macintosh-style customizable icon palette, with is a standalone application, so it can be invoked each icon representing a specific, user-definable totally outside of SAS. It can also be invoked at action. This feature puts many common SAS SAS startup time, to set options for the current actions only a mouse button click away. By default, seSSion, and it can be invoked from within a SAS the SAS System displays the basic tool bar palette session itself. To invoke the Option Editor as a when SAS is invoked. You may choose to have the standalone application, simply double-click on the toolbar not displayed by chOOSing Option Editor icon. You can also drag and drop a WindoW. Hide Toolbar Palette or by configuration file onto the Option Editor and it will pressing COMMAND-T. When the toolbar palette is be invoked and reflect the options from that hidden, you may have it displayed again by configuration file. choosing Window. Show Toolbar Palette or by pressing COMMAND-T. You may customize You can view the options by group or alphabetically your toolbar palette by adding and deleting action by option name. Once you make changes to your icons. You do this by choosing options, you can "apply" them by selecting File. Preferences. Customize Toolbar File. Rpply or by pressing COMMAND-A, and Palette ... and from there you may edit or delete that will cause SAS to be invoked using the option one of the existing icons or add your own new values you have supplied. ones. You may also choose whether to display smaller icons and whether to display the message To invoke the Option Editor at SAS startup time, line in the toolbar (the white area under the icons, hold down the while launching SAS, which, if displayed, will show the name of the action and the Option Editor will come up before SAS is asSOCiated with each icon when the mouse is invoked, allowing you to set options that will only be positioned on that icon). To edit or delete an in effect for the current session of SAS. Once you existing icon, click on that icon in the toolbar while have made the changes to the options that you the Customize Toolbar dialog is displayed. To add a wish, choose File. Rpply or COMMAND-A to new icon, use option-mouse click to choose a place "apply· the options and continue launching SAS. in the icon list to insert the new icon. Then provide This functionality allows you to customize even a a name and action for the icon, and choose an icon particular invocation of SAS. from the list provided to graphically describe what

1292 your new icon will do. Once you close the Customize Toolbar dialog, yourtoolbar will reflect The 'jmp' engine keyword identifies jmplib as a JMP the changes you made. library. After this, any input reference to a "data set" in the library jmplib is expected to be a JMP table, and any output reference will write out a JMP table. The engine provides many translations between JMP tables and SAS to make up for differences in JMP tables and SAS data sets. For example, JMP only supports one missing value format, while SAS supports 28 distinct formats. Missing values from Figure 1 : The Toolbar Palette JMP are converted to the standard SAS missing value, and all SAS missing values are converted to The Command Line Palette (shown in Figure 2) is the one JMP missing format. Date and dateltime an optional palette where command-line style format translations are also handled transparently. actions can be entered. By default, it is not Mappings take place, such as JMP table and column displayed. To have it displayed, choose notes being mapped to SAS data set and variable Window. Show Command Palette or press labels, and JMP column names being mapped to COMMAND-TAB. COMMAND-TAB will also allow SAS variable names, and vice versa. you to toggle between the command palette and anywhere else you are positioned in SAS. For There are differences in the way JMP stores data example, if you are typing in the Program Editor, and the way SAS stores data, so there are some and decide you want to enter a command, you may limitations on the translation between SAS and JMP press COMMAND-TAB and the command palette data. Versions 1 and 2 of JMP supported a ten-byte will become the active window (this will also cause it floating point numeric, while SAS only supports to be displayed if it was hidden), ready for your eight-byte floating point numerics. SAS will convert input. Once your are finished entering commands, all ten-byte numerics to eight bytes. press COMMAND-TAB again to resume typing in the Program Editor. JMP allows character data to be longer than 200 characters, while SAS has a limit of 200 characters. Any JMP character data that is longer than 200 characters will be truncated upon conversion to a 91 SAS data set. Similarly, SAS data set labels can only be 40 characters or less. JMP table notes that Figure 2: The Command Palette are longer than 40 characters will be truncated to 40 when stored as SAS data set labels. If you know that you will be sharing data between SAS and JMP, JMP engine you might take some care to watch the length of JMP is SAS Institute's standalone statistical character data and table notes, to reduce the visualization and analysis tool for the Macintosh. We chance of truncated data when SAS accesses the felt it was important to provide an interface between JMPtables. this existing product on the Macintosh platform. The SAS System provides a JMP engine in Release JMP allows table names that do not meet the 6.10 to allow JMP tables to be accessed requirements of SAS data set names. The JMP transparently as SAS data sets and by SAS engine provides a data set option, TBLNAME= to procedures. allow SAS to access these tables with invalid SAS names. These names may be longer than eight The JMP engine provides read and write, but not characters, or contain spaces. Enclose the table update, access to JMP tables. The key interface is name in double quotes as the argument to the the LlBNAME statement qualifier that identifies a TBLNAME= option, and the "data set name" libname as referring to JMP objects. Here is an provided after the libname reference will be ignored example of a LlBNAME statement that refers to the in favor of the name provided with the TBLNAME= JMP engine: option. Here is an example:

LlBNAME jmplib jmp 'MyDisk:JMP Stuff:tables:'; LlBNAME jmplib jmp 'MyDisk:JMP Stuff:tables:'; PROC PRINT data=jmplib.table The following data step will create a JMP table, (TBLNAME="My long JMP table name"); run; named newtbl, in the library 'jmplib': This code will access the JMP table in the library data jmplib.newtbl; 'jmplib' with the name 'My long JMP table name.' do 1=1 to 360; Y = sin(i); output; end; run; The 'table' name provided in the DATA= option is

1293 required by the syntax of the data step, but in this case, it is ignored. To enable a SAS session on a Macintosh to act as a server in a SAS/SHARE environment, the following One limitation of the JMP engine is that it does not setup is necessary: support directory access to libraries of JMP tables. This means that PAOC DATASETS cannot be options comamid=tcp; invoked for JMP libraries. Also, constructs that PAOC SEAVER id=servername; run; require the processing of all members of a library, such as using the _ALL_ qualifier with PAOC The 'servemame' must be supplied from a services CONTENTS, are not supported. Concatenated file, which maps server names to port numbers. To libraries are not supported with the JMP engine. facilitate this PROC SERVER invocation, your Otherwise, SAS procedures can access JMP tables configuration file must contain the following line: as SAS data sets. This provides a very powerful interface if you have data stored in JMP tables. -set GSBN_servername

GENERAL TECHNICAL INFORMATION where 'servemame' matches the 'servername' in the PROC SERVER invocation, and the port number System 7.5 must be the port number associated with the server System 7.5 of MacOS provides all the pieces name. Once this is set up in your configuration file, needed to support all of the SAS System's your SAS/SHARE session should work fine. functionality for the Macintosh, bundled together. Also, AppleScript is required for SAS to run on a To enable a SAS session to run as a client, i.e., Power Macintosh. On a 680xO Macintosh, SAS will access a server library, on a Macintosh, the steps run without AppleScript, but X command, are similar. Instead of issuing a PROC SERVER %SYSEXEC macro, and CALL SYSTEM routine invocation, you issue a LlBNAME statement to refer support is not available unless AppleScript is to the server library: present. The Drag and Drop Manager provides some extra drag-and-drop support, such as LlBNAME myshrlib REMOTE dragging and dropping a text file onto the Program '' SERVER=servemame; Editor, and is bundled within System 7.5. MacTCP, which is required for SAS/CONNECT® and In this case, 'servemame' is used in the same SAS/SHAAE®, is bundled into System 7.5. It must context as in the server case. Also in this case, the - be installed if you wish to run SAS/CONNECT or set GSBN_servername must exist in SAS/SHAAE. the configuration file, with the server name matching the one provided in the LlBNAME Using SAS/CONNECT and SAS/SHARE statement. SAS/CONNECT is a product that allows a local SAS session to establish communication with one or Installation options and configuration files more remote SAS sessions. SAS/SHAAE is The SAS System install process allows you to software that facilitates concurrent update access to choose between three types of installations. One is SAS files between multiple SAS applications. A a "quick" install, which simply installs all products on SAS server, that runs in a separate execution, your media in the location you specify. A serves SAS/SHARE users by contrOlling input and "customized" install allows you to choose which output requests. Both of these products require products to install. A "by folder" install allows you to MacTCP to run. This, again, may be bundled into install certain products on a local disk, while System 7.5 of MacOS, or can be a separate accessing the rest of the system directly from a CD­ in System 7.1. ROM or from a server. The first time SAS is invoked, a folder named SAS is created in the Preferences SAS/CONNECT allows you to submit SAS code for folder. This folder, which will be referred to as the proceSSing on remote hosts. To enable this remote SAS preferences folder, contains things such as a access, you must submit the following code: saswork folder and a sasuser folder and other items necessary for SAS to run properly. options comamid=tcp remote=remoteid; A configuration file is a file containing options which where 'remoteid' refers to the IP address of the SAS uses at startup time to determine its remote system. The COMAMID= option is the environment for execution. The installer creates a communications access method id option. Once "default" configuration file, named config.sas610, you set this up, you can then issue the SIGNON and which resides in the location where the system is ASUBMIT commands as you expect in installed. The name used to refer to this install SAS/CONNECT. location is SASROOT. SAS must have a correct

1294 concept of where SASROOT is. Once you have Taking care with your use of configuration files will installed the system, the first time you invoke SAS, insure your system runs correctly and optimally. you will be prompted to identify the SASROOT location. SAS stores this information in a resource FUTURE DIRECTIONS associated with the SAS application icon. Release 6.10 is a major first effort at providing SAS Thereafter, SAS refers to this resource to obtain the capabilities in a Macintosh-friendly environment. value of SASROOT. It is imperative that SASROOT We have plans for future enhancements to the be set properly for the SAS System to function system, but we also realize that user feedback from properly. this first release will be quite valuable in prioritizing our goals and identifying new ones. There are times when having more than one configuration file is necessary or desirable. One of Some of our current plans for future releases of the these times is when you choose a "by folder" install SAS System for Macintosh include broadened of the SAS System in the installer. A "by folder" network support, including evaluating alternate install is useful when you have a limited amount of networking protocols, such as DECnet (Pathworks) disk space on your local machine or when you want and AppleTalk. Database access is an important to boost the performance of the system. Running future goal, and we are evaluating which database totally off of a CD-ROM or from a server can reduce access technologies to support through performance, but you may not have enough local SAS/ACCESS®. Some likely candidates include disk space to install the entire SAS system. With a ODSC, and native Macintosh databases like 4th "by folder" install, you choose certain products to Dimension. install locally (typically the most heavily used products), and access the rest of the system from a Other future plans include improved AppleScript CD-ROM or a server. When you choose this type of support, focusing on support for the text edit suite install, the installer creates a local configuration file, and the table suite, and communication of SAS which contains information about where to find macro variable translation. We are evaluating the these locally installed pieces of the system. A need for PowerTalk access to E-mail, and enhanced configuration file that exists on the CD-ROM or the multinational support using WorldScript. We also server is still also used to locate the rest of the plan to provide support for SAS/SHARE*NET. In system. This second configuration file is created in the graphical user interface, we plan to support a the installed area on the local machine. Also point-and-click LlSNAME, similar in functionality to created is an , called saslocal, which aliases the the FILENAME statement interface available in the installed area. This alias is put into the SAS first release. preferences folder. The saslocal area is the first place that SAS looks to find a configuration file, so CONCLUSION the locally installed products will be found first. Release 6.10 of the SAS System for Macintosh provides a new choice in desktop computing. The Another situation where an additional configuration Macintosh is a powerful environment, and the SAS file is useful is when you have used the Option System is a powerful user tool, with vast computing Editor to make changes in configuration options. It and data processing capabilities. This paper has is recommended that you save any changes you addressed many technical issues regarding the make to a "personal" configuration file, and put that integration of the SAS System into a Macintosh configuration file in the SAS preferences folder, enterprise. With small bits of technical knowledge, where SAS will find it during invocation. Saving many powerful things can be done within the SAS changes to the default configuration file is System. This paper should be considered a dangerous and can result in loss of default options "technical appendix" to other documentation that may be hard to recover. Always using a "local" provided on the system. configuration file for option changes is a good practice to follow and will prevent unwanted changes to the default configuration file. Once you save a new configuration file using the Option SAS. SAS/ACCESS. SAs/CONNECT. SAS/GRAPH. SASISHARE Editor, you are responsible for putting it in the and JMP are registered trademar1

Configuration files are very important to the functioning of the SAS system, and are very powerful for shaping the environment SAS runs in.

1295