User:Audi

From sasCommunity

Jump to: navigation, search
< User:Audi

Audi's Blog

2008 February 20 10:00:35 EST
Posted By: Audi
Discussion
Audi'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.

Blog Entry: User:Audi/BlogEntry: 2008 February 20 10:00:35 EST

2007 July 24 09:21:00 EDT
Posted By: Audi
Discussion
Audi's Blog

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!)


With lots of codes to write (macros especially), I can't imagine life without IntelliSense.

Blog Entry: User:Audi/BlogEntry: 2007 July 24 09:21:00 EDT

2007 May 20 22:01:57 EDT
Posted By: Audi
Discussion
Audi's Blog

SAS and Windows Vista

You can install SAS under Windows Vista (32-bit versions only) by following this step-by-step installation workaround.

Blog Entry: User:Audi/BlogEntry: 2007 May 20 22:01:57 EDT

2007 April 18 09:31:02 EDT
Posted By: Audi
Discussion
Audi's Blog

A new blog entry has been added to my main site.

Audi

http://sas2themax.com

Blog Entry: User:Audi/BlogEntry: 2007 April 18 09:31:02 EDT

2008 March 03 11:20:04 EST
Posted By: Audi
Discussion
Audi's Blog

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...

Blog Entry: User:Audi/BlogEntry: 2008 March 03 11:20:04 EST

2007 April 16 22:29:27 EDT
Posted By: Audi
Discussion
Audi's Blog

ODS-HTML Editor

Now accepting beta testers for an upcoming product "ODS-HTML Editor". Please send an email to betatesting@sas2themax.com

Blog Entry: User:Audi/BlogEntry: 2007 April 16 22:29:27 EDT

2007 April 7 10:03:33 EDT
Posted By: Audi
Discussion
Audi's Blog

Beta testing of sas2themax Notebook

If you would like to be a Beta tester for sas2themax's Notebook, please send an e-mail to betatesting@sas2themax.com.

Blog Entry: User:Audi/BlogEntry: 2007 April 7 10:03:33 EDT

2007 April 17 10:03:33 EDT
Posted By: Audi
Discussion
Audi's Blog

Beta testing of sas2themax Notebook

If you would like to be a Beta tester for sas2themax's Notebook, please send an e-mail to betatesting@sas2themax.com.

Blog Entry: User:Audi/BlogEntry: 2007 April 17 10:03:33 EDT

2007 November 07 15:19:30 EST
Posted By: Audi
Discussion
Audi's Blog

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 :-)

Blog Entry: User:Audi/BlogEntry: 2007 November 07 15:19:30 EST

2007 October 23 16:01:10 EDT
Posted By: Audi
Discussion
Audi's Blog

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!

Blog Entry: User:Audi/BlogEntry: 2007 October 23 16:01:10 EDT

2007 September 25 14:23:12 EDT
Posted By: Audi
Discussion
Audi's Blog

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.

Blog Entry: User:Audi/BlogEntry: 2007 September 25 14:23:12 EDT

2007 August 02 15:12:45 EDT
Posted By: Audi
Discussion
Audi's Blog

Notebook User's Testimonial

Every 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)."


Based from the user's feedback, the next release of Notebook will include a "Recent Folders" feature.

Get the latest version of Notebook today!

Blog Entry: User:Audi/BlogEntry: 2007 August 02 15:12:45 EDT

2007 July 25 12:26:32 EDT
Posted By: Audi
Discussion
Audi's Blog

Smarter code indenter

Notebook'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!

Blog Entry: User:Audi/BlogEntry: 2007 July 25 12:26:32 EDT

2007 July 23 11:55:21 EDT
Posted By: Audi
Discussion
Audi's Blog

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.

Blog Entry: User:Audi/BlogEntry: 2007 July 23 11:55:21 EDT

2007 July 01 15:03:12 EDT
Posted By: Audi
Discussion
Audi's Blog

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.]


Update6: Version 1.0.1.6 has fixed a problem with the "Add Existing Item..." menu in the Project Explorer. When adding multiple files to a project, the added files may contain "garbage" because of an error in the way the files are being copied into the destination folder. This error has been fixed.]


Update5: Version 1.0.1.5 has fixed the following problems: (1) a bug in the "Submit" routine that prevents SAS datasets from being saved and succeeding "Submit" or "Run Project" commands to become unresponsive; (2) a problem with opening SAS datasets taking too much time to appear on the data grid; (3) other minor bugs.]


Update4: Version 1.0.1.4 has fixed the following problems: (1) a bug in the Web Explorer throwing an exception (access denied error message) in some web pages; (2) an exception is thrown when the "Add Existing Item..." menu in the Project Explorer is used and there is currently no assigned output folder; (3) a bug in the Project Explorer treeview when a dataset is double-clicked and a tab other than the Project Explorer is currently active; (4) the line and column numbers showing (or not showing) incorrectly; (5) project items that no longer exist in the project location do not appear with the broken link icon; (6) a numbered error/warning/note does not show the actual location of the error/warning/note in the log when clicked -- this happens when the active tab is the Code Editor.]


Update3: Version 1.0.1.3 has fixed the following problems: (1) the "Run Project", "Submit", and "Submit Selection" menuitems become unresponsive after the initial run/submit processing; (2) no navigational buttons for the Code Editor's companion fileviewer when the Project Explorer tab is active; (3) no "Submit", and "Submit Selection" context menu commands when a SAS program is opened inside the Project Explorer tab; (4) other minor problems/issues.]


Update2: Version 1.0.1.2 has fixed the following problems: (1) Notebook installed on machines with SAS v9.0 cannot open a SAS dataset in the Data Editor; (2) libname statement not being "remembered" by Notebook when running selected parts of a main program (or project) that do not contain the original libname statement; (3) a bug in the companion file viewer of the Code Editor, in which double clicking on a folder brings up an IO error message; (4) other minor revisions in the source code.]


Update1: A new version of Notebook, with a Visual-Studio-like way of creating and managing SAS projects, is now available for download at: http://sas2themax.com/beta. If you have an older version currently installed, just run it and it will detect the presence of a newer version.


A new blog has been posted, giving a sneak-peek of a forthcoming Integrated Development Environment (IDE) designed exclusively for SAS programmers. Read more...

Blog Entry: User:Audi/BlogEntry: 2007 July 01 15:03:12 EDT

2007 June 17 11:47:00 EDT
Posted By: Audi
Discussion
Audi's Blog

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.

Blog Entry: User:Audi/BlogEntry: 2007 June 17 11:47:00 EDT

2007 June 10 03:32:11 EDT
Posted By: Audi
Discussion
Audi's Blog

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!


Latest blog: sas2themax's New Data Editor tackles SAS DATA Step chores...Read more...

Blog Entry: User:Audi/BlogEntry: 2007 June 10 03:32:11 EDT

2007 June 11 10:29:58 EDT
Posted By: Audi
Discussion
Audi's Blog

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.

Blog Entry: User:Audi/BlogEntry: 2007 June 11 10:29:58 EDT

2007 June 05 16:19:29 EDT
Posted By: Audi
Discussion
Audi's Blog

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

Blog Entry: User:Audi/BlogEntry: 2007 June 05 16:19:29 EDT

2007 May 20 09:30:50 EDT
Posted By: Audi
Discussion
Audi's Blog

Reminiscing Finland...

If there's a place I want to visit again, it's Finland -- the land of midnight sun! Read more...

Blog Entry: User:Audi/BlogEntry: 2007 May 20 09:30:50 EDT

2007 May 19 07:51:04 EDT
Posted By: Audi
Discussion
Audi's Blog

Editing and Updating a SAS Dataset

I 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? :-)

Blog Entry: User:Audi/BlogEntry: 2007 May 19 07:51:04 EDT

2007 May 15 09:48:00 EDT
Posted By: Audi
Discussion
Audi's Blog

SAS Dataset Metadata -- Reading variables and table attributes

Metadata 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?

Blog Entry: User:Audi/BlogEntry: 2007 May 15 09:48:00 EDT

2007 May 08 20:30:26 EDT
Posted By: Audi
Discussion
Audi's Blog

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.]


With its documentation mostly obsolete and lacking in samples (like a complete Visual Studio 2005 sample project -- not just code snippets or code fragments that don't mean anything unless used in an actual project), SAS/Integration Technologies really needs competent staffing to do an overhaul of the outdated documentation. Its coverage of obsolete technologies like VB6 and ADO should be removed, and replaced with more coverage of usage that applies to the Visual Studio 2005 .NET architecture.

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.

Blog Entry: User:Audi/BlogEntry: 2007 May 08 20:30:26 EDT

2007 May 02 13:05:12 EDT
Posted By: Audi
Discussion
Audi's Blog

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...

Blog Entry: User:Audi/BlogEntry: 2007 May 02 13:05:12 EDT

2007 April 20 09:27:22 EDT
Posted By: Audi
Discussion
Audi's Blog

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

Blog Entry: User:Audi/BlogEntry: 2007 April 20 09:27:22 EDT

2007 April 27 11:03:44 EDT
Posted By: Audi
Discussion
Audi's Blog

Need a free FTP client?

Try Notebook's FTP Explorer...read more

Blog Entry: User:Audi/BlogEntry: 2007 April 27 11:03:44 EDT

2007 April 26 06:56:55 EDT
Posted By: Audi
Discussion
Audi's Blog

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

Blog Entry: User:Audi/BlogEntry: 2007 April 26 06:56:55 EDT

2007 April 25 06:57:36 EDT
Posted By: Audi
Discussion
Audi's Blog

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...

Blog Entry: User:Audi/BlogEntry: 2007 April 25 06:57:36 EDT

Views
Personal tools