# 12. Ecosystem Programs

## 12.1 Display and Format File Generation

### 12.1.1 Program EASYFORM

Creates a primitive format file (.PF) from a text file. The primitive format file contains information required by Program Mercury (field numbers, starting positions, lengths, and format codes).

```
>>? RUN EASYFORM
? [fnprefix.TX] [+fnprefix.PF] [A designator] [N designator]
```

The .PF file is an intermediate file that is discarded after use by Program EASYDISP.

### 12.1.2 Program EASYDISP

Converts a primitive format file (.PF) and text file (.TX) into a complete format file (.F) with display position information for use by Program DISPPREP and Program Mercury.

```
>>? RUN EASYDISP
? [fnprefix.PF] [fnprefix.TX] [+fnprefix.F] [A designator] [N designator]
```

### 12.1.3 Program DISPPREP

Reads the text file and format file to produce the binary display file (.DI) for Program SCIENTRY.

```
>>? RUN DISPPREP
? [fnprefix.TX] [fnprefix.F] [+fnprefix.DI] [A char] [N char] [ruling char]
```

### 12.1.4 Program HTMLPREP

Reads the text file and format file to produce the HTML display file (.HTM) for Program CGIENTRY.

```
>>? RUN HTMLPREP
? [fnprefix.TX] [fnprefix.F] [+fnprefix.HTM] [A char] [N char] [ruling char]
```

The .HTM file must be uploaded to the Internet server computer by a person with sufficient security privilege.

## 12.2 Report Generation

### 12.2.1 Program EASYCHAP

Creates a Chaprola program (.CS source module) that prints a report matching the screen display format. This makes it possible to print using preprinted forms.

```
>>? RUN EASYCHAP
? [fnprefix.TXT] [+fnprefix.CS] [A designator] [N designator] [graphics char]
```

The generated .CS file must then be compiled with the CHAPROLA batch file to produce a .PR procedure file.

### 12.2.2 Replica Reports

Once a screen display has been generated, it is possible to create a Chaprola program that faithfully prints on a preprinted form what is shown on the screen. Program EASYCHAP serves this purpose.

**Column 1 convention for printing:**
- A **number** in column 1 means the line provides one unit of vertical spacing on the printed form.
- A **blank** in column 1 means the line is skipped (no vertical spacing).
- An **asterisk** (`*`) in column 1 causes a page break.

## 12.3 Batch Programs

### 12.3.1 Program EASYSORT

Sorts a fixed-length data file in ascending alphanumeric order starting at any character position.

```
>>? RUN EASYSORT
? [input fn] [output fn] [start of string] [length of string]
? [input fn] [output fn] [start] [length] X
```

- **Input file** -- the file containing data to be sorted
- **Output file** -- receives the sorted data
- **Start of string** -- starting character position of the sort field
- **Length of string** -- number of characters to sort on (may differ from field length)
- **X** (optional 5th word) -- maintains input order during the sort

### 12.3.2 Program COMPARE

Compares two files byte-for-byte (binary compare) or line-by-line (text compare with optional `X` flag). Ignores trailing blanks and case differences in text mode.

```
>>? RUN COMPARE
? [file1] [file2]
? [file1] [file2] X
```

Reports "GOOD COMPARE" or "BAD COMPARE" with up to 10 differing lines shown. Stops at 32,000 lines.

### 12.3.3 Program RMTRBL

Removes trailing blanks that SCIOS places at the end of text lines. Shortens lines so the line terminator follows the last non-blank character.

```
>>? RUN RMTRBL
? [input fn] [output fn]
```

### 12.3.4 Program OSHELP1

Translates any one ASCII character to another throughout a file (one character per pass).

```
>>? RUN OSHELP1
? [input fn] [output fn] [old ASCII value] [new ASCII value]
```

Example: Change `J` (ASCII 74) to carriage return (ASCII 13):
```
? XYZ.D1 XYZ.D2 74 13
```

Reports the number of characters found and changed.

### 12.3.5 Programs OSHELP2 through OSHELP5

Additional utility programs in the SCIOS batch program suite (specific documentation not available on the site).

## 12.4 CHAPRPG

A batch program for large-scale data manipulation. Unlike SCIENTRY, none of the data file information is displayed on screen during execution. CHAPRPG processes data files using compiled Chaprola procedures without a screen display interface.

## 12.5 Program Mercury

MERCURY is the SCI information retrieval and analysis system. It reads format files to determine how to access and retrieve information from data files. Mercury uses the linkage number (Column 2) and format codes (Column 8, characters 70--74) from format files.

## 12.6 Compilation Programs

### 12.6.1 Program CHAPTRAN

The Chaprola translator. First stage of compilation.

### 12.6.2 Program CHAPCOMP

The Chaprola compiler. Second stage. Accepts an optional third word `X` to enable line numbering for DEBUG output.

### 12.6.3 CHAPROLA Batch File

Executes CHAPTRAN and CHAPCOMP in sequence:
```
>>? AC CHAPROLA [fnprefix]
```

## 12.7 FLIBSCI

FLIBSCI (Fortran Library of Synergistic Consultants Incorporated) is a comprehensive library of FORTRAN subroutines callable from Fortran, C, and C++. It enables programmers to construct programs without concern for machine-dependent features in input/output and number conversion operations.

FLIBSCI reduces all FORTRAN I/O operations to standard subroutine and function calls, providing portability across different compilers and platforms.

Key modules include:
- **PLIB.C** -- Low-level character operations: `move()`, `movbl()`, `equal()`, `equbl()`
- **V2.FOR** -- Conversion routines: `CONVE`, `CONVF`, `CONVI`, `CONVN`, `SEPAR`, `SOPEN`, `PRINT`
- **XDOS.FOR** -- File access routines: `FOPFL`, `FRDFL`, `FWTFL`, `FPSFL`, `FCLFL`
- **FFT.FOR** -- Fast Fourier Transform
- **WAVELET.FOR** -- Wavelet transform
- **HULDRA.FOR** -- Nonlinear regression optimization (Rotational Discrimination)

---

*Previous: [CGIentry](11-cgientry.md) | Next: [MOMS System](13-moms.md)*
