CS

Converting .sas7bdat to CSV Without SAS

2 minute read Published: 2023-08-27

.sas7bdat is the binary format SAS uses to store data sets. SAS is commercial statistical software with a licensing cost that prices out most individual users. The format is proprietary and undocumented by SAS, so every reader outside it, including pyreadstat, is the product of reverse engineering.

A single .sas7bdat file holds the table itself, the column metadata, and enough type information to reconstruct rows. What it does not hold is the display layer. SAS stores human-readable value labels and formats in a separate catalog file, .sas7bcat. Converting to CSV throws that layer away, because CSV has no place to put it.

Array Algorithms

3 minute read Published: 2022-07-12

Arrays store elements in contiguous memory. Access is O(1). Search and modification require iterating. This guide covers six algorithms that appear repeatedly in array problems: binary search, two pointers, sliding window, prefix sums, divide and conquer, and the Dutch national flag.

Recursion and Iteration

3 minute read Published: 2022-07-08

Recursion and iteration are interchangeable. Any loop can be rewritten as recursion, and any recursion can be rewritten as a loop using an explicit stack. The difference is cost. Recursion consumes the call stack and adds per-call overhead. Iteration does neither. The right choice depends on the problem structure and the language.