Contact us Heritage collections Image license terms
HOME ACL Associates Technology Literature Applications Society Software revisited
Further reading □ IntroductionA. System overviewB. Program executionC. FilestoreD. GEORGE commandsE. Introduction to Multiple On-line Programming (MOP)F. Input of background jobsG. Editing filesI. Budgeting, scheduling and accountingJ. Monitoring filesL. FORTRANM. ALGOLN. Assemblers PLASYD, PLANP. ConsolidatorQ. LibrariesR. Data storage □ Sections S-Z unavailable □ S. Large program organisationT. User utilitiesV. Graphics packagesW. Other packagesX. Efficient use of the 1906AY. 1906A hardwareZ. Peripheral equipmentList of reference manualsIndex
ACD C&A INF CCD CISD Archives Contact us Heritage archives Image license terms

Search

   
ACLLiteratureICL 1906A manuals1906A Reference Manual
ACLLiteratureICL 1906A manuals1906A Reference Manual
ACL ACD C&A INF CCD CISD Archives
Further reading

IntroductionA. System overviewB. Program executionC. FilestoreD. GEORGE commandsE. Introduction to Multiple On-line Programming (MOP)F. Input of background jobsG. Editing filesI. Budgeting, scheduling and accountingJ. Monitoring filesL. FORTRANM. ALGOLN. Assemblers PLASYD, PLANP. ConsolidatorQ. LibrariesR. Data storage
Sections S-Z unavailable
S. Large program organisationT. User utilitiesV. Graphics packagesW. Other packagesX. Efficient use of the 1906AY. 1906A hardwareZ. Peripheral equipmentList of reference manualsIndex

R. Data Storage

R.1 FILESTORE DATA

R.1.1 INTRODUCTION

Data to be read or written by the 1906A can be held on various media. Examples of media are punched cards, lineprinter output and magnetic discs. Each kind of medium requires a different type of peripheral device to read or write it. Under the GEORGE operating system most data can be held in the filestore, on discs, even though this is not where the user program expects it to be. When the program makes any kind of data access, GEORGE is informed and takes the appropriate action to simulate the peripheral the program has been written to use.

This part only deals with input and output for high-level languages, specifically FORTRAN and ALGOL. The use of machine code level facilities requires a deeper knowledge of the 1906A hardware and operating system than this manual provides, while the use of other languages such as ALGOL68 and COBOL is too rare to justify an explanation here. In these cases the appropriate compiler manuals should be consulted.

R.1.2 STREAMS, CHANNELS AND FILES

All input to and output from a program is made via channels. Each basic machine code level order (which all I/O systems must eventually use) refers to some specific channel. Each channel is of a particular type, and within this type has a particular reference number. Channels are often referred to by a channel name consisting of a two-letter type code and a reference number. Under GEORGE, channel numbers must be in the range 0 to 63; in the FORTRAN and ALGOL systems, however, only channels with numbers from 0 to 15 can be used.

One end of the channel is connected either to a peripheral device or, more commonly, to a filestore file. This latter connection is made by a GEORGE ASSIGN or ONLINE command (D.4.7). To connect the file 'MYDATA' to card reader channel 5, for example, the following command could be used:

ASSIGN *CR5, MYDATA

The other end of the channel is connected to a stream in the FORTRAN or ALGOL program. The program is written entirely in terms of streams, and the connection between the stream and the channel is described in the program description at the head of the program. The program can be made to use different channels by altering this program description.

The form of statements required to describe these connections are the subject of the next few chapters.

R.1.3 MOVING DATA INTO AND OUT OF THE FILESTORE

Programs access data via the channels they are written to use. In general, this data must be entered into the filestore initially, and often needs to be extracted or copied from the filestore later. Data is usually put into the filestore initially by using the INPUT command (D.3.2), and listed or punched out by using the LISTFILE command (D.3.3). Data to be temporarily removed from the filestore, or which is to be transferred to or from other ICL machines, is often handled by the COPYIN and COPYOUT utilities.

R.1.4 CHANNEL TYPES FOR FORTRAN AND ALGOL

There are a large number of different channel types under GEORGE. Most of these are of no use or interest to the normal user. The types of channel dealt with here are listed below and should be adequate for the majority of programs:

CR0 to CR15  card reader channels
CP0 to CP15  card punch channels
LP0 to LP15  lineprinter channels
DA0 to DA15  disc channels
MT0 to MT15  magnetic tape channels
TR0 to TR15  tape reader channels used in ALGOL to overcome line length limitations
TP0 to TP15  tape punch channels

Magnetic tapes should be avoided as jobs using them are inefficient in the way they affect total machine efficiency. In some cases (with plotting jobs, for example), their use may be unavoidable on rare occasions. Paper tape channels must be used in ALGOL if data records of more than 80 characters are to be read, as the ALGOL system will ignore all characters in a card reader record beyond the 80th. This restriction does not apply to FORTRAN, and the use of TR channels should never be necessary. FORTRAN also has special facilities to issue GEORGE commands from the program and to read parameters of the ENTER command, as described in Part L.

R.1.5 SERIAL FILES

With the exception of disc and magnetic tape channels, all the channels in the above table read or write serial filestore files. Files of this type are organised as a series of zero or more records. Each record is between 0 and 2000 characters long. Associated with each record is a PFCC (paper feed control character) which determines the vertical spacing associated with the record if the file is listed on the lineprinter. For most purposes the PFCC can be ignored by the user, and it will be set to a default of space forward one line and print the record; in the case of output to lineprinter channels the user program can specify the PFCC. In FORTRAN this is done by decoding the first character of the output buffer; in ALGOL this is done by calling library routines such as PAPERTHROW. This is described in the parts of the manual dealing with the FORTRAN and ALGOL languages (Part L and Part M).

All GEORGE files are limited to 245K words. This limits the amount of information that can be held in a file. The number of records that can be held cannot be explicitly stated as it depends on the length of the record after trailing blanks have been removed.

R.1.6 DISC FILES

The other kind of file dealt with here is the disc file. The form of the data in the file is different for FORTRAN and ALGOL, and users are strongly advised to restrict themselves to one language or the other for handling disc files. ALGOL programs can use FORTRAN subroutines, and it is possible to use FORTRAN for the input and output parts of an otherwise completely ALGOL program. Users wishing to make use of this facility are advised to contact the Program Advisory Office for more information. When a disc file is only being used for temporary storage . in a single run of a program, so that its contents need not be preserved, it is more efficient to use a scratch disc area than a filestore file (or exofile). At ACL a large amount of scratch disc area is available for user programs.

R.2 FORTRAN

R.2.1 BASIC PERIPHERALS

Only CR, CP and LP channels are dealt with here. Because of modifications made at ACL to the FORTRAN run-time system, channels of these types all read or write lines of up to and including 2000 characters. For lineprinters, the number of characters specified by the FORMAT statement can be 2001 as the first is used in producing the PFCC. All records read are made up to 2000 characters with blanks, and all records written have trailing blanks removed. The length can be changed from 2000 by the routines specified in L.4.7. Other routines specified there allow GEORGE commands to be issued and program parameters to be read. Attempts to write records longer than the permitted maximum will cause two or more records to be written. For lineprinter channels only, the record length can be specified in the program description segment (PDS). The FORTRAN READ statement has an end of file detection facility. An end of file is detected in two circumstances; when an attempt is made to read a record when all the records in the file have already been read, or when a record is read with '****' in the first four columns. These alternatives can also be altered by the routines specified in L.4.7. Some examples of correct PDS statements for basic peripherals channels follow:

INPUT 5,10,4000 = CR0 
OUTPUT 6 = LP7 
INPUT 12 = GR5 
OUTPUT 13 = CP0 
OUTPUT 3000 = LP15/120

The default program description segment provided by TASK contains the following statements for basic peripherals:

INPUT 1,5 = CR0 
OUTPUT 2,6 = LP0

R.2.2 DISCS

Data handling on discs can be carried out in FORTRAN in three different ways: FORMATTED, UNFORMATTED and DIRECT. They are described separately below. This section is concerned with factors applying to all disc files. Disc files can be created in any of four different bucket sizes, but a size of 512 words per bucket is recommended for user data processing. This requires a specification for a 512-word buffer in PDS statements dealing with files. The PDS may specify that a permanent file or a scratch file is wanted. A scratch file is one whose contents are not wanted after the program run is complete, for this sort of file the use of the filestore is not advised, and a special form of the ONLINE command should be used (as shown below) to access genuine spare disc space. At ACL, a large amount of such scratch area is permanently available for user programs. Files written in one program can be read or altered in a later program, but the type of the disc file (FORMATTED, UNFORMATTED or DIRECT) should not be altered unless the previous contents of the file are completely ignored. Where disc files greater than the GEORGE filestore maximum of 245K words are required, exofiles may have to be used. These are disc files outside the filestore. When exofiles are used, special care must be taken. These are dealt with further below.

Although the bucket size of 512 words is recommended for normal use, all the sizes given in the following table are allowed. The bucket size is normally given in words in program description statements, but is specified by a code in GEORGE CREATE commands. The bucket size is the code number multiplied by 128.

bucket size   code
128 words       1
256 words       2
512 words       4
1024 words      8

As the GEORGE default size is 512 words, it is not usually necessary to specify the size explicitly when the file is created.

R.2.3 TYPES OF DISC FILE

FORMATTED files are very similar to basic peripheral channels. They read/write records using normal formatted READ and WRITE statements. There is no maximum length for a formatted record on disc (in particular, it may be greater than the buffer size) and end of file is detected only when an attempt is made to read a non-existent record. The FORTRAN REWIND and BACKSPACE statements apply to this type of file.

UNFORMATTED files are written without the use of formats. They are less flexible than FORMATTED files but much more efficient. They also have no maximum record length, but if the disc is to be packed densely it is advisable to arrange that the records are less than or equal to a multiple of the buffer size minus 4. REWIND and BACKSPACE statements also apply to this type of file.

DIRECT files can only be used with special forms of the READ and WRITE statements and with the FIND statement. A DEFINE FILE statement is required for each file used in the program, and it is advisable to ensure that the routine containing the DEFINE FILE statement is called (unless it is the master segment) before any attempt is made to use the file. A new DIRECT file (that is, one using a scratch file) will only be initialised if it is used within the program run.

R.2.4 SCRATCH FILES

Scratch files are declared in the PDS by a USE statement that does not specify a dummy filename. Some examples follow (note that they all specify a buffer length of 512 words):

USE 20 = DA6/UNFORMATTED/512
USE 21,22 = DA15/FORMATTED/5I2
USE 23 = DA8/DIRECT/512

The scratch disc area is attached to the other end of the disc channel by a special form of the ONLINE command as in the following examples:

ONLINE *DA6, (0,4) 
ONLINE *DA15,(0,4) 
ONLINE *DA8, (0,4)

The only change required in different statements is in the specification of the channel number. The two numbers in brackets should always be 0 and 4. The 0 is the initial size of the scratch area which the FORTRAN system requires to be zero, and the 4 specifies the bucket size to be 512 words. The FORTRAN system will extend the scratch area to the required size.

R.2.5 FILESTORE DISC FILES

Filestore disc files are used for information that is required to be kept between program runs. The corresponding PDS statement is distinguished by containing a dummy filename after the file type. Unlike scratch files, for which only the USE statement is available all statement types are possible for permanent files. INPUT should be used when the information in the file is to be used and the file is not to be altered; OUTPUT (or CREATE for DIRECT files) when the current contents are not required, and USE in other cases. The dummy names chosen do not matter as long as they are all distinct. Some example PDS statements follow:

CREATE 1 - DA1/DIRECT(NEW)/512 
OUTPUT 2 = DA2/FORMATTED(ALSONEW)/512 
INPUT 3,33 = DA3/UNFORMATTED(OLD)/512 
USE 999 = DA13/UNFORMATTED(ALSOOLD)/512 
USE 998 = DAO/DIRECT(ALSOOLD2)/512

The exact format of the ASSIGN command required depends on the type of the PDS statement for the channel. All the commands are of the general form:

ASSIGN *DAn, name(q)

The parameter q depends on the PDS statement.

PDS statement type       q
CREATE                   EMPTY    (WRITE for exofiles)
OUTPUT                   EMPTY    (WRITE for exofiles)
INPUT                    READ
USE                      OVERLAY

Unless there are good reasons otherwise, such as not owning the file or wishing to preserve its traps, it is often preferable to ERASE and re-CREATE a file whose current contents are not required. In any case, the disc files for use with FORTRAN should be created with zero length. If the above recommendation for 512-word buckets is followed, a CREATE command of the following form can be used:

CREATE name(*DA,KWOR0) 
CREATE !(*DA,KWOR0)

R.2.6 DISC EXOFILES

Disc exofiles are named disc files outside the GEORGE filestore. Their main advantages are that they can be very much larger than GEORGE filestore files and that access to them is more efficient for large amounts of data. They do have a number of disadvantages, mainly that they are not protected in the same way as filestore files and can easily be overwritten by mistake. Because of this users of exofiles are advised to keep back-up copies on magnetic tape and also to examine their data from time to time to make sure it has not been corrupted.

Exofiles can be obtained by applying to the Tape Librarian at ACL. He will need to know the size of the exofile and its bucket size. As there is no directory system for exofiles, and the exofiles belonging to all users must have unique names, it is advisable to have the username as part of the exofile name. Users should ensure that exofiles are large enough to contain the data they will write into them. If an exofile is too small it will be extended by the FORTRAN system. This can make it very difficult for the Tape Librarian to keep track of the disc space available for users. The FORTRAN system comments in the output at the end of the program run if it has extended any permanent disc files. If these are filestore files no harm has been done, but if they are exofiles the Tape Librarian should be informed. Exofiles are connected to a program channel by a form of the ONLINE command as shown by the following examples:

ONLINE *DA1(WRITE), (777,name)
ONLINE *DA2(READ), (777,name)
ONLINE *DA3(OVERLAY), (777,name)

Note that the qualifier follows the channel name rather than the filename, and that EMPTY must be replaced by WRITE. In the examples the 777 is the cartridge number (CSN) of the exofile. The CSN for a particular exofile will be specified by the Tape Librarian. Within the user program exofiles are used in exactly the same way as filestore files.

R.2.7 THE TRACE CHANNEL

When the FORTRAN run-time system produces output on its own account, or the program tries to write on stream zero, the output is actually sent to the trace channel. The trace channel will normally be the first formatted output channel in the PDS, and for this reason the first output channel for formatted records in the PDS should be a lineprinter channel. It is not essential that the program itself makes any use of this channel using the stream number in the PDS statement, although it is not prohibited from doing so. If no suitable output channel is given in the PDS, it is possible that any error output from the FORTRAN run-time system will be lost.

R.2.8 MISCELLANEOUS POINTS

The same channel can appear in more than one PDS statement provided that only one statement has its stream numbers used at run time. The FORTRAN trace output can use a stream, even though the user does not. If subroutine libraries and semicompiled files are used, all streams used by the program must be specified in the PDS that is examined first by the consolidator. However, if the semicompiled file is being set up for later use, the PDS need not mention any channels at all.

R.2.9 MAGNETIC TAPE

If magnetic tape channels are used in a FORTRAN program, the PDS statements are similar to those used for formatted and unformatted permanent disc files. The main difference is that any buffer size up to 16384 words can be used. Small buffer sizes are not recommended as they use the tape inefficiently. A buffer size of 1024 is recommended for general use. The names in the PDS statements are dummy as the actual tape name is specified in the ONLINE command. The dummy names used should be different for different tapes but a tape and a disc channel may use the same dummy name. The examples below should exemplify the various forms of tape PDS statements:

INPUT 88 = MT0/FORMATTED(OLD)/1024
OUTPUT 77 = MT1/FORMATTED(NEW)/1024
USE 996 = MT14/UNFORMATTED(OLDALSO)/1024

The user is advised to get tapes by means of the GETONLINE command when they are first used. This command replaces the ONLINE command for that run of the program. Some examples follow:

GETONLINE *MT14, name, PR TRACK9 
GETONLINE *MT12, name, PR TRACK7
ONLINE *MT0, name(READ) 
ONLINE *MT1, name(WRITE)

The first example GETONLINE command obtains a 9-track tape, and the second one a 7-track tape. Normally a 9~track tape is to be preferred. In the ONLINE command the READ qualifier is used if the INPUT form is used in the PDS, and the WRITE qualifier otherwise.

A user can only obtain tapes if he has a sufficient magnetic tape budget. He should apply to the Tape Librarian in the first instance stating the number of magnetic tapes he will require to own at any one time. When he no longer requires a tape he should return it using a RETURN command. This will not prevent him obtaining another tape later if he wishes. An example of a RETURN command follows:

RETURN name(*MT)

Users should not obtain more than one tape with the same name.

R.3 ALGOL

R.3.1 BASIC PERIPHERALS

Channels of types CR, CP, LP and TR are dealt with here. Records written to CP channels are limited to 80 characters by the ALGOL system. Similarly, only the first 80 characters of card reader channels can be accessed. Lineprinter records are limited to the length specified in the PDS statement. If no length is given, a default of 120 characters is used. In order to allow records of more than 80 characters to be read, the use of TR channels is described. Records read on channels of this type have all their characters accessed. Some examples of correct PDS statements follow:

'INPUT' 5,10,4000 = CR1 
'OUTPUT' 7 = LP0/120 
'INPUT' 4 = TR5 
'OUTPUT' 9 = CP0

R.3.2 DISCS

Data handling on discs is usually carried out by using the backing store package. Otherwise, a disc file can only be used for either input or output, but not both, in one run of a program. The user can most easily think of a disc file as a card reader or a card punch whose lines can be longer than 80 characters.

Disc channels are specified in the PDS by an 'INPUT' statement when a file is to be read and by a 'CREATE' statement when a file is to be written. Some examples follow.

'INPUT' 5 = ED4(A) 
'CREATE' 6 = ED6(B)

Note that the channel must be referred to as type ED rather than type DA due to deficiencies in the compiler. The name given in brackets is a dummy filename.

The exact format of the ASSIGN command required depends on the type of PDS statement for the channel. For an 'INPUT' file the following form is used:

ASSIGN *DAn,name

For a 'CREATE' file the following form should be used:

ASSIGN *DAn,name(EMPTY)

Unless there are good reasons otherwise, such as not owning the file or wishing to preserve its traps, it is often advantageous to ERASE and re-CREATE the file. Files should be created initially of zero length by the following command:

CREATE name(*DA,KWORDS0,BUCK1)

R.3.3 OMITIO

When FORTRAN routines are being used for all input and output, the only statement concerning the I/O facilities in the ALGOL PDS should be:

'OMITIO'

R.4 ALGOL BACKING STORE PACKAGE

R.4.1 INTRODUCTION

The ALGOL backing store package is a set of routines that allow disc files to be used as backing store for ALGOL programs. Whole or part of a specified array, integer or real, can be copied to or from disc. The disc files used by the package must not be used in other input or output statements, and should not be declared in the program description. Files must be opened before use and may be closed by the user or by the system. Files are closed by the system on a normal or error termination, but not when GEORGE causes control to revert to the job description without allowing the program to resume. All procedures must be explicitly declared as shown below.

R.4.2 THE DISC FILES

Each disc file is linked to a channel number. The channel number should be in the range 0 to 7. The disc file is considered to consist of a number of file elements, each of which can hold a real or an integer number. The elements of a file are numbered sequentially, with the first element being given the number one. Every transfer to or from the file takes place starting at a specified element of the file. The size of the file in elements can be specified when the file is opened, and the package will alter the file from its current size if necessary.

R.4.3 OPENING AND CLOSING PROCEDURES

 
 
procedure createstore (N,S,T,G,L);
value  N,L,G;
integer N,L,G;
string S,T;
external
         
 
 
procedure instore (N,S,T,G);
value  N,G;
integer N,G;
string S,T;
external
         
 
 
procedure instore (N,S,T,G,L>;
value  N,L,G;
integer N,L,G;
string S,T; 
external
         
 
 
procedure workstore (N,S,L);
value  N,L;
integer N,L;
string S; 
external
         

The parameters have the following meanings:

N: channel number (0 to 7)
S: device type, always specify ‘ED’
T: filename, this is a dummy name
G: specify as -1
L: size required in elements (or zero for exofiles).

Note that not all the arguments are required for each routine. The choice of opening routine to be used is made as follows:

For a scratch disc area      -  use workstore
For an empty filestore file  -  use createstore
For a partially filled file  -  use usestore
For an input only file       -  use instore

Exofiles are treated like filestore files, except that L is specified as zero.

If required, the user's program can explicitly close a file by using the following procedure:

 
 
procedure freestore(N);
value  N;
integer N;
external
         

The examples that follow illustrate the GEORGE commands appropriate to the various opening procedures:

ONLINE *DA4,(0,1) 
workstore(4,‘ED’,5000);
ASSIGN *DA2,filename 
instore(2,‘ED’,‘DUMMY’,-1);
ASSIGN *DA2,filename(WRITE)
usestore(2,‘ED’,‘JUNK’,-1,4510);
createstore(2,‘ED’,‘JUNK’,-1,4510);
ONLINE  *DA6,(csn,exofile) 
instore(6,‘ED’,‘DUMMY’,-1,5000);
ONLINE  *DA7(WRITE),(csn,exofile) 
uses tore (7,‘ED’,‘DUMMY’,-1,0);

R.4.4 ARRAY SEGMENTS

The transfer routines can copy array segments only. An array segment is specified by its first and last element, it must consist of at least one element. It is easy to see for an array of one dimension which elements lie in the segment. If the first element is X[3] and the last is X[6] then the segment consists of X[3], X[4], X[5] and X[6]. For arrays of higher dimension it is necessary to map them down to the corresponding single dimension array. Arrays are stored by column. The 2-dimensional array X[l:2,4:6] has the following order:

X[1,4]  X[2,4]  X[1,5]  X[2,5]  X[1,6]  X[2,6]

This means that X[2,4] to X[1,6] is a proper segment but X[1,5] to X[2,4] is not. The idea generalises to n-dimensions and the rule to remember is that the right-most subscript varies less rapidly.

R.4.5 TRANSFER PROCEDURES

R.4.5.1 Real Arrays

 
 
procedure putarray (N,K,A);
value  N;
integer N,K;
array A;
external
         
 
 
procedure getarray (N,K,A);
value  N;
integer N,K;
array A;
external
         
 
 
procedure putpart (N,K,A,X,Y);
value  N;
integer N,K;
real X,Y;
array A;
external
         
 
 
procedure getpart (N,K,A,X,Y);
value  N;
integer N,K;
real X,Y;
array A;
external
         

Procedures putpart and getpart are used to transfer array segments to and from disc respectively. The procedures putarray and getarray treat the whole array as a single segment. The arguments to the procedures are:

N: channel number (0 to 7)
K: the first disc element to be used in the transfer
A: the array
X: the first element of the segment
Y: the last element of the segment.

The parameter K (called by name) is incremented by the number of elements transferred.

An example is:

K:=100;
putpart(6,K,A,A[1,1], A[6,4]);

(K will now be 100 + length of segment)

R.4.5.2 Integer Arrays

Analogues of the putpart and getpart procedures only are provided for integer arrays.

 
 procedure putparti (N,K,A,X,Y);
value  N;
integer N,K,X,Y;
array A;
external
         
 
 procedure getparti (N,K,A,X,Y);
value  N;
integer N,K,X,Y;
array A;
external
         

R.4.6 FURTHER INFORMATION

Further information and examples can be found in reference (3) of M.1.5.

⇑ Top of page
© Chilton Computing and UKRI Science and Technology Facilities Council webmaster@chilton-computing.org.uk
Our thanks to UKRI Science and Technology Facilities Council for hosting this site