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


Please Help Members By Posting Answers For Below Questions

what are the different types of variables available in cl?

1007


What is the difference between crtdupobj and copyf?

683


how do you read changed records backward in subfile?

615


Using %check we are checking monika in mona what is output? What is %SCAN?

989


how do handle file exception/error?

650






What Is Default Data Type (if You Define Decimals '0') In Physical File?

1148


WHICH REPLY CODE IS USED BT sftp ? ... (e.g.226 is used by FTP IF FILE IS TRANSFERED)

1720


If I want to execute Sftp commands(LS & GET) stored in Physical file from CL program automatically...Can u Plz tell me how can I do this?...How the script will look?? THANX FOR NY HELP...

2183


difference between sflrcdnbr and sflnxtchg?

703


what is the purpose of the indara keyword?

1131


what does vldcmdkey means?

819


when do you use f-spec. Continuation line ?

978


how you will find an error which is not in the first page of the subfile without using rolldown key?

562


can we use ASCII ,CDUP,SENDPASV commands in SFTP?

3150


which are the query selection criteria, which can be given in a query?

669