# Enterprise Mainframe & IBM i File Transfer — Host Studio

> **Move data sets, Db2 tables, source members, and save files effortlessly between IBM Z, IBM i (AS/400), and every Apple device.**
> Native, bidirectional host data transfer built directly into **Host Studio** for macOS, iPadOS, iOS, and Apple Vision Pro—with zero Java runtimes, zero third-party middleware, and full enterprise MDM governance.

---

## Why Teams Choose Host Studio for Host Data Transfer

Legacy terminal emulators force operators and developers to juggle clunky Java utilities, separate FTP clients, or brittle command-line scripts just to move a data set or inspect a physical file. **Host Studio** unifies terminal emulation and high-speed host file transfer into a single native Apple experience—offering the same file transfer capabilities as **IBM Personal Communications (PCOMM)** and **IBM i Access Client Solutions (ACS)**.

- **Dual-Platform Native Engines**: Purpose-built **3270 `IND$FILE`** structured-field engine for IBM Z (`z/OS`, `z/VM`, `z/VSE`, `CICS`) and **IBM i Data Transfer Studio** for AS/400 & Power Systems (`OS/400` / `IBM i`).
- **Four IBM i Connection Methods**: Choose the connection method that meets your network security requirements—**SSH / SFTP (Port 22)**, **IBM i Host Server (Port 8475)**, **Native FTP / FTPS (Port 21 / 990)**, or **CL Commands Through the Terminal Session**.
- **Schema Handling & Code Page Conversion**: Automatic EBCDIC-to-UTF-8 conversion across global code pages, COMP-3 packed decimal (`PACKED`) decoding, and one-click export to **CSV**, **TSV**, **JSON**, **Fixed-Length Text**, **Binary**, and **IBM i save files (`*SAVF`)**.
- **Enterprise Data Loss Prevention (DLP) & MDM**: Block unauthorized downloads from the host across your entire Apple fleet with the `DisableDatasetExport` Managed App Configuration policy.
- **Evaluate Offline in Seconds**: Test complete 3270 DFT transfers and exports from the IBM i `QIWS/QCUSTCDT` table locally—even before connecting to a production logical partition (LPAR).

---

## At-a-Glance Platform Capabilities

| Capability | IBM Mainframe (3270 `IND$FILE`) | IBM i / AS/400 (`Data Transfer Studio`) |
| :--- | :--- | :--- |
| **Supported Host Environments** | `TSO/E`, `VM/CMS`, `CICS` (`z/OS`, `z/VM`, `VSEn`) | `IBM i` / `OS/400` (`/QSYS.LIB` & IFS staging) |
| **Transport Protocols** | 3270 DFT Structured Fields (`0xD0` / `0xD6`, `WSF 0xF3`) & CUT Mode over TN3270 / TN3270E (TLS) | `SSH / SFTP` (22), `IBM i Host Server` (8475 + TLS), `FTP / FTPS` (21 / 990), `Terminal CL` |
| **Transfer Directions** | Download from the host (`GET`) & upload to the host (`PUT`) | Download from the host (`GET`) & upload to the host (`PUT`) |
| **Supported File & Data Formats** | ASCII / UTF-8 Text, Raw Byte-for-Byte Binary | `.csv`, `.tsv`, `.json`, `.txt` (Fixed), `.bin` (Binary), `.savf` (`*SAVF`) |
| **Host Storage & Object Creation** | `RECFM`, `LRECL`, `BLKSIZE`, `SPACE` (`TRK`, `CYL`, `AVBLOCK`), `REPLACE`, `APPEND` | Auto-create Physical Files (`CRTPF`), Save Files (`CRTSAVF`), & Members (`ADDPFM`) |
| **Query & Filtering** | Custom `IND$FILE` host flags & CICS `FILE=` routing | Embedded Db2 SQL `SELECT` query filtering & live row search |
| **In-App Data Inspection** | Decoded UTF-8 text preview & real-time DFT packet log | Interactive tabular data preview grid, CL command inspector & audit log |
| **Enterprise Security & DLP** | TLS 1.2/1.3, App Sandbox access restrictions, MDM `DisableDatasetExport` | FTPS / TLS / SSH, token sanitization, Keychain autofill, MDM `DisableDatasetExport` |

---

## IBM Mainframe File Transfer (`IND$FILE` Workbench)

Host Studio features a standards-compliant **IBM 3270 `IND$FILE`** engine engineered from the ground up in Swift for reliable, high-throughput data set and file transfers over active TN3270 and TN3270E sessions.

### Multi-Subsystem Support (`TSO/E`, `VM/CMS`, and `CICS`)
Switch subsystems with a single picker—Host Studio automatically formats single quotation marks around data set names, option parentheses, and host command syntax for your target environment:
- **TSO/E (`z/OS`)**: Transfer sequential data sets and members of partitioned data sets (`PDS` / `PDSE`) (e.g., `'USER.DATA(MEMBER)'`) with full MVS allocation controls.
- **VM/CMS (`z/VM`)**: Native `FN FT FM` file identifier support (e.g., `PROFILE EXEC A`) with parenthesized CMS transfer options.
- **CICS (`z/OS` & `z/VSE` / `VSEn`)**: Dedicated CICS destination routing with built-in support for:
  - **Standard CICS Files**
  - **Host Transfer File (`FILE=HTF`)** — Seamless `INWFILE` routing on `z/VSE` CICS
  - **VSAM Data Sets (`FILE=VSAM`)**
  - **Temporary Storage Queues (`FILE=TS`)**
  - **Transient Data Queues (`FILE=TD`)**
  - Configurable **CICS Record Size (`RECSZ`)** (`1`–`32,760` bytes) and a one-click **Send `CLEAR` Key to CICS** utility to prepare the terminal prompt before starting a transfer.

### High-Speed DFT Structured Fields & CUT Compatibility
- **Distributed Function Terminal (DFT)**: Negotiates `Read Partition Query` capabilities and exchanges `WSF (0xF3)` File Transfer Structured Fields (`0xD0` and `0xD6`) for fast, block-sequenced streaming without screen-scraping overhead.
- **CUT Mode Fallback**: Monitors formatted 3270 screens for host status, completion (`TRANS00` / `TRANS03`), and error diagnostics.
- **Configurable Packet Buffers**: Choose a packet buffer size of **256 bytes**, **512 bytes (Standard)**, **1,024 bytes (1 KB)**, or **2,048 bytes (2 KB DFT)** to maximize throughput across LAN or VPN links.
- **Clean Protocol Cancellation**: Canceling an active transfer sends a DFT Abort structured field (`TR_ERROR_REPLY` / `TR_ERR_CMDFAIL`) to cleanly release the host `IND$FILE` task.

### Intelligent Text & Binary Modes
- **ASCII / UTF-8 Text Mode**:
  - Integrates directly with your active session **EBCDIC Code Page** (`CP037`, `CP1047`, Euro `CP1140`–`CP1148`, Latin-2, Cyrillic, Greek, and Asian EBCDIC).
  - Automatically detects whether the host sent pre-translated ASCII or raw EBCDIC bytes, strips legacy `EOF` (`0x1A` / `Ctrl-Z`) and `NUL` block padding, and normalizes **CRLF / LF** line endings.
  - **Trim Trailing Blanks**: Remove trailing spaces from fixed-length, 80-column records when downloading, or retain them to preserve exact column widths.
  - **In-App Decoded Text Preview**: Inspect downloaded JCL, COBOL, REXX, or log output immediately inside an expandable monospaced preview pane before saving to disk.
- **Binary Mode**: Bit-exact, byte-for-byte transmission for load modules, `XMIT` packages, compressed archives, and binary payloads.

### Full Host Allocation & Target File Handling Options
When uploading (`PUT`) new data sets or members to `TSO/E` or `VM/CMS`, configure exact DASD allocation parameters right from the form:

| Parameter | Available Options & Range |
| :--- | :--- |
| **Target File Handling** | **Overwrite Target (`REPLACE`)** or **Append to Target (`APPEND`)** |
| **Record Format (`RECFM`)** | Fixed (`F`), Fixed Blocked (`FB`), Variable (`V`), Variable Blocked (`VB`), Undefined (`U`) |
| **Logical Record Length (`LRECL`)** | Auto-detect (`0`) on download, or `1`–`32,760` bytes (with automatic fixed-record space padding on upload) |
| **Block Size (`BLKSIZE`)** | `0` (system-determined) up to `32,760` bytes (`TSO/E`) |
| **Space Units (`SPACE`)** | **Tracks (`TRK`)**, **Cylinders (`CYL`)**, or **Blocks (`AVBLOCK`)** |
| **Space Allocation** | Configurable **Primary Space** (`1`–`9,999`) and **Secondary Space** (`0`–`9,999`) |
| **Advanced Controls** | Adjustable **Transfer Timeout** (`15s`–`300s`) and **Custom `IND$FILE` Parameters** field for site-specific host flags |

### Live Command Generator & Offline Simulation
- **Generated Command Preview**: Each setting updates the generated `IND$FILE` command in real time (e.g., `IND$FILE PUT 'USER.JCL(BUILD)' ASCII CRLF REPLACE RECFM(FB) LRECL(80) BLKSIZE(27920) SPACE(5,1) TRK`) with one-click copy to clipboard.
- **Local DFT Simulation Mode**: Test the complete 3270 DFT pipeline, decoded text preview, and native file export offline—ideal for training, demos, or environments where `IND$FILE` is restricted.

---

## IBM i (AS/400) Data Transfer Studio

When connected to an **IBM i (5250)** session, Host Studio launches the **IBM i Data Transfer Studio**—a modern, four-tab workbench (**Transfer**, **Object & Schema**, **Data Preview**, and **CL Commands**) designed for Db2 for i tables, source physical files, and IBM i save files.

### Four Flexible Connection Methods
Use the connection method selected by your IBM i administrators, with one-tap **Autofill From Session** to retrieve the hostname and Keychain-protected credentials saved for your active 5250 connection:

| Connection Method | Default Port | Encryption | Best For |
| :--- | :---: | :---: | :--- |
| **SSH / SFTP** | `22` | SSH Encryption | Modern zero-trust networks using IBM i PASE OpenSSH for transfers of stream files and files in `/QSYS.LIB` |
| **IBM i Host Server** | `8475` | Optional TLS | Direct native Client Access communication with IBM i file and remote command services (`QPWFSERVSO` / `QZRCSRVS`) |
| **Native FTP / FTPS** | `21` / `990` | Optional FTPS / TLS | High-speed binary streaming of large `*SAVF` save files and `/QSYS.LIB` members with `RCMD` commands run before the transfer |
| **CL Commands Through the Terminal Session** | Active 5250 | Session TLS | Environments with restrictive firewall rules where only the TN5250E terminal port (`23` / `992`) is reachable |

### Six Native Data & Object Formats
Move structured relational data, RPG/CL/COBOL source members, or complete library backups into the exact format your workflow demands:
1. **Comma-Separated Values (`.csv`)** — Ready for Microsoft Excel, Apple Numbers, pandas, and BI tools, with optional column header rows and RFC-compliant quote escaping.
2. **Tab-Delimited (`.tsv`)** — Clean tab-separated exports suited to pasting into spreadsheets and processing in data pipelines.
3. **JSON Array (`.json`)** — Pretty-printed, key-sorted JSON objects generated from Db2 records for modern web, REST API, and AI/ML integration.
4. **Fixed-Length Text (`.txt`)** — Column-aligned text preserving exact field widths (such as 92-byte or 112-byte `QCLSRC` / `QRPGLESRC` source members).
5. **Binary Data (`.bin`)** — Raw record layouts (`RCDLEN` `1`–`32,766`) with built-in **IBM COMP-3 Packed Decimal (`PACKED` / `DECIMAL`)**, **Binary/Integer**, and **CHAR/VARCHAR** encoding and decoding.
6. **IBM i Save File (`*SAVF` / `.savf`)** — Byte-for-byte binary transfer of IBM i save files directly to and from `/QSYS.LIB/LIB.LIB/FILE.FILE` for PTF distribution, software deployment, and LPAR backups.

### Transfer Shortcuts & SQL Filtering
- **Quick-Start Presets**: Configure common IBM i workflows in a single tap with built-in presets for **Save File (`*SAVF`)**, **Customer Credit (`QIWS/QCUSTCDT`)**, **Source File (`QGPL/QCLSRC`)**, and **Custom SQL Query**.
- **Live `/QSYS.LIB` Path Resolution**: Enter any **Library**, **File / Table**, and **Member** (`*FIRST` or explicit member name) and inspect the resolved IFS path (e.g., `/QSYS.LIB/QIWS.LIB/QCUSTCDT.FILE/QCUSTCDT.MBR`) in real time.
- **Db2 SQL `SELECT` Filtering**: Narrow downloads at the source with an optional SQL filter (e.g., `SELECT * FROM QIWS.QCUSTCDT WHERE STATE = 'TX'`) before exporting.
- **Automatic Host Object Creation**: For a new target, enable automatic creation options to run **`CRTPF`** (Create Physical File), **`CRTSAVF`** (Create Save File), **`ADDPFM`** (Add Physical File Member), and select whether to replace or append member data (**`*REPLACE` / `*ADD`**) before transferring your data.

### Built-In Data Preview & CL Command Transparency
- **Interactive Data Preview Tab**: Search, filter, and inspect downloaded Db2 rows and columns directly inside Host Studio before exporting.
- **CL Commands Inspector**: Inspect the OS/400 Control Language (CL) commands generated for your transfer (`CPYTOIMPF`, `CPYFRMIMPF`, `CPYTOSTMF`, `CPYFRMSTMF`, `CRTPF`, `CRTSAVF`, `ADDPFM`, `RUNSQL`). Their parameters are sanitized. Copy the commands to the clipboard or send them directly to your active 5250 terminal session with one click.
- **Live Transfer Progress**: Track real-time transfer progress with byte counters, percentage completion bars, live transfer speed (`KB/s`), and protocol audit logs you can copy.

---

## Enterprise Security, Compliance & Fleet Governance

Moving core business data between IBM Z, IBM i, and endpoint devices requires uncompromising security. Host Studio is architected to satisfy strict financial, healthcare, government, and retail compliance standards:

- **Corporate MDM Data Loss Prevention (`DisableDatasetExport`)**: IT administrators using **Jamf Pro**, **Microsoft Intune**, **VMware Workspace ONE**, or **Apple Business Manager** can push a single managed configuration key (`DisableDatasetExport = true`) to block `IND$FILE` downloads (`GET`), downloads of IBM i members and save files, and preview table exports—while keeping terminal access and authorized uploads intact.
- **End-to-End Transport Encryption**: Protect data in motion over **TLS 1.2 / 1.3** (TN3270E, TN5250E, FTPS, and IBM i Host Server TLS) and **SSH v2** (`SFTP`).
- **Apple Keychain & Biometric Protection**: Host credentials are isolated inside the hardware-backed **Apple Keychain** (with optional Face ID, Touch ID, or Optic ID session locking) and never written in plaintext to shared profiles or logs.
- **Strict Input Sanitization & App Sandbox**: IBM i library, file, and member names, along with SQL tokens, are automatically sanitized to prevent command injection. File operations on macOS and iOS respect Apple **App Sandbox** permissions and the principle of least privilege; users select files in system open/save dialogs.
- **Zero Telemetry or Cloud Intermediaries**: All transfers stream directly over TCP/TLS between your Apple device and your enterprise host—zero cloud proxies, zero analytics SDKs, and zero data collection.

---

## Seamless Across Mac, iPad, iPhone & Apple Vision Pro

Whether you are uploading JCL from a MacBook Pro (`⌥⇧⌘T`), exporting a Db2 customer table to Numbers on an iPad Pro, deploying a `*SAVF` hotfix from an iPhone over VPN, or monitoring batch transfers in a spatial workspace on **Apple Vision Pro**, Host Studio delivers a unified, native SwiftUI interface across every Apple platform—fully localized in **10 languages** (English, German, Spanish, French, Italian, Japanese, Korean, Brazilian Portuguese, Simplified Chinese, and Traditional Chinese).

---

### Ready to Modernize Mainframe & IBM i File Transfers?

Download **Host Studio** on the App Store for **macOS**, **iOS**, **iPadOS**, and **visionOS**, or deploy fleet-wide through **Apple Business Manager** with Volume Purchase Program (VPP) and Managed App Configuration support.
