# Iron Spring PL/I 1.4.0 Sample Programs

This is a brief description of the sample files distributed with Iron Spring PL/I Version 1.4.0. The samples are distributed free of any licenses or restrictions. Unless otherwise indicated all sample programs will compile and run on Linux and OS/2.

The comments in each program contain information on using the program. In the following, "<PLI>" is the name of the directory where you have unpacked the compiler and library, for example "pli-1.4.0".

## Linux

1. Test the sample programs. In this release only static linking is supported. CD to the "samples" directory and type "make -f Makefile.Linux" without the quotes, case is significant.. The sample programs "isub", "numwrd", "filedump", "libver", "print_listing", and "task" build to executables, the remainder should generate object files.
2. Test numwrd. Enter "./numwrd 123". The program should display the result "one hundred twenty-three".
3. You might want access to the %INCLUDE files in "pli-1.4.0/lib/include" or "pli-1.4.0/samples" for your own programming.

## OS/2

Each program should have run instructions in the comments in header in the source.

## List of sample programs

area.pli | Test AREA functionality
encard.pli | Convert text file to ENV(F RECSIZE(80)).
filedump.pli | Program to dump a ENV(VARLS) file in hex and characters.
hanoi.pli | "Towers of Hanoi" batch version.
hexdump.pli | Callable procedure to print a hex/character dump of a selected area of memory.
isub.pli | Sample of iSub-defined arrays
keysamp.pli | Sample program to create and read a KEYED file
libver.pli | Program to display the current version of the PL/I library.
numwrd.pli | Command-line program to print a number in words.
print_listing.pli | Sample program to print a PL/I compiler listing on a PCL printer.
readu.pli | Example of reading a file declared with ENVIRONMENT(U).
refsamp.pli | Example of use of self-defining structure.
ReferTest.dat | Data file for refsamp.
samples.html | This file.
sorttest.pli | Procedure to test PLISRTD
sort.dat | Test data for sorttest
task.pli | Example of PL/I multitasking. The OS/2 version runs in a VIO window, the Linux version must run in a Linux console, not an xterm.
vfile.dat | Sample input for filedump
Linux only samples
spawn.pli | Procedure to FORK and EXEC a child process.
spawntest.pli | Test program for spawn.
loadsamp.pli | Sample program to load an ISAM file. Sample creates two files DIREC.I and DIREC.D in the samples directory.
loadsamp.dat | Sample data for loadsamp.
updtsamp.pli | Sample program to update an ISAM file.
updtsamp.dat | Sample data for updtsamp.
Makefile.isam | Makefile to compile and run ISAM sample programs].
Makefile.Linux | Makefile to build all Linux PL/I sample programs.
OS/2 only samples
filefind.pli | OS/2 program to locate the directory entry for a file.
pmhanoi.pli | "Towers of Hanoi" as an OS/2 presentation manager program.
sample.def | OS/2 module definition file used for all sample programs except pmhanoi.
pm.def | OS/2 module definition file used for the pmhanoi sample program.
bse.inc | Some PL/I declarations for OS/2 system calls. Additions always welcomed.
Makefiles and miscellaneous
LC_make, LCC_make, SA_make | Sample makefiles for Linux giving examples of compiling and linking a PL/I program. LC_make links the compiled program with libc, but uses PL/I's malloc and free. LCC_make links with libc and uses libc's malloc and free. SA_make links a PL/I program without libc.
Makefile.OS2DLL | Makefile to build all OS/2 PL/I sample programs using the PL/I runtime DLL.
Makefile.OS2Static | Makefile to build all OS/2 PL/I sample programs using the statically-linked PL/I runtime.

Iron Spring PL/I version 1.4.0, 15 26 May, 2025
[36 files]