Despite my best efforts and the many helpful suggestions of my publishers and editors, every book I’ve written has errors. Check this page for corrections to errors I find in Professional SAS Programming Shortcuts. If you may have found an error that is not listed here, please let me know about it by writing to me at email@example.com.
Chapter 9: The number of distinct missing values is 28.
Chapter 27, bubble sort of character string (1st and 2nd editions only): Change > to >= to make this program work correctly with strings that could contain duplicate characters.
Chapter 69 (third paragraph, 2nd edition only): investment
Page 42, middle: The log does not match the program. The correct log line for the program is:
Page 110: Use a value informat in the INPUT statement, the INPUT function, the INFORMAT statement, or anywhere else an informat is used.
Page 136: Formats for SAS time values include TIME, TIMEAMPM, HOUR, and HHMM. Write time durations with the TIME, HOUR, HHMM, MMSS, and F formats. Formats for SAS datetime values are DATETIME, DATEAMPM, TIMEAMPM, TOD, DTDATE, DTYEAR, DTYYQC, DTMONYY, and DTWKDATX.
Page 149: In version 8, the FORCE option is no longer required for the NODUPKEY option.
Page 232: The example calculates the amount that, saved for a period of 50 years at an effective annual interest rate of 6%, results in a value of $1,000,000.
Page 242: The example, with SAS time constants written correctly:
WHEN ('AT', 'EDT') DT_UNIVERSAL = DT_LOCAL - '-4:00'T;
WHEN ('ET', 'CDT') DT_UNIVERSAL = DT_LOCAL - '-5:00'T;
WHEN ('CT', 'MDT') DT_UNIVERSAL = DT_LOCAL - '-6:00'T;
WHEN ('MT', 'PDT') DT_UNIVERSAL = DT_LOCAL - '-7:00'T;
WHEN ('PT') DT_UNIVERSAL = DT_LOCAL - '-8:00'T;
Page 249: The correct name is not CLOSE, but CLS. (CLOSE is not a good choice for the name of an array because it is the name of a function.)
Page 252: The description of the age computation formula does not match the formula shown. To correct this, change the name CURRENT to DATE so that the sentence reads:
If the day is the SAS date DATE and a person’s birthdate is BIRTH, then this statement calculates the person’s age in years:
AGE = YRDIF(BIRTH, DATE, 'Actual');
Page 270: The WHERE clause always applies to input observations, and the step reads only observations that meet the condition. With WHEREUP=YES, it does not allow the observations to be changed so that they no longer meet the condition. With WHEREUP=NO, it is possible to change data values so that observations no longer meet the WHERE condition.
Page 411: Direct access techniques such as browsing and the POINT= option may be inefficient when used with with data step views.