Saturday, April 25, 2009

Internet Explorer 6 at Work

At my last and current job, my computers have been set up with Internet Explorer 6 as the default browser, even though Microsoft has developed Internet Explorer 7 and version 8, not to mention the flourish of alternative browsers, like Firefox, Safari, and Google Chrome, to mention only a few.

I've noticed that the possible reason for this may be legacy software, software that may exploit some security hole in Internet Explorer 6 in order to operate. At my last job, I downloaded Internet Explorer 7 because I thought it would be more secure while I was performing research. (At my new job, the IT department is much more serious about security, since the company deals with health care data. I am unable to modify much of anything. My screen resolution isn't even permanent!)

When I tried to access one of the company's intranet pages for storing customer information, I received numerous errors while trying to use some of the features. I tried lowering the security settings, updating all sorts of related software, and modifying the connection settings, all to no avail. It just wasn't going to work on Internet Explorer 7.

The software has some serious flaws - it's number 8 on the worst tech products of all time rated by PCWorld and the Computer Emergency Response Team has recommended that internet users not use it at all. So I'm wondering, with all of the security flaws and out-of-date features, why do companies still use it? Do newer versions lack compatibility with legacy software? Is it too difficult and time-consuming to convert to the newest version? Is it easier just to wait until Vista is the defacto operating system for business PCs? What is the reason?

Update: One of my co-workers had IE 8 installed. It was an attempt to help a web interface work better, and it seemed to do the trick! Lesson: Upgrade!

Monday, April 20, 2009

Proc SQL

Today at work, the following conversation took place:

Me: A watched proc SQL never quits.
Supervisor: Or worse, generates errors!

(Note: Proc SQL is procedure for using SQL in SAS.)

Friday, April 10, 2009

Are You Sure - SAS Code

Update on May 20, 2009: Users may wish to add "memtype=data" option to the proc datasets statement to drop only SAS tables (see below). I believe the proc datasets procedure will delete formats and possibly other types of data.

Today I wrote a macro program in SAS to delete all of the contents of a specified library. I programmed a pop-up window to ask the user if they really want to delete everything. Here's the code:

%macro DeleteLib(lib);

%let rusure=N;

/* Pop up a window to ask a question */
%window surewin
// @20 "Are you sure you would like to delete all tables from &lib?"
@81 rusure 1 attr=rev_video required=yes " (Y/N)"
%display surewin delete;

%put rusure=&rusure;

/* Delete all tables if Yes */
%if &rusure=Y %then %do;

data dummy;

proc datasets library=&lib memtype=data;
save dummy;

proc sql;
drop table &lib..dummy;

%put NOTE: All tables have been deleted from &lib.;


/* Put a comment if No */
%if &rusure=N %then %do;

%put NOTE: No tables have been deleted.;


%mend DeleteLib;

The first and last line are the beginning and end of the macro program. The second line sets the variable "rusure" (that is, "Are you sure?") to "N" for "No" by default. The next block creates the window and pops it up. In the window the user can specify "Y" or "N" to specify whether to delete the library (think of it as a folder or directory with SAS datasets in it). (The code uses a macro variable "&lib" to insert the name of the library.) If "Y", then the code creates a dummy dataset with nothing in it, runs a program that keeps only the dummy dataset and delete everything else, then it drops the dummy dataset and puts a note in the log. If "N", then it just puts a note in the log.

At first I thought of putting another set of code in there as a double-check: An additional window asking "Are you REALLY sure you want to delete the library?" then running another Y/N if statement. But then I thought that might be a little annoying to have to deal with so many windows.

It would have been a funny April Fool's joke to insert a series of windows into someone's program asking, "Do you want to run this program?", "Are you sure you want to run this program?", "Are you REALLY sure?", "REALLY, REALLY sure?", "Wouldn't you rather run another program?". The user would have to keep hitting Y or N over and over again to get it to work. It would be easy to insert a small line of code referencing another piece of code using a %include statement (for example, %include "c:\AprilFools\";). A trickster could even hide the code after a line of spaces far to the right of the window where no one would find it.

If anyone tries that, let me know what happens!

Saturday, April 4, 2009

Keyboard Shortcuts

I love keyboard shortcuts. There's no better way to do things quickly than by using a keyboard. If you think about it, using all fingers instead of moving your hand/arm and clicking with one finger must be faster. But first you need to know the shortcuts. Here's a list of some good resources for keyboard shortcuts in various programs:
  1. Windows XP
  2. Windows Vista (Remote Desktop)
  3. Firefox
  4. Microsoft Excel (Others)
  5. Microsoft Outlook
  6. SAS
Here are some of my favorite shortcuts--ones that people don't usually know about. These are based in Microsoft Windows XP.
  1. Alt+Tab for switching programs. Ctrl+Tab for switching tabs in Firefox or other tabbed programs. Alt+Page Up or Page Down is incredibly useful on remote desktops for switching between programs just like Alt+Tab.
  2. Ctrl+Shift+Esc brings up Windows Task Manager. Similarly, Windows+Break brings up the System Properties. The usual Windows combinations are good, too, especially Windows+L, which locks the computer, Windows+D, which shows the desktop, and Windows+E, which opens Explorer.
  3. Alt+F4 terminates a program. In some programs Ctrl+F4 terminates a window, submenu, or other child program within a program. I like to use that in SAS quite a bit. Ctrl+Shift+T opens a new tab in Firefox, and Ctrl+W closes tabs in Firefox.
  4. Keyboard shortcuts can be assigned to shortcut icons. At home and work, I use the Ctrl+Alt+Shift combination for typical programs. I usually assign Ctrl+Alt+Shift+W for Microsoft Word, Ctrl+Alt+Shift+X for Excel, Ctrl+Alt+Shift+N for Notepad, and Ctrl+Alt+Shift+C for Calculator.
  5. At work, I use the Ctrl+Alt combination for connecting to various programs that allow me access to something, for example, Ctrl+Alt+S for connecting to SAS, Ctrl+Alt+R for connecting to remote desktops, and Ctrl+Alt+Q for Rapid SQL.
  6. In Excel, Ctrl+; enters the current date and Ctrl+: enters the current time. Ctrl+" copies the cell above to the selected cell and Ctrl+' copies a formula in the same manner. Alt+Enter inserts a line break within a cell, allowing the user to break text across more than one line. Ctrl+Home, Ctrl+End, Ctrl+Page Up, and Ctrl+Page Down are useful navigational keyboard shortcuts in Excel, too. Try them out!
  7. In Microsoft Office, Ctrl+K creates a hyperlink on the selected text.
  8. In Microsoft Outlook, Ctrl+D deletes highlighted or currently viewed mail. Ctrl+Shift+V brings up a menu to move currently highlighted/viewed mail to a folder. Alt+F4, like above, terminates the current open message (I thought Ctrl+F4 would make more sense).
  9. In SAS, the best one to know is F9. Then you can read about all of them! Otherwise, F8 for submitting programs, F6 for viewing the log, F7 for viewing output, and F5 for viewing programs. Keep pressing F5 to toggle between multiple programs.
  10. If the Language Bar toolbar is on in Windows, don't hit Alt+Shift. It switches the language! That one gets me all the time, since my wife uses Chinese on our computer on occasion. And for some reason I bump it quite often.
That's about all I can think of right now. I like learning new keyboard shortcuts, and I know there are a lot more to learn. What are your favorites?