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
how to run other job when one job is active?
what is sflrolval?
define the purpose of the *cat function?
how to validate input values in display file ?
explain the difference between defining subfile and message-subfile?
what is the difference between packed decimal and zoned decimal?
Difference Between Call & Sbmjob?
maximum number of subfiles that can be active for a single file is?
What Is The Purpose Of The "n" In The Following Calculation Specification?
what does the opcode free do?
distinguish between terminating a program through seton lr and return?
what is the use of unique keyword and what level it is defined?
If i change any file through application after entering data , how to check which file is updated through applications . For call stack we takes esc 3 then we chose 11..But What is answer of below qtn..?
A join logical file has how many record formats?
if dspatr(pc) and csrloc were specified for a format, which keyword would have priority?