Run the code step by step; after each submit:
check for ERROR messages, and fix the code if such appear
check for WARNING messages, and do the same
check for any NOTEs beyond "dataset x was created with y observations and z variables". Get also rid of those. This includes NOTEs for uninitialized variables, automatic conversions numeric<>character, missing values being created (if such NOTEs are acceptable, document this in comments)
check the resulting dataset(s) if they meet your expectations
... View more