what is the difference between clear and reset opcodes and
open and close opcodes?please tell me in real time senario
with example please?
And
What is the use of SFLNXTCHG?Where we can use this?
Answer Posted / john bulloch
Clear is used to re-initialise a set of data (fields,
arrays, data structures, record formats etc) to blanks for
alpha fields & zeros for numeric fields.
Reset is used to re-initialise a set of data (fields,
arrays, data structures, record formats etc) to it's
initial values set using the inz keyword.
When a file is defined as USROPN, you need to use OPEN &
CLOSE to (you guessed it) OPEN & CLOSE the file.
SFLNXTCHG is used when reading changed records in a subfile
using the READC opcode. The indicator is set on when the
data in the record changes.
For example, when you use READC to validate all the entries
in a subfile before updating or writing the data to a file,
the next time you use READC to perform the updates, you
wouldn't pick up the record you just validated without
reseting the SFLNXTCHG indicator as in the following:
(SFLNXTCHG is linked to indicator 85)
READC sflrec // read the first changed record
DOW not %EOF // process all changed records
Validate the record
*IN85 = *ON // Reset the SFLNXTCHG indicator
UPDATE SFLREC // Update it so that *IN85 sticks
READC sflrec // read the next changed record
ENDDO
now, when you readc to perform your updates, it will pick
up the records you validated in the previous loop
READC sflrec // read the first changed record
DOW not %EOF // process all changed records
update/write the data // read the next changed record
READC sflrec
ENDDO
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
what is message subfile?
define the rcvf command?
Difference Between Ca & Cf?
what are indicators?
if we tried to move year part of *iso date into a field of length 3, what will happen ?
what is a non-join logical file?
What is RETURN CURSER LOCATION in subfile?
during input operation which indicator position is seton if there is a record lock?
what is match field indicator?
which are the member types which seu supports?
is there any way to dynamically merge other html scripts into a given html?
what is cab?
how can database records be read without lock ?
give three main purposes of file specification ?
How do I remove a flag or check no. or name when a user opens too many sessions?