18.10.2014 Views

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>SIMSCRIPT</strong> <strong>II.5</strong> <strong>Programming</strong> <strong>Language</strong><br />

to a computer. A mechanism is also required to specify in detail the formats in which data should<br />

be read and written, and a facility to transmit data in internal machine representation.<br />

Although the input/output programming statements provided are similar from one <strong>SIMSCRIPT</strong> <strong>II.5</strong><br />

compiler implementation to another, the exact interpretation and additional parameters required by<br />

these statements may vary from machine to machine. This variation is due to the differences in operating<br />

system requirements and device characteristics of different computer systems. Individual<br />

<strong>SIMSCRIPT</strong> <strong>II.5</strong> user manuals describe the nature of these differences.<br />

In general, three pieces of information must be specified when an input/output operation takes<br />

place:<br />

1. A physical device<br />

2. A data or information list<br />

3. The desired data format.<br />

In the statements read, print, and list, a physical device is implied (some default input and<br />

output device), the data list is stated explicitly, and the format is, in the first instance, "free," in the<br />

second, a "picture," and in the third, standardized. The statements described here provide a more<br />

flexible means of specifying this information.<br />

3.4.1 Physical Device Specification<br />

<strong>SIMSCRIPT</strong> <strong>II.5</strong> programs may reference specific data streams using a logical unit number in certain<br />

input and output (I/O) statements. Each <strong>SIMSCRIPT</strong> <strong>II.5</strong> logical unit number may then be associated<br />

with a specific device or data file through the computer system job control or command<br />

language. This allows each <strong>SIMSCRIPT</strong> <strong>II.5</strong> program to refer to a file or I/O device in a common<br />

logical manner, postponing the detailed specification of individual file or data characteristics for<br />

definition in the appropriate system command language. Each logical unit number, therefore, is<br />

linked to an individual file or specific I/O device through the operating system.<br />

Each file or I/O device that is to be referenced within a program is assigned a logical unit number.<br />

Logical unit numbers in <strong>SIMSCRIPT</strong> <strong>II.5</strong> are integer numbers within the range 1 to 99 inclusive,<br />

units 98 and 99 being reserved for <strong>SIMSCRIPT</strong> <strong>II.5</strong> system use. Some implementations may not<br />

support 99 distinct units. Consult the appropriate user's manual for details. A specific I/O device<br />

or file may be selected as the current input or output unit by executing a statement of the form:<br />

device for input or<br />

use unit device for input<br />

and<br />

use device for output or<br />

use unit device for output<br />

The word unit may be omitted. The value device may be any arithmetic expression that<br />

evaluates to a logical unit number. The <strong>SIMSCRIPT</strong> <strong>II.5</strong> logical unit number referenced will be<br />

104

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!