H
- How do I add a blank line in PROC REPORT positionally i.e. Insert a blank line after line 4?
*** First add a 'dummy' column with the row numbers *** ; data class ; set sashelp.class (keep = name sex age) ; row ... - How do I add comments to code in SAS?
/**********************************************************************************/ /*** ... - How can I search for a phrase in all SAS files in a directory and subdirectories?
/************************************************************************************/ /*** ... - How can I create a macro variable containing a quoted list from a dataset?
Using PROC SQL and the INTO clause along with the SEPARATED BY option and a compound separator creating quoted lists is easy. Using the PROC SQL ... - How do I change the order of columns in a dataset?
Changing the order of columns in an output dataset requires the use of a compile-time-only statement appearing before the SET statement to order the columns in ... - How do I know which Macro Quoting function to use?
There are anumber of characters and mnemonics which can cause issues in the Macro Processor - particularly those which appear in pairs: ' ' " " ( ) This ... - How does the 'SOUNDS LIKE' (=*) operator work in a WHERE statement?
The SOUNDS LIKE (=*) operator uses a soundex algorithm to simplify a word for comparison purposes. The algorithm is predicated on English however, and is less ... - How do I remove consecutive blanks from a text string?
While the COMPRESS function in SAS will remove, by default, every instance of the blank space, sometimes it is desirable to remove all-but-one of the ... - How do I remove repeated characters from a text string?
The COMPRESS function has a number of additional arguments which allow for the removal of all instances of certain designated characters, or groups of characters ... - How long is a character variable retrieved from a macro variable?
Macro variables are always stored as text and have different characteristics to dataset variables. Variables in a dataset have a minimum length of 1, a ... - How can I stop certain functions setting the length of the result to 200?
In the Language of SAS there are essentially three lengths which character manipulation functions will return: 8 bytes 200 bytes Inherited from the source Where the system can make ... - How can I avoid the message: "WARNING: The quoted string currently being processed has become more than 262 characters long. You may have unbalanced quotation marks."?
The maximum length of a character string in the Language of SAS is 32,767 characters, however when issuing an instruction containing a long quoted string ... - How can I compare two datasets with similarly-named variables by joining them horizontally?
Rather than using PROC COMPARE to identify differences, which can sometimes generate 'too much' information, it is preferable to join datasets horizontally, then perform a ... - How can I build sample datasets to perform fuzzy matches?
Sometimes data coming from different sources can be subtly different, resulting in a mis-match when performing a straight character comparison, but a visual comparison would ... - How can I create a row count variable in DATA step and PROC SQL?
There is an automatic variable generated by the system in the PDV when processing DATA step syntax which will in many circumstances provide the necessary ... - How can I get details of a macro variable name / value written to the LOG?
It can be beneficial to write into the LOG values of a macro variable name and the stored value, particularly for LOCAL macro variables created inside a ... - How can I suppress 'bad data' issues when making an explicit character to numeric conversion?
The INPUT statement includes several modofiers which provide greater control of bad data issues when reading in raw data. The INPUT function will also accept ... - How can I create sample data to share with others? e.g. on a SAS forum
SAS fora are a useful way to glean some 'crowd wisdom' when struggling with a coding dilemma. Sometimes this can be answered in the abstract, ... - How can I re-start an EG session with all settings from a previous session?
For long-running code it can be frustrating when a session ends (either intentionally or unintentionally) and the process must be re-started from the beginning as: all ... - How do I stop SAS reading a non-printable EOF character in my raw data file?
Using the INFILE and INPUT statements allow many different forms of raw data files to be read into SAS. Likewise there are many different functions ...