Ü  READC (E) (Read Next Changed Record)     

·         READC will cause our program to read subfile records that have been changed, keyed into, field exited.

·         Even we not making any change in the record but we are keying in some value (by mistake) or pressing the field exit key, the record is supposed to be changed. Hence, READC will detect these cases also.

For example, if we have a subfile records displayed on the screen with an input-capable field (e.g. 2=Edit, 4= Delete, 5=Display) and we enter option-3 here, then still the record is changed and READC will read this changed record, but 2nd time again after correcting the error, if we try to access the record it won’t be available. If 2nd time we want the same record first of all we need to  turn on the indicator associated with SFLNXTCHG and then update the subfile.

·         If we have an editable subfile screen then we can modify any subfile record, to identify which record have been modified, we can use READC on the subfile and can put a DOW NOT %EOF(), to read all the changed record of the subfile and then process each record one by one.


Factor 1


Factor 2

Result Field

Resulting Indicators

       HI                            LO                      EQ



Subfile record format name

Data structure to hold the result



End of file condition indicator





0003.00 C                   DOW       *IN03=*OFF
0004.00 C                   EXSR      MAIN
0004.01 C                   EXSR      DSPLY
0004.02 C                   ENDDO
0005.00 C                   SETON                                        LR
0006.00  *______________________________________________
0007.00  *___MAIN SUBROUTINE BEGINGS HERE_______________
0008.00 C     MAIN          BEGSR
0008.01 C                   READC     EXPD_SFL      >>>>>>>>> READC to check if any option
0008.02 C                   DOW       NOT %EOF()                is taken on the option field.
0008.03 C                   SELECT
0008.04 C     S_OPT         WHENEQ    '1'
0008.05 C                   EXSR      OPTION1
0008.06 C     S_OPT         WHENEQ    '2'
0008.07 C                   EXSR      OPTION2
0008.08 C     S_OPT         WHENEQ    '4'
0008.09 C                   EXSR      OPTION4
0008.10 C     S_OPT         WHENEQ    '5'
0008.11 C                   EXSR      OPTION5
0008.12 C                   OTHER
0008.13 C                   EXSR      VALIDATE
0008.14 C                   ENDSL
0008.15 C                   READC     EXPD_SFL
0008.16 C                   ENDDO
0008.18 C                   EVAL      MODE='1'
0009.00 C                   ENDSR


User Comments:

Copyright © www.go4as400.com, 2013-2023. Copyright notice   Terms of services   Privacy policy