User:Audi
From sasCommunity
< User:AudiAudi's Blog
Base SAS Certification Readiness Reviewer now on sale!sas2themax is pleased to announce the release of a new commercial product -- the Base SAS Certification Readiness Reviewer. This is an exam simulator and readiness reviewer for SAS Base Programming Exam for SAS 9 (Exam A00-211). To buy, go to SWREG store e-Store.
|
Type less, code more!Be more productive writing codes by typing less. Consider the following macro: %macro rdisplay(remote);
%local connectopts;
%if %nrbquote(&remote) NE %then
%let connectopts = &connectopts REMOTE=&remote;
RDISPLAY &connectopts;
%mend rdisplay;
With IntelliSense, you can write lines 3 to 5 without too much typing. For instance, consider typing the following: &connectopts With IntelliSense: &c (and hit the Space bar) (that's typing 2 chars instead of 12!) or this: %nrbquote(&remote) With IntelliSense: %nr(&r) (that's typing 7 chars instead of 18!)
|
SAS and Windows VistaYou can install SAS under Windows Vista (32-bit versions only) by following this step-by-step installation workaround.
|
A new blog entry has been added to my main site. Audi
|
sas2themax Notebook Light & Professional Versions now on sale!sas2themax is pleased to announce the release of commercial versions of its SAS programmer's IDE -- Notebook Light and Notebook Professional! To buy, goto SWREG's e-Store...
|
ODS-HTML EditorNow accepting beta testers for an upcoming product "ODS-HTML Editor". Please send an email to betatesting@sas2themax.com
|
Beta testing of sas2themax NotebookIf you would like to be a Beta tester for sas2themax's Notebook, please send an e-mail to betatesting@sas2themax.com.
|
Beta testing of sas2themax NotebookIf you would like to be a Beta tester for sas2themax's Notebook, please send an e-mail to betatesting@sas2themax.com.
|
Notebook now supports Microsoft Excel 2007!sas2themax's Notebook can now read Microsoft Excel 2007 workbooks! You can download the free version here. This new version requires that you download and install the 2007 Office System Driver. Give it a try today! Cheers, Audi :-)
|
sas2themax.com is back online!After a server glitch that resulted in some loss of user data, sas2themax.com is restored back to life! I apologize that some user login data have been lost in the process, which means the most recent users need to register again. A SQL backup of the entire sas2themax.com database was accidentally erased and so an older backup was used to restore the system. Lesson learned: keep at least two copies of the most recent backup file!
|
sas2themax Notebook Light (Free Version) Released!This free version is fully functional except for the following limitations: o Merging of Notebook libraries is disabled. o Opening of multi-sheet Excel (*.xls) workbooks in the Data Editor is limited to 5 worksheets. o Saving of SAS datasets into *.xls and *.csv formats is limited to 150 saved rows. Download the free version here.
|
Notebook User's TestimonialEvery now and then, I receive very encouraging e-mails from my Notebook users. Here's a recent testimonial I received from a SAS user in Canada: "I've been using the latest version of Notebook for a bit now. I wanted to say I love it and I use it now for almost all of my SAS work." "I like the recent documents feature, but it would also be nice to have a recent locations or to be able to create bookmarks to frequently accessed folders. (I see you have Recent Projects, but I do all of my work in my folder structure and not in the Notebook projects)."
Get the latest version of Notebook today!
|
Smarter code indenterNotebook's code indenter, the first and only SAS code indenter available to SAS programmers, has been improved. Writing a code indenter for an odd programming language like SAS is tricky. Take for instance the following line of code: infile "%sysfunc(compress(&flatfile,%str(%'%")))" pad eof=eof; Where is the end quote for the quote that starts after the "infile" keyword? Of course, it's easy to tell from a SAS programmer's point of view -- it's the quote before the "pad" keyword. But for a computer, it's hard to tell, especially if you're dealing with hundreds of lines of code. The latest version of Notebook (Version 1.0.0.15) can pinpoint the correct end quote correctly. Try it -- the one and only SAS code indenter of its kind!
|
How do SAS programmers create and manage their projects?I have the impression that very few SAS programmers use a tool (outside of SAS) to create and manage their projects. Those who use Enterprise Guide know how convenient it is to manage and revisit a project once it is created. But how many can afford EG? I have tried EG's interface but prefers a Visual Studio-style layout, where the project components are accessible from a right dockable window. This bias stems from the fact that I use Visual Studio to create and manage my C#/VB projects. I now use C# exclusively, but was once a VB programmer (before I took a C++ programming post-baccalaureate course at NC State University). My VB knowledge came to the rescue when scouring the SAS/Integration Technologies documentation on how to connect to a local and remote SAS server, and read/write/save SAS datasets. Most of the outdated samples are in Visual Basic! To get a sense of what I'm talking about, download Roland's free SPECTRE clinical reporting system and manage it using my Notebook. Here's how I would setup the project: o Create a folder on your hard drive and name it "Spectre".
o Create two (2) subfolders under the "Spectre" folder -- name them "macros" and "scripts".
o Extract the "macros.zip" file into the "macros" subfolder, the "scripts.zip" into the "scripts" subfolder,
and the "spectre.zip" file into the "Spectre" main folder.
o Open Notebook and click on the "New Project" button. Name the new project "Spectre". Browse to the location
of the "Spectre" folder for the "Create Project In:" info. Check the "Just create a blank project" option,
and click "OK".
o On the right dockable window, right-click on the "Spectre" node and select "Show All Files".
o Right-click on the "macros" node (subfolder) and select "Include in Project". Do the same for the "scripts" node.
o Right-click on the "Spectre" node and select "Add Existing Item...". Browse to the location of the "Spectre"
main folder and select all the non-folder items (excluding the Spectre.npj file) -- use the Shift key to select
a range of files, or the Ctrl key to select individual files. Click OK after making the selection.
o That's all you need to do to manage Spectre. Try double-clicking a SAS program/macro or an HTML file from the
project treeview to open it.
You should be able to apply the same steps to create and manage your SAS projects! You can set any SAS program as the startup program using the "Set as Startup Program" menu. Then use the "Run Project" button (with the green-colored triangular icon) to run your project. If the program has no errors, you will see the "Submit succeeded" message on the status label on the bottom left corner. Otherwise, you get a "Submit failed" message, with the number of errors shown! The "Errors" tab enables you to access each error message individually. I don't believe in the saying that it's difficult to teach old dogs with new tricks. :-) A good tutorial is all we need. Regards, Audi P.S. Notebook's code indenter is currently being edited to correct an issue when there are quote/parenthesis pairs with an embedded ";" character, or quotes/parentheses in a statement following a SAS code label.
|
Notebook presents a new project management tool for SAS Programmers!Update7: Version 1.0.1.8 is a whole new Notebook -- new Quick Start Guide plus several enhancements (--no more duplicate tabs; no more need to configure a SAS server, except when running the SAS Batch Processing Console; revised Wizards; and more!) A problem with the "Submit" or "Run Project" menu yielding blank log files after the first or initial run has also been fixed.]
|
Notebook Version 1.0.0.43 Uploaded[Update2: A new version is now available for download. Formats/informats now work correctly. A number of bugs have been fixed, including sorting persistence, list output, and more.] [Update1: Currently fixing the list of numeric formats (the format "w.d" is missing), and the list of date informats. Formatting of output files (*.lst) is also being fixed -- some lines incorrectly appear in blue font forecolor.] Enhancements: o Added drag-drop support for the "Filter Data" and "Insert Calculated Column" dialogs, and automatic brackets for variable names containing whitespaces; o Fixed a bug in which deleting a column in the Data Editor is not reflected or saved in the underlying dataset. o Modified the way new rows and columns are inserted. o Fixed the maximum length of formats/informats in the Column Attributes dialog. o Fixed the FTP connect dialog. o Changed the default view in the Code Editor's companion file explorer. o Fixed a bug in which the save data prompt is called more than once when exiting the application. Get the latest version of Notebook here.
|
New and improved! sas2themax's Data Editor[NOTE: When saving Excel/CSV files as SAS dataset (*.sas7bdat), variables of type "Character" (string) may be truncated because the proper length is not set correctly by the user. A dialog will be added to remind the user to check the FORMAT length of each character variable under the Column Attributes dialog. [Update4: Version 1.0.0.39 has been uploaded. When there are several tabs (files) open in the Data Editor, a problem occurs when switching tabs after performing a data filter operation. This problem has been fixed!] [Update3: Version 1.0.0.38 has been uploaded. Column names (variables) now conform to SAS naming rules when saving Excel/CSV files as SAS dataset; type conversions (eg. character-to-numeric, character-to-datetime) now work properly when there are missing values.] [Update2: Version 1.0.0.37 has just been uploaded. New features include spreadsheet-like row numbering, recent documents list for data files, improved character-to-numeric type conversion, persisted column widths when changing tabs in the Data Editor, save prompt when exiting application, and more. Also fixed a few bugs/issues.] [Update1: Version 1.0.0.35 has just been uploaded. It fixed (among other things) a problem when saving SAS datasets containing formatted numeric columns, and a bug in the character-to-numeric conversion algorithm. Also added a "$TITLECASE" custom character format. Try this task: Open a multi-sheet Excel workbook. Save each sheet as a SAS dataset!
|
Running Notebook under Windows Vista[Update2: Problem solved! See the solution here... [Update1: Looks like some users are still unable to connect to a SAS server installed under Windows Vista Business Edition, after performing the suggested solution below. I'm currently looking into the problem.] When running Notebook under Vista, you may encounter a "Cannot connect to your local SAS server." error message. To solve this problem, you must register the local SAS server by following the procedure outlined in this SAS Technical Support document.
|
Notebook v1.0.0.32 has a new Data Editor!New features: o Read and write SAS datasets o Editable SAS formats and informats o Editable date and numeric formats o Insert calculated columns o Filter rows o Insert rows/columns o Freeze rows/columns o Editable column attributes o Read/save Excel (*.xls) and CSV (*.csv) files -- (can also save as SAS dataset!) o and more! All these made possible by -- the SAS/Integration Technology, and a 3rd-party control (which limits the saved file to 150 rows). If you like this Editor and want to be able to save the whole file (all rows), send me an email:audi@sas2themax.com Download Notebook here: http://sas2themax.com/beta
|
Reminiscing Finland...If there's a place I want to visit again, it's Finland -- the land of midnight sun! Read more...
|
Editing and Updating a SAS DatasetI thought the hard part was reading a SAS Dataset and its metadata. It turned out to be easy. The hard part actually comes when its time to update a SAS dataset after editing its content, variable attributes (like variable name, format, informat, column label, etc). What makes it seem impossible using SAS Integrated Object Model (IOM) is the fact that not every SAS dataset has a suitable column that can be used as a primary key. Setting up an InsertCommand/DeleteCommand/UpdateCommand for an OleDBDataAdapter object requires a primary key, otherwise you get this error message: "Dynamic SQL generation is not supported against a SelectCommand that does not return any base table information." Now if someone out there can point me to a solution without resorting to writing and submitting a DATASTEP-based code, that would be great. Of course, with the SAS dataset content read successfully into a DataGridView control (with SAS DATE formats converted into a DateTime format), writing a DATASTEP-based code to save the grid's content into a SAS dataset should not be that difficult. Or is it? :-)
|
SAS Dataset Metadata -- Reading variables and table attributesMetadata about the variables in a SAS dataset is provided by custom columns in a COLUMNS schema rowset. A row in the COLUMNS schema rowset corresponds to one variable in the SAS dataset. Metadata about a particular SAS dataset (table), on the other hand, is provided by the TABLES schema rowset. One column that had me scratching my head lately is the NUMERIC_PRECISION column. Why is it that a NUMERIC_PRECISION of 15 results in the following length, format, and informat variable attributes (as read by SAS): Length: 8 Format: BEST12. Informat: 12. Why not... Length: 15 Format: BEST15. Informat: 15. when the range of w in the BESTw format/informat is 32? Of course, w=12 is the default, but what's the use of providing a numeric precision of 15?
|
SAS/Integration Technologies Woes -- Solved![Update3: I think I've found a solution: SN-V8-001474: Class not registered errors using SAS/Integration Technologies IOM server. Yes, it does work under Windows Vista! Now, Notebook + IOM has a chance. :-) [Update2: I've made some progress despite the scanty documentation. I can now open a SAS dataset from any location or path, assign/deassign librefs and filerefs, submit sas codes (from a string, path, or memory stream), retrieve logs and list output, listen to events (SubmitComplete, ProcStart/ProcComplete, DatastepStart/DatastepComplete, etc.). All these work under Windows XP. Under Vista, creating a workspace using the SAS ObjectManager throws a "class not registered" exception. Too bad, I may have to wait for SAS 9.2. :-( ] [Update1: I just discovered that the code snippet does not throw an exception when the project is run under Windows XP. My development machine is running Windows Vista so the problem may be OS-related. I understand SAS (and, logically, the Integration Technologies type libraries) still doesn't support the Vista OS.]
Look, the following C# code snippet throws an exception: ObjectFactory objectFactory = new ObjectFactory();
SAS.Workspace ws = (SAS.Workspace)objectFactory.CreateObjectByServer("", true, null, "", "");
Exception: <connectionAttempts>
<connectionAttempt>
<description>Class not registered</description>
<status>0x80040154</status>
<saslogin></saslogin>
</connectionAttempt>
</connectionAttempts>
With the "class not registered" error, I tried explicitly registering the referenced type libraries/PIAs using the RegAsm tool, but it didn't work. :-( I really wanted to get rid of "batch processing" in my Notebook for submitting SAS codes in the background, and replace it with a technique based on SAS Integration Technologies. So far, the progress is slow.
|
Output-free SAS programming?Writing too much raw code just to generate a SAS output? Let Notebook's ODS Graphical Interface Wizard do the dirty work for you! read more...
|
sas2themax's Notebook has been redesigned!The Code Editor now has a companion file view so you can conveniently work with your project files. Also, you can now open multiple SAS files (of same extension) with a single click of a context-menu button. Just use the Shift key (to select a range of files) or the Ctrl key (to select files one at a time), right-click on the selection, and then click on the "Open with Notebook" menu item. A problem with the ODS graphical interface when the RTF destination is selected, and that of the "Use custom tagset" option (remains checked for destinations other than markup) have been fixed. The previous version also had an issue with XP-themes. Download options: Option 1: http://sas2themax.com/beta Option 2: http://sas2themax.com/beta/mxnotebook28.zip The second option is an XCOPY-style installation. Just unzip the file to your hard drive, create a shortcut for the "mxnotebook.exe" file (the one with a blue notebook-pen icon), and move the shortcut to your deskstop. Required separate installation: .NET Framework 2.0 Redistributable Package Cheers, Audi
|
Need a free FTP client? Try Notebook's FTP Explorer...read more
|
E-mailing indented SAS programs in color! The majority of SAS programmers probably do not care about indenting and color, but for those who do...read more
|
Did you know that with the latest version of Notebook you can open a SAS dataset as a native Excel file, as an XML spreadsheet, as a comma-separated values (CSV) file, or as an HTML file without writing a single line of code? Read more...
|
