STRING VARIABLE CPEB 15 DS; STRING VARIABLE CPART1 15 DS; ...

Linki


» Dzieci to nie książeczki do kolorowania. Nie da siÄ™ wypeÅ‚nić ich naszymi ulubionymi kolorami.
»
Po wykonaniu instrukcji String arr[][] = new String [3][]; odnoœnik arr identyfikuje 3-elementow¹ tablicê odnoœników do tablic...
»
This could come into play if you want to separate a string based on more than one element...
»
word into a deque<string>...
»
2010-02-15 01:00 17262 7324 Oprogramowanie Systemów Pomiarowych\OSP\KursyNatInst\KursyNatInst\2012_LV Core 3\2012_LV Core 3_Exercises\Demonstrations\TLC...
»
Pozycja Moje bieżące dokumenty może być przydatna, ponieważ udostępnia podmenu zawierające listę 15 ostatnio otwartych dokumentów...
»
15 KLutkowski (2003) twierdzi, że tylko znaczący dalszy postęp w restrukturyzacji polskiej gospodarki na szczeblu mikro (i tym samym istotna poprawa jej...
»
m = 2 as expected, but the second variable, plot_seq, has two values, where only one value is expected...
»
15 Trebileock, Howse (1996), s...
»
CZAS PRACY: 15...
»
to a few MHz) are caused by the chopping technique used by variable-speed drives or the electronic ballasts of fluorescent lighting...

Dzieci to nie książeczki do kolorowania. Nie da się wypełnić ich naszymi ulubionymi kolorami.

...
END DECLARE;
PROGRAM; PLEX;
....
....
CPEB = "DUMPFILE";
CPART1 = "SUB1";
....
SEIZE FILE CPEB.CPART1 FOR ISO INPUT,
ID IS CIOBUFFER,
ABRANCH IS SEIZEERROR600,
CODE IS CIOCODE;
....
END PROGRAM;
Figure B.8
Seizure of Subfile
The SEIZE statement results in a search for subfile SUB1 in file DUMPFILE by the I/O system.
The statement seizes the subfile SUB1. It is now possible to read data from the subfile into a buffer in the user block.
Example 103
Here is a real-life example. The back-up file RELFSW0 is kept on hard disk in the IOG-11 (input output system). This file divides into six subfiles and contains a back-up copy of the SW in the exchange.
The subfiles are:
RELFSW0.R0
Administration data.
RELFSW0.R1
Charging data.
RELFSW0.R2
— " —
RELFSW0.R3
Exchange data, in particular variables marked RELOAD, and global number symbols.
RELFSW0.R4
— " —
RELFSW0.R5
Program and reference stores.
Writing a Block to a File
Programs use the WRITE statement to transfer data, for example, charging data, from the CP SW unit to a file on the I/O device.
314
File-Oriented Input and Output
Each WRITE statement transfers one data block. Sometimes programs need several WRITE statements to transfer all the data.
Before executing the WRITE statement, programs have to seize the file for OUT­
PUT. The CP SW unit has to place the data block to write in a buffer variable before the writing.
WRITE BLOCK BUFFER buffer , ID IS
io-individual ,
ABRANCH IS label , CODE IS io-code , CHANUM IS number
, POINTER IS pointer
;
Figure B.9
Syntax for Writing a File
Please see the following box for syntax explanations.
buffer = Buffer variable from which the data is fetched.
io-individual = a 16 bit field variable which contains the number of the seized analysis/line buffer. The number was assigned in an earlier SEIZE statement.
label = program label to which a jump is made if something fails.
io-code = a structured 16 bit variable which, after execution of the statement, contains an answer code from the I/O system.
number = variable containing the number of 8-bit characters in the buffer.
pointer = any pointer in the program to be saved. Pointers and temporary vari­
ables lose their values when the WRITE statement is executed.
Example 104
This example shows the writing of a file on an I/O-device.
PROGRAM; PLEX;
....
WRITE BLOCK BUFFER COUTPUTVAR,
ID IS CIOID,
ABRANCH IS WRITEERROR130,
CODE IS CFAULTCODE,
CHANUM IS CBLOCKSIZE;
Figure B.10
Writing of File
315
Plex-C 1
This statement writes the contents of the buffer variable COUTPUTVAR into the seized I/O file. In earlier statements, the buffer variable has, of course, been assigned values.
The variable CBLOCKSIZE contains the number of characters or the block size to be written. The number may vary between 18 and 2048 (8-bit) characters in one block.
Reading from a File into a Block
READ transfers one data block from an I/O file to a dynamically allocated buffer in the user block. Before reading the data, seize the file for INPUT.
READ TO BLOCK BUFFER buffer , ID IS
io-individual ,
ABRANCH IS label , CODE IS io-code , CHANUM IS number
, POINTER IS pointer
;
Figure B.11
Syntax for Reading a File
buffer = buffer variable where the transferred data block is stored.
io-individual = a 16 bit variable which contains the number of the seized analysis/line buffer. The number has been assigned in an earlier SEIZE statement.
label = program label to which a jump is made if something fails.
io-code = a structured 16 bit variable which, after execution of the statement, contains an answer code from the I/O system.
number = variable which, after execution of the statement, contains the number of 8-bit characters in the buffer variable.
pointer = any pointer in the program to be saved. Pointers and temporary vari­
ables lose their values when the READ statement is executed.
Note that a READ statement reads the entire data block.
Example 105
This example shows the reading of a file.
316
File-Oriented Input and Output
PROGRAM; PLEX;
....
SEIZE FILE CPEB FOR ISO INPUT,
ID IS CIOID,
ABRANCH IS SEIZEERROR130,
CODE IS CIOCODE;
....
....
READ TO BLOCK BUFFER CINBUF,
ID IS CIOID,
ABRANCH IS READERROR140,
CODE IS CIOCODE,
CHANUM IS CNUMOFCHAR;
Figure B.12
Reading a File
The first statement results in a seizure of the I/O device containing the file.
After execution of the statements, the following has happened:
• A data block has been transferred from the seized file to the buffer variable CINBUF.
• If the read fails, a jump is made to label READERROR140 and the reason is indicated in the variable CIOCODE.
• Variable CNUMOFCHAR contains the number of characters in the buffer variable, i.e., the number of characters sent with the READ statement.

Powered by MyScript