Download presentation
Presentation is loading. Please wait.
Published byFelix Price Modified over 9 years ago
1
SAS® Explorer Use and Customization Richard A. DeVenezia
2
Dad 1. More caffenie 2. Work, then relax 3. Take 15 min nap every hour 4. Have fruit for snack instead of junk food 5. Splash water on face instead of rubbing your eyes 6. Soothing music while working A candle might help
3
Explorer Motif –Left hand side –Right hand side Windows, SAS, File Managers, Database Explorers, IDEs
4
SAS Environment Libraries File Shortcuts Favorite Folders My Computer Results Metadata
5
Active Components Customize First level nodes Registry CORE\EXPLORER\INIT
6
Viewing Modes Explorer –Tree and List Contents Only –Just List
7
View Mode With icons –Large or Small –Left to right List –Small icons –Newspaper style Details –My favorite
8
Sorting Contents Details mode –click column header –no direction indicator like Windows Explorer View menu –Sort choice
9
Libraries node Contains a list of Library Items –One item per assigned LIBREF –Aka the list of LIBNAMES
10
Library node Contains a list of Member Items Tables Views Catalogs MDDBs
11
Catalog member node Contains a list of Catalog Entries Log, Output, Source Screen, Form Frame, SCL, Class More than 60 catalog entry types!
12
Context Menu Every item listed in a “Contents of” Window has a right click popmenu Specific menu shown depends on item type –“Context” menu
13
Context Menus SAS Supplied Menu Items –Numerous –Sensible –Neat (View in Excel) Items also known as –Choices –Actions
14
Create a Menu Choice Menu: Tools / Options / Explorer... Command: EXPOPTS
15
Choices of an Item Know an Actions Action Command –Meat of an action
16
Item name parts Library Member –LIBNAME, MEMNAME Catalog Entry –LIBNAME, MEMNAME, OBJNAME, OBJTYPE
17
Item type Explorer knows the type Library Members –TABLE, VIEW, MDDB, CATALOG –not surfaced to Action Command Catalog Entries –FRAME, SCL, OUTPUT, SLIST,... –At least 60 entry types –surfaced to Action Command
18
Action Command SAS Command –{Command} {Arguments} Arguments will want to deliver context to the command –The item name parts
19
Delivering Item Name Parts Library Member –%8b is replaced with LIBNAME –%32b is MEMNAME Catalog Entry –%8b is LIBNAME –%32b is MEMNAME –%32b is OBJNAME –%8b is OBJTYPE
20
Simple Action Command Library Member –DIR %8b Opens a DIRECTORY window, of which the member is in. –FSVIEW %8b.%32; FORMULA Opens the member in FSVIEW and loads the default formula from SASUSER.PROFILE.
21
Action Commands and Macro % is reserved for %8b and %32b % passes % to command tokenization Catalog Entry –%put picked:%8b.%32b.%32b.%8b Writes the catalog entry information to the SAS Log
22
Submitting Code GSUBMIT command Library Member –gsubmit ‘data _null_; put ”You picked: %8b.%32b.%32b.%8b”;run;’ Runs a DATA step that writes the library members name information to the SAS Log
23
Running SAS/AF programs AFA command Library Member –afa c=sasuser.myhandlers.foo.scl entry=%8b.%32b Runs a SAS/AF SCL program that is passed the name information of the library member right clicked on.
24
SAS/AF arguments Passed in the local environment list declare char NAME='entry'; declare char VALUE = getNitemC ( getNitemL ( envlist('L'), '_CMDLIST_' ), NAME, 1, 1, '‘ ); put NAME= VALUE=;
25
Running SAS/AF programs Some interesting SAS actions are implemented in SAS/AF Copy_to_clipboardCopy a Table to the Clipboard as HTML Excel_table_openOpen a SAS Table in Excel Save_as_htmlSave a SAS Table as HTML Open_html_entryOpen an HTML entry with WBROWSE Open_sas_fileOpen a SAS7BDAT or SAS7BCAT file Open_fileExample Action for processing a file Open_catalog_entryExample Action for Processing a Catalog Entry
26
Autocall Macros Centralize the Action Command coding task Proper place for lengthy amounts of code –Do not want to clutter SAS registry with lots of code that is hard for a coder to reach Deployable to other users
27
Programmatic Customization Avoid tedious mousing around Insert Action Commands directly into registry keys CORE\EXPLORER\MENUS\MEMBERS CORE\EXPLORER\MENUS\ENTRIES CORE\EXPLORER\MENUS\FILES CORE\EXPLORER\MENUS\METAEXPLORE\TypeFilters
28
Programmatic Customization Proc REGISTRY c:\temp\foo-actions.txt [CORE\EXPLORER\MENUS\MEMBERS\TABLE] "Foo 1"="VT %8b.%32b” "&Foo 2"="VT %8b.%32b” "10;&Foo 3"="VT %8b.%32b” "09;&Foo 4;100"="VT %8b.%32b” SAS Session Proc REGISTRY IMPORT="c:\temp\foo-actions.txt"; run;
29
Where’s my SAS Actions? In the SASHELP Registry! Copy them into your SASUSER registry Proc REGISTRY USESASHELP STARTAT='CORE\EXPLORER\MENUS\MEMBERS\TABLE’ EXPORT='c:\temp\factory-table-actions.sasreg'; Proc REGISTRY IMPORT='c:\temp\factory-table-actions.sasreg';
30
I want to go home Remove customizations by deleting entries in the SASUSER registry Proc REGISTRY STARTAT='CORE\EXPLORER\MENUS\MEMBERS\TABLE’ EXPORT='c:\temp\sasuser-table-actions.sasreg'; Proc REGISTRY UNINSTALL='c:\temp\sasuser-table-actions.sasreg'; If a SASUSER branch is empty then SAS Explorer will use the SASHELP branch (home)
31
Automacros II %macro action_members_table_A1 (lib,mem,pos3,pos4) / des='FS Browse'; /* browse a table using the likenamed screen stored * in sasuser.profile */ fsbrowse &lib..&mem sasuser.profile&lib..&mem..screen; %mend; Programmatically realizable
32
Automacros II – Realizable? Read Metadata –DICTIONARY.CATALOGS –NAME is action_{branch}_{type} –DES is {text} Write import file and import [CORE\EXPLORER\MENUS\{branch}\{type}] “{DES}”=“%{NAME}(%8b,%32b,%32b,%8b)”
33
Conclusion SAS Explorer is –essential –full featured –extensible Download a wide variety of actions from http://www.devenezia.com/downloads/sas /actions/main.phphttp://www.devenezia.com/downloads/sas /actions/main.php
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.