Ü EXFMT (Write/Then Read Format)
·
The
EXFMT operation is a combination of a WRITE operation followed by a READ to the
same record format.
Hence,
instead of writing the operation code EXFMT we can also use two operation codes
WRITE (format-name) + READ (format-name).
·
This
opcode displays whatever we have written to the workstation fields and waits
for the user input to enter anything, once any input is given then only the
processing advances to the next line.
·
EXFMT
first of all write the input buffer to the display device (to the screen field
variable) and then reads the fields value to provide it to the program.
Example
Display
file : DSP1
Columns . . . : 1 100 Browse
SEU==>
FMT DP .....AAN01N02N03T.Name++++++RLen++TDpBLinPosFunctions++++++++++
*************** Beginning of data *****************************
0001.00 A R DETAIL
0002.00 A FLD1 10A B 3 10
****************** End of data ********************************
RPGLE
program
Columns . . . : 6 100 Browse
SEU==>
FMT FX FFilename++IPEASF.....L.....A.Device+.Keywords++++++++++++++++++++++
*************** Beginning of data **********************************
0001.00 FDSP1 CF E WORKSTN
0002.00 C eval fld1='aaaaaaaaaa'
0003.00 C write Detail
0004.00 C read Detail
0005.00 C exfmt detail
0006.00 C seton lr
****************** End of data *************************************
OUTPUT
1st run:
The output will be as below
for the first write/read operation:
FIELD-1: aaaaaaaaaa
Now the screen will ask for
user input, we simply press ‘ENTER’ key.
We get the same output again
as above:
FIELD-1: aaaaaaaaaa
2nd run:
Now we run the program again
and this time after the first write/read operation we input ‘bbbbbbbbb’ in
field-1 and press ENTER.
The output will be as below
for the first write/read operation:
FIELD-1: aaaaaaaaaa
Now the screen will ask for
user input, we input ‘bbbbbbbbbb’ and press ‘ENTER’ key.
We get below output:
FIELD-1: bbbbbbbbbb