READC on load all AS/400 subfile

165 pts.
Tags:
AS/400 Subfiles
READC
RPG
RPG Subroutine
I have a load all subfile.  Data is entered in a select field, F1 is hit, I go into a routine to READ the Changes on the subfile.  The READC indicator comes on for the first read, thus leaving the routine.  Why?

    238       C* READ THE SUBFILE CHANGES                                          239       C     SrReadC       BEGSR                                            240       C                   DOU       *in40                                  241       C                   READC     SFLRCD                                 242       C                   IF        *in40                                  243       C                   leave                                            244       C                   ENDIF                                            245        *                                                                   246       C                   Movel     horder        KCPORD#                  247       C                   Eval      KCPSEQ# =  10                          248       C     kcompf        Chain     CUSTCOMPF                              249       C                   IF        not %FOUND(custcompf)                  250       C                   movel     horder        CPORD#                   251       C                   EVAL      CPSEQ# = cpseq# + 10                   252       C                   EVAL      CPCOMM = @comment                                                                                          More...  Debug . . .                                                                                                                                                   F3=End program   F6=Add/Clear breakpoint   F10=Step   F11=Display variable     F12=Resume       F17=Watch variable   F18=Work with watch   F24=More keys      *IN40 = '1'                                                                  



Software/Hardware used:
as400, RPG

Answer Wiki

Thanks. We'll let you know when a new response is added.

Maybe you didn’t copy it or paste it correctly but I don’t see how *IN40 is associated with the READC.

In the control record is F1, CA01 or CF01???

Phil

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    There is no way to know the answer from what you have shown us. As Phil noted, we have no clue what *IN40 is. It might be set on or off by any statement elsewhere in the program. I'm not at all clear why you would use an indicator at that point anyway -- you should be using the %EOF() builtin function, assuming that you want to know when you've reached the end of changed records. The only answer that comes to mind is "If you don't want *IN40 on at that point, then don't set it on." Tom
    125,585 pointsBadges:
    report
  • Splat
    This is a guess, but it looks like *in40 is an EOF or ERR indicator for SFLRCD. You'd be better off adding the (E) extender to the ReadC operation and using If %EOF(display file name) or %Error instead of If *in40.
    7,425 pointsBadges:
    report
  • Nickhutcheson
    Yeah, it looks bad. Two issues here: 1. The difference between CA and CF. solved. 2. *in40 is the indicator on the readC, - solved. Does anyone have the positions for the highest RRN on a Subfile? This was found in the old CPF programmer's guide a hundred years ago. It was right after the Lowest RRN currently displayed on the subfile. This info comes from the INFDS.
    165 pointsBadges:
    report
  • TomLiotta
    Does anyone have the positions for the highest RRN on a Subfile? Positions? You mean in the INFDS? Should be a 2-byte binary (integer) number at offset 13, positions 14-15. It's the total number of rows in all active subfiles. Tom
    125,585 pointsBadges:
    report
  • Splat
    Nickhutcheson, if you can't change that CA key to CF, an alternative to ReadC is to chain to the subfile.
    7,425 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following