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



what is the difference between clear and reset opcodes and open and close opcodes?please tell me i..

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

what is the difference between clear and reset opcodes and open and close opcodes?please tell me i..

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 ?    8 Yes 0 No

what is the difference between clear and reset opcodes and open and close opcodes?please tell me i..

Answer / swadesh

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

what is the difference between clear and reset opcodes and open and close opcodes?please tell me i..

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

Post New Answer



More IBM AS400 AllOther Interview Questions

What are the different types of keywords in display files?

1 Answers  


Where would you use Override Data Base File?

4 Answers  


how can you specify no duplicate key?

0 Answers   IBM,


which are the member types which seu supports?

0 Answers   IBM,


Difference Between Call & Sbmjob?

0 Answers   IBM,






how to develop some simple graphs (bar charts) using just html?

0 Answers   IBM,


What is LDA?

1 Answers  


What is the difference between /copy and /include in RPGLE?

1 Answers  


What is the use of jdftval in as400?

0 Answers  


how to get the cursor position?

0 Answers   IBM,


What is the difference between crtdupobj and copyf?

0 Answers  


what is the use of jdftval in join logical file?

1 Answers   IBM,






Categories