Additional Storage Using Diskette Data Files - IBM 5110 User Manual

Apl
Table of Contents

Advertisement

54
ADDITIONAL STORAGE USING DISKETTE DATA FILES
You can use a direct access data file to store variables that are not
currently needed in the active workspace. These variables can then be
removed from the active workspace (to conserve storage) and quickly
read back into the active workspace as needed. You can use the
following procedure to store variables for later use on a diskette data
file:
1.
Establish a type M direct access data file (see
Input/Output
Control)
using dummy records. The first dummy record written
to the file should require as much diskette storage as the largest
variable that is to be written to the file. For example, you might
use the following user-defined function to establish a type M file
with 256 bytes allocated for each record:
'V'DUMMY I::
n::l
\I
'iJ DUMl1Y;
C.:
X; I .... _ _ _ _ _ You must specify the file
I~"
0
I D enclosed in single quotes.
X~-:I.
nnVD
'C'
[:1.::1
[2]
I::
~5::1
I: Lt·]
C~X~'OUTF
1:1.008 ID=(REAL,STORAGE)
..
~
( O;t::I.
t
X
i"
C ) I E R
I~
() R
TYPE::::M'
[5::1
LOOP:C~256p'A'
[6]
~(O~:l.tX~C)/ERROR
7 ]
-t (
2 0 ;:: I
~
.. I +:1. )
II...
0 0 P
BJ
C~-\O
9]
~(O¢ltX~C)/ERROR
:I. OJ
'THE DATA FILE IS CREATED SUCCESSFULLY'
:1.1::1
-~O
I..
:t
2 ::I E
I~ I:~
(] R: 'E
I~ I~
(]
I~""
.... THE RET U
I~
NCO It E IS:
' I
'f'
X
V
2.
Establish a pair of shared variables, and specify direct access
input/ output operations to the data file. For example, you might
use the following user-defined function:
'\/DPEN[[]::IV
'iJ
OPEN FII...EID;X
1:::1.::1
Xt· :1.
nsvo
2 "{
p'
CTI...BAVEDATf.iAVE'
[2]
,~
( A/X"l:2) IE R
I~O
R
................
.. ............ .
I::
:' 5 ::I
C T
I...
S AV
E~"
· I
c)
Ix
I D :::: ( , } F I
I ...
FIn
1
'
)
,
['+::1
X i··c=rL~3AVE
[5::1
~(O~:l.i~}7ERROR2
[6]
· SUCCESSFUL
npEI~ATION'
[7]
SAVELIST~
1 1
p'
[B::I
··~o
You must specify the
file
I D enclosed in
single quotes.
[9]
FI~ROI~:'
THE
(]FF[I~
FAII...ED .... " .. THE
I~ESUI...T
IS:
' I
'fX
[:1.0]
..
~o
[:1.1::\
ERI~OI~~.~:'
THE OPEN FAII...ED .... · .. ·THE RETURN CODE:
'} 'f'X
'iJ

Advertisement

Table of Contents
loading

Table of Contents