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?
Answers were Sorted based on User's Feedback
Answer / pravin
clear and reset both opcodes are used for clearing the
fields and then initialise the numeric fields with
zero and character with blanks difference is that if we
define any initilialise value for that var in pgm reset
initialize it by that value but clear initialize it by zero
or blanks.
OPEN & CLOSE opcodes are used for explicitly open and
close the file.
SFLNXTCHG :Its always read those records which changed
in uppdatesubfile.this is declared in subfile(SFL) format
not
SUBCTL format.
| Is This Answer Correct ? | 22 Yes | 2 No |
Answer / balaji
CLEAR opcode is used to set a data item i.e. a field with
predefined default value based on its type. This opcode is
particularly useful when it specified for a data structure
because it clears all of the subfields in the data
structure.
char = *blanks Numeric = 0 etc
RESET is returns a filed to its intial value as specified
in INZ keyword.
| Is This Answer Correct ? | 9 Yes | 0 No |
clear and reset both opcodes are used for clearing the
fields.difference is that clear only clear but reset is
used for clear & then initialise the numeric fields with
zero and character with blanks.
OPEN & CLOSE opcodes are used for explicitly open and
close the file.In precise all files are automatically open
when these are processed by program bt at somepoint if we
want this should not be implicitly then open we use these
keywords.
SFLNXTCHG :Its always read those records which changed 2
or more times.this is declared in subfile(SFL) format not
SUBCTL format.
| Is This Answer Correct ? | 14 Yes | 8 No |
Answer / 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 |
What process the command SBMRJEJOB does?
I have 1 rd in my flat file. say reord from 1 to 10 position : 'AS400NDB2400' I need to change the value from N to Y using SQL stmt ...How can I update this....?
When does the DFT keyword in PF be used?
define the rcvf command?
What is the difference between access path and Dynamic select?
what is a primary file?
what is a program described file in rpg?
What are Control level indicators?
how can you detect overflow for a print program that prints multiple lines per cycle?
how to declare a constant variable in the freeformat?
define the purpose of the %sst function?
I am fresher 2009 passedout.can you pls explain me what is AS400 and where it can be used and how about growth in the position as well as salary, whether it is a programming language or else?