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 ?    9 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 is the command used to invoke rlu ?

1 Answers   IBM,


why we use binding directory and service pgm

4 Answers   TCS,


what is the length of a variable in rpg?

1 Answers   IBM,


what is message file?

0 Answers   IBM,


What is the difference between iter and do? We know both are used to execute set of statements repeatedly, but what is the main difference?

0 Answers  






What is acronym of RPG?

1 Answers  


Is it possible to join the same file to itself ?

1 Answers  


what does opcode post do ?

1 Answers   IBM,


Good morning my experts.Im kuppi.im working as a software trainee on AS/400 technology.i have also joined with ibmi5 team.im trying to convert date with cl/400 coding.I have taken 2 parameters(like date and date types). A. If suppose date type is j,Now i want to convert date to *MDY format B. if date type is M,now i want to convert date to *JUL format C. sending a Program message with the value of converted date.

1 Answers  


what is term cua , saa?

1 Answers   IBM,


is it possible to create a physical file without dds?

1 Answers   IBM,


what is join logical file?

1 Answers   IBM,


Categories