INCLUDE_DATA

Tag Archives: Optimization

Dramatically Increasing SAS DI Studio performance of SCD Type-2 Loader Transforms

In SAS DI Studio 3.4 (and I imagine in future versions), the prepackaged code for the SCD Type-2 Loader works like this: Does the dataset exist? If not, create an empty dataset with structure and indexes as defined from metadata. Then detect differences between it and the source dataset and the target dataset, expire any [...]

Reverse the Bits in a Byte in 3 operations

This is among many brilliant hacks from this page.
b = (b * 0×0202020202ULL & 0×010884422010ULL) % 1023;
The multiply operation creates five separate copies of the 8-bit byte pattern to fan-out into a 64-bit value. The AND operation selects the bits that are in the correct (reversed) positions, relative to each 10-bit groups of bits. The [...]

Avoid Correlated Subqueries

If your SQL code has a nested select that references a column in an outer select, such as the following, it may be possible to rewrite to perform orders of magnitude faster.
proc sql;
create table new_rates as
select
from work.exchange_rate n
where not [...]