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 |
how many printer files can be defined in f specs ?
how can u check no of records in a file?
How many Printer Files can Declare in a CL Program?
how can I give more performance to some selected pages?
in which specification the report layout can be defined?
What is Sub-System?
what is the maximum number of records you can specify in a display file?
Define what the operation will do, the purpose of the result field and the purpose of *IN66? HI LO EQ C CALL 'CVTDAT' DTPRM 66
what is the version of os/400 that we have?
what is the command to know how many lf are related to a pf?
I have to execute 12000 CL Commands one by one.. So, I have created a file called COMMAND. This file has only 1 field called STRING. This file had 12000 records, and all these records are CL Commands (ex: CALL PGM(PGM1)), etc) I have written a CL which will read all the record and do sbmjob.. But it is not working... Plz help me to exexute all these 12000 commands..
Difference Between Source Physical File & Physical File?