+ Reply to Thread
Results 1 to 5 of 5

Thread: Subfile question

  1. #1
    S.Mildenberger Guest

    Default Subfile question

    Erik, You need to use the SFLNXTCHG keyword conditioned with an indicator. When you READC and a record has an error then set the indicator on the SFLNXTCHG before you UPDATE the subfile record. Then after the EXFMT this record will be returned on a READC even if the user did not change it. The description in the manual describes your scenario exactly. Scott Mildenberger

  2. #2
    Guest.Visitor Guest

    Default Subfile question

    As Scott said, use the keyword SFLNXTCHG conditioned with Indicator(s). To display error messages, you may want to use SFLMSG/SFLCTL type records to your display file. If you need examples, go here. Message Subfile Example Elan

  3. #3

    Default Subfile question

    There are times when you do want to read the entire subfile, and not just the changed records. IMO, READC is not the proper opcode. You can use a CHAIN by relative record number within a DO loop. here is some pseudo code:
     z-add 1 x *in99 doweq *off x chain subfilerec 99 *in99 ifeq *on leave endif add 1 x ------- do some stuff here ------- enddo

  4. #4
    Guest.Visitor Guest

    Default Subfile question

    Actually, this code will generate CPF5020 (Subfile record not found) messages in the job log, which slows the program down and can cause other problems. If you want to read the entire subfile it's probably better to store the last RRN written (RRNL in this example) and read the records in a loop like this.
     C DO RRNL RRN C RRN CHAINFORM01S 99 * * Process record here * C ENDDO 
    Dave...

  5. #5

    Default Subfile question

    How do you readC an entire subfile EXFMT on the subfile again allowing the user to correct errors and readC the ENTIRE subfile again checking to make sure ALL of the errors are fixed. The subfile looks like this. Qty Scan or Item# Title ================================================== == 1 4000 3 15000 1 11865 1 4001 1 4002 3 4005 5 5000 1 4222 3 13000 1 4221 3 4100 The title is filled in when the screen is returned to the user for a final check with the message "Press enter to update inventory records." The idea is to display a generic error message until all the errors on the subfile are fixed. The user will fix the errors and hit enter again. Herein lies the problem. If the user hits enter and the program does a READC on the subfile it only picks up the changed records. If the user did not correct all the errors it will still go through because the READC will not catch the errors a second time if they have not been changed. I'd like to find a way to do this without redisplaying the screen multiple times in the loop until the user gets it right. Possible errors include entering a qty without an item#, entering an item# without a qty, entering an invalid item# or entering a set header item# which cannot be updated. The generic error message that will display is, "Error! Check input quantities and item#'s. Cannot update set headers." When the screen redisplays, if an Item number isn't found, the title will be blank. If an item is a set header the title will say "Cannot update set header" and if the qty or item# is entered one without the other this is easily spotted. So the user could potentially fix all of the errors at once and move on in processing without seeing the screen multiple times for each error. Can I get around this? Erik J. Osberg

+ Reply to Thread

Similar Threads

  1. Subfile question from a newbie
    By Guest.Visitor in forum RPG
    Replies: 1
    Last Post: 08-03-2005, 10:09 AM
  2. Subfile question from a newbie
    By Guest.Visitor in forum General
    Replies: 0
    Last Post: 08-01-2005, 12:14 PM
  3. SUBFILE QUESTION
    By J.Pluta in forum General
    Replies: 2
    Last Post: 01-13-2004, 12:10 AM
  4. subfile question !
    By DougCMH in forum RPG
    Replies: 12
    Last Post: 11-10-2003, 04:21 AM
  5. Subfile question
    By Guest.Visitor in forum RPG
    Replies: 2
    Last Post: 02-13-2002, 03:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts