Archive for the 'Programming' Category

14Jun

ERROR 22-322: Syntax error, expecting one of the following: a name, *.

This is one of the classic SAS errors that you can get from PROC SQL and it can be thrown by a number of things. Missing out a comma in a list of variables on a SELECT statement is one situation that will do it, as will having an extraneous one. As I discovered recently, an [...]

08Jun

ERROR: Invalid value for width specified – width out of range

This could be the beginning of a series on error messages from PROC SQL that may appear unclear to a programmer more familiar with Data Step. The cause of my getting the message that heads this posting is that there was a numeric variable with a length less that the default of 8, not the best of [...]

04Mar

Reading data into SAS using the EXCEL and PCFILES library engines

Recently, I had the opportunity to have a look at the Excel library engine again because I need to read Excel data into SAS. You need SAS Access for PC Files licensed for it to but it does simplify the process of getting data from spreadsheets into SAS. It all revolves around setting up a library pointing [...]

22Jan

A few more SAS functions to know

There are whole pile of SAS functions for testing text strings that hadn’t come to my attention until this week. Until then, I’d have gone about using functions like INDEX and PRXMATCH functions for the same sort of ends but it’s never any load to have a few different ways of doing things and to [...]

10Jun

%sysfunc and missing spaces

Recently, I was trying something like this and noted some odd behaviour: data _null_; file fileref; put “text %sysfunc(pathname(work)) more text”; run; This is the kind of thing that I was getting: text c:\sasworkmore text In other words, the space after %sysfunc was being ignored and, since I was creating and executing a Windows batch file [...]

08Jun

64-bit (Google) Gears

Gears offers the potential to speed up WordPress’ administration screens so I tend to add it to Firefox as a matter of course. However, Google only offers a 32 bit version so you are either left to your own devices with the source or you snag someone else’s efforts. I have gone for the latter [...]