A Python-based web application for analyzing SAS log and list files based on the logic from SAS macros.
- Upload and process SAS log (.log) and list (.lst) files
- Support for individual files or zip archives containing multiple files
- Analyze log files for errors, warnings, alerts, and other issues
- Analyze list files for COMPARE procedure results
- Interactive results display with filtering and sorting
- Detailed view of issues for each file
- Summary statistics and visualizations
- Responsive design for desktop and mobile devices
- Python 3.6 or higher
- pip (Python package installer)
- Clone or download this repository
https://github.com/kusy2009/sasloglstchecker.git- Navigate to the project directory
- Install the required dependencies:
pip install -r requirements.txt- Navigate to the project directory
- Start the Flask application:
python app.py- Open a web browser and go to
http://localhost:5000
-
Upload Files:
- Click the "Upload and Process" button to select SAS log (.log) and list (.lst) files
- You can upload individual files or a zip archive containing multiple files
- Optionally, specify a custom keyword to search for in log files (default: ALERT)
-
View Results:
- After processing, you'll be redirected to the results page
- The Summary tab shows overall statistics and charts
- The Log Files tab shows details for each log file
- The LST Files tab shows details for each list file
-
Explore Details:
- Click the "View" button for any file to see detailed information
- For log files, you'll see all issues found with line numbers
- For list files, you'll see comparison results and statistics
- Built with Flask (Python web framework)
- Log file processing based on the
%chklogSAS macro - LST file processing based on the
%chklstSAS macro - RESTful API endpoints for file upload and results retrieval
- Responsive design using Bootstrap 5
- Interactive charts with Chart.js
- Dynamic content loading with JavaScript
- Filtering and sorting capabilities
The application includes a test script that verifies all functionality:
python test_app.pyThis script:
- Creates sample log and lst files
- Tests file uploads (individual files and zip archives)
- Verifies API endpoints
- Checks results processing
For production deployment:
- Use a production WSGI server like Gunicorn:
pip install gunicorn
gunicorn -w 4 -b 0.0.0.0:5000 app:app- Consider using a reverse proxy like Nginx for better performance and security
sas_checker/
├── app.py # Main Flask application
├── config.py # Configuration settings
├── file_utils.py # File handling utilities
├── log_processor.py # Log file processing module
├── lst_processor.py # LST file processing module
├── test_app.py # Test script
├── static/ # Static files
│ ├── css/ # CSS stylesheets
│ │ └── styles.css # Custom styles
│ └── js/ # JavaScript files
│ └── main.js # Main JavaScript functionality
├── templates/ # HTML templates
│ ├── base.html # Base template
│ ├── index.html # Home page template
│ └── results.html # Results page template
└── uploads/ # Upload directory for files
├── sample_log.log # Sample log file for testing
└── sample_lst.lst # Sample list file for testing
- Modify
config.pyto change application settings - Add or modify patterns in
LOG_PATTERNSandLST_COMPARE_PATTERNSto adjust detection logic - Customize the UI by modifying the templates and CSS
This project is licensed under the MIT License - see the LICENSE file for details.
This application implements the logic from the following SAS macros developed by Wei Shao:
%chklog- For checking SAS log files%chklst- For checking SAS list files