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
using dfu, user will be able to ___________ from physical file?
how do you use commitment control in rpg program ?
Difference between NOPASS & OMIT?
what is a program described file in rpg?
what is the maximum number of subroutines allowed in rpg?
how does the runqry show the output?
explain the use of dftwrt display keyword?
how can you check for a records existence without causing and i/o (chain/read)?
what is match field indicator?
what are the different types of data areas?
In RPG How to read a records from a file without using read opcodes?
what is the necessary keyword for non-join logical file?
how do you read changed records backward in subfile?
how many types of display are available on as/400 for user interaction?
what is externally described file ?