Extract SAS source code from SAS log files. This macro was written for two purposes: 1. Users that have lost the original source code, but still have the log, for a program that must be re-run. 2. Transfering SAS macro code (with mprint turned on) from the log into a runnable program. Macro call: _EXTLOG INFILE='input_log_file' FILE='output_file_name' ; The program will read the log file, strip all of the line numbers, NOTES, WARNINGS, SAS headers, ERROR notices from the file. If the file was generated from a macro the resolved macro code will be saved. The name of the macro will be noted on the first line before the resolved macro code (e.g. *** CODE FROM RESOLVED MACRO: MPRINT(CREATE) ;) . Any lines in the log that do not start with a number (or other identifier) will not be removed. These lines are usually associated with the macro information that has been provided by users at the Centre. You will have to search for and delete these lines yourself. Notes/Warnings: - The SAS implmac option is required. - If a cards statement was used to enter data directly the program will generate a warning. Data from cards statements are usually not written to the log files, and with therefore not be in the restored code. - If an Error has occured in the program a warning will be generated. Some of the erorr code information (e.g. missing cards, invalid data lines) will not be removed from the extracted code. - Character conversion notices will be removed, but the number:column information will only be removed from the first line after the notice. If there are multiple lines of type conversion places then they will not all be removed. - Any lines in the log that do not start with a number (or other identifier) will not be removed. These lines are usually associated with the macro information that has been provided by users at the Centre. You will have to search for and delete these lines yourself. If necessary (requested) I will add the necessary code to comment out/delete this information.