# prajwalsd/runsas architecture

> Architecture diagram of the GitHub repository prajwalsd/runsas, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/prajwalsd/runsas
- Repository: https://github.com/prajwalsd/runsas

## Overview

##### Main Components

a) Core Components:
- runSAS Script Engine (Central Component)
- SAS Environment (SAS 9.x)
- Job Management System
- Email Notification System
- Monitoring & Logging System
- Status Tracking System

b) Integration Points:
- SAS BatchServer
- File System Interface
- Email Server Interface
- Optional SAS Dataset/Database Interface

**┌─────────────────────────────────────────────────────────┐**
- Client Layer                         │
- (CLI Interface, Interactive/Non-Interactive Modes)     │
- ┤
- Control Layer                        │
- (runSAS Core Engine, Flow Management, Job Scheduling)  │
- ┤
- Execution Layer                       │
- (SAS BatchServer, Process Management)                 │
- ┤
- Service Layer                         │
- (Email, Logging, Monitoring, Status Updates)          │
- ┘

##### Special Features to Highlight

Create dedicated sections showing:
- Flow Management System (showing parallel execution capability)
- Error Recovery System
- Email Notification System
- Status Tracking System

##### Optional integration with SAS datasets

Remember to include version information and any environment-specific configurations that might affect the system's behavior.

This design should provide a clear understanding of how runSAS manages and executes SAS jobs while handling dependencies, parallel execution, and error recovery in a SAS 9.x environment.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Style Definitions
    classDef core fill:#2374ab,color:white
    classDef external fill:#7d7d7d,color:white
    classDef monitoring fill:#2a9d8f,color:white
    classDef ui fill:#ff9f1c,color:white
    classDef integration fill:#8338ec,color:white

    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[External Systems]:::external
        L3[Monitoring/Logging]:::monitoring
        L4[User Interface]:::ui
        L5[Integration Points]:::integration
    end

    %% Client Layer
    subgraph ClientLayer
        CLI[Command Line Interface]:::ui
        InteractiveMode[Interactive Mode]:::ui
        NonInteractiveMode[Non-Interactive Mode]:::ui
    end

    %% Control Layer
    subgraph ControlLayer
        RunSASEngine[runSAS Core Engine]:::core
        click RunSASEngine "https://github.com/PrajwalSD/runSAS/blob/master/runSAS.sh"
        FlowMgmt[Flow Management]:::core
        JobScheduler[Job Scheduler]:::core
        ConfigSettings[Configuration Settings]:::core
        click ConfigSettings "https://github.com/PrajwalSD/runSAS/blob/master/_config.yml"
        Documentation[System Documentation]:::core
        click Documentation "https://github.com/PrajwalSD/runSAS/blob/master/README.md"
    end

    %% Execution Layer
    subgraph ExecutionLayer
        SASBatch[SAS BatchServer]:::external
        ProcessMgmt[Process Management]:::core
        ParallelExec[Parallel Execution]:::core
        ErrorRecovery[Error Recovery]:::core
    end

    %% Service Layer
    subgraph ServiceLayer
        EmailSystem[Email Notification System]:::integration
        LoggingSystem[Logging System]:::monitoring
        MonitoringSystem[Monitoring System]:::monitoring
        StatusTracker[Status Tracking]:::monitoring
    end

    %% Relationships
    CLI --> RunSASEngine
    InteractiveMode --> RunSASEngine
    NonInteractiveMode --> RunSASEngine
    
    RunSASEngine --> FlowMgmt
    RunSASEngine --> JobScheduler
    RunSASEngine -.-> ConfigSettings
    RunSASEngine -.-> Documentation
    
    FlowMgmt --> ProcessMgmt
    JobScheduler --> ProcessMgmt
    ProcessMgmt --> ParallelExec
    ProcessMgmt --> ErrorRecovery
    
    ParallelExec --> SASBatch
    ErrorRecovery --> SASBatch
    
    SASBatch --> StatusTracker
    StatusTracker --> EmailSystem
    StatusTracker --> LoggingSystem
    LoggingSystem --> MonitoringSystem
    
    %% Status Updates
    SASBatch -.-> RunSASEngine
    StatusTracker -.-> RunSASEngine
    MonitoringSystem -.-> RunSASEngine
```
