IC SunsetThe developerWorks Connections platform will be sunset on December 31, 2019. On January 1, 2020, this forum will no longer be available. More details available on our FAQ.
Topic
  • No replies
Kevin__Davis
Kevin__Davis
1 Post

Pinned topic Weird Issue with Multiple Subfiles

‏2019-09-18T17:54:37Z |

I have a screen where I am displaying three subfiles; SUBFILE1, SUBFILE2, and SUBFILE3.

 

If I have SUBFILE1 and SUBFILE2 showing, no issues on READ.

If If I have SUBFILE1 and SUBFILE3 showing, no issues on READ.

If I have SUBFILE2 and SUBFILE3  or  SUBFILE1, SUBFILE2 and SUBFILE3 showing, I get the following error when trying to READ SUBFILE3 or SUBFILE2 depending on the order I WRITE them.

 

Message ID . . . . . . :   CPF5022       Severity . . . . . . . :   30
Message type . . . . . :   Sender copy
Date sent  . . . . . . :   09/18/19      Time sent  . . . . . . :   13:43:45

Message . . . . :   Cannot read record CONTROL3 from file WOICCMFM at device
QPADEV001N.
Cause . . . . . :   If record CONTROL3 is not a subfile or pull-down menu,
write record CONTROL3 to file WOICCMFM before trying to read it or specify
INZRCD keyword in DDS for record CONTROL3, create the file WOICCMFM again,
and read without a previous write. If record CONTROL3 is a subfile control
record format, ensure that SFLDSPCTL keyword is in effect when the program
displays the subfile. If record CONTROL3 is a pull-down menu record format,
perform the read to the record format with the MNUBARDSP keyword to
determine if a pull-down menu has been selected.  A read is not allowed to a
pull-down menu record format until a pull-down menu has been selected.

 

In debug I have confirmed the SFLDSPCTL, SFLDSP, etc. indicators all appear to be set correctly before each WRITE.

 

I've been trying to debug this issue for so long, I'm afraid I can't see the forest for the trees.  What in the Wide World of RPG Sports am I missing?

 

    
     A                                      DSPSIZ(24  80 *DS3
     A                                             27 132 *DS4)
     A                                      REF(*LIBL/FLDREF6)
     A                                      PRINT
     A                                      INDARA
     A                                      CF02
     A                                      CF03
     A                                      CF04
     A                                      CF05
     A                                      CF06
     A                                      CF07
     A                                      CF08
     A                                      CF09
     A                                      CF10
     A                                      CF11
     A                                      CF12
     A                                      CF13
     A                                      CF14
     A                                      CF15
     A                                      CF16
     A                                      CF17
     A                                      CF18
     A                                      CF19
     A                                      CF20
     A                                      CF21
     A                                      CF22
     A                                      CF23
     A                                      CF24
     A                                      HELP
     A                                      ALTHELP(CA01)
     A                                      HLPTITLE('WOICCMFM')
     A                                      HLPPNLGRP(WOICCMFM WOICCMFM)
     A**************************************************************************
     A          R DUMMY
     A                                      ASSUME
     A                                 10  3' '
     A
     A**************************************************************************
     A          R SUBFILE1                  SFL
     A  13                                  SFLNXTCHG
     A            P1ISSUE        1A  P
     A            P1END          1A  P
     A                                  6  7'Issue:' DSPATR(&P1ISSUE)
     A            S1WOWMSG      50A  B  6 14
     A  40                                  DSPATR(CS UL)
     A N40                                  DSPATR(PR HI)
     A                                      CHECK(ER)
     A                                  6 65'End' DSPATR(&P1END)
      **************************************************************************
     A          R CONTROL1                  SFLCTL(SUBFILE1)
     A                                      SFLSIZ(0006)
     A                                      SFLPAG(0005)
     A                                      RTNCSRLOC(&CURREC &CURFLD &CURPOS)
     A                                      CSRLOC(ROW1       COL1)
     A                                      OVERLAY
     A                                      PUTOVR
     A                                      SFLCSRRRN(&SCCURSOR1)
     A  10                                  SFLDSP
     A  11                                  SFLDSPCTL
     A  12                                  SFLCLR
     A N12                                  SFLEND(*PLUS)
     A            CURREC        10A  H
     A            CURFLD        10A  H
     A            CURPOS         4S 0H
     A            SCCURSOR1      5S 0H      TEXT('CURSOR')
     A            ROW1           3S 0H
     A            COL1           3S 0H
     A            SCRCDNBR1      4S 0H      SFLRCDNBR(CURSOR)
     A                                  1  2' Issue Cause Correction '
     A                                      DSPATR(RI)
     A            SCSPGM        21A  O  1 59
     A            SCMODE        15A  O  2  1
     A            SCLOC          8A  O  2 72
     A                                  3  2'WorkOrder#:'
     A            C1WO#          9  0O  3 14DSPATR(HI)
     A                                  4  5'Bill To:'
     A            C1BILLTO      40A  O  4 14DSPATR(HI)
      **************************************************************************
     A          R SUBFILE2                  SFL
     A  23                                  SFLNXTCHG
     A            P2CAUSE        1A  P
     A            P2END          1A  P
     A                                 12  7'Cause:' DSPATR(&P2CAUSE)
     A            S2WOWMSG      50A  B 12 14
     A  40                                  DSPATR(CS UL)
     A N40                                  DSPATR(PR HI)
     A                                      CHECK(ER)
     A                                 12 65'End' DSPATR(&P2END)
      **************************************************************************
     A          R CONTROL2                  SFLCTL(SUBFILE2)
     A                                      SFLSIZ(0006)
     A                                      SFLPAG(0005)
     A                                      RTNCSRLOC(&CURREC &CURFLD &CURPOS)
     A                                      CSRLOC(ROW2       COL2)
     A                                      OVERLAY
     A                                      PUTOVR
     A                                      SFLCSRRRN(&SCCURSOR2)
     A  20                                  SFLDSP
     A  21                                  SFLDSPCTL
     A  22                                  SFLCLR
     A N22                                  SFLEND(*PLUS)
     A            CURREC        10A  H
     A            CURFLD        10A  H
     A            CURPOS         4S 0H
     A            SCCURSOR2      5S 0H      TEXT('CURSOR')
     A            ROW2           3S 0H
     A            COL2           3S 0H
     A            SCRCDNBR2      4S 0H      SFLRCDNBR(CURSOR)
     A**************************************************************************
     A          R SUBFILE3                  SFL
     A  33                                  SFLNXTCHG
     A            P3CORRECT      1A  P
     A            P3END          1A  P
     A                                 18  2'Correction:' DSPATR(&P3CORRECT)
     A            S3WOWMSG      50A  B 18 14
     A  40                                  DSPATR(CS UL)
     A N40                                  DSPATR(PR HI)
     A                                      CHECK(ER)
     A                                 18 65'End' DSPATR(&P3END)
      **************************************************************************
     A          R CONTROL3                  SFLCTL(SUBFILE3)
     A                                      SFLSIZ(0006)
     A                                      SFLPAG(0005)
     A                                      RTNCSRLOC(&CURREC &CURFLD &CURPOS)
     A                                      CSRLOC(ROW3       COL3)
     A                                      OVERLAY
     A                                      PUTOVR
     A                                      SFLCSRRRN(&SCCURSOR3)
     A  30                                  SFLDSP
     A  31                                  SFLDSPCTL
     A  32                                  SFLCLR
     A N32                                  SFLEND(*PLUS)
     A            CURREC        10A  H
     A            CURFLD        10A  H
     A            CURPOS         4S 0H
     A            SCCURSOR3      5S 0H      TEXT('CURSOR')
     A            ROW3           3S 0H
     A            COL3           3S 0H
     A            SCRCDNBR3      4S 0H      SFLRCDNBR(CURSOR)
      **************************************************************************
     A          R EMPTY1
     A                                      OVERLAY
     A                                  6  7'Issue:'
     A                                  6 14'No records selected...'
     A                                      COLOR(WHT)
      **************************************************************************
     A          R EMPTY2
     A                                      OVERLAY
     A                                 12  7'Cause:'
     A                                 12 14'No records selected...'
     A                                      COLOR(WHT)
      **************************************************************************
     A          R EMPTY3
     A                                      OVERLAY
     A                                 18  2'Correction:'
     A                                 18 14'No records selected...'
     A                                      COLOR(WHT)
     A**************************************************************************
     A          R FOOTER
     A            SCFKEY        79A  O 23  2COLOR(BLU)
     A            SCMSG         78A  O 24  2COLOR(WHT)
      **************************************************************************

 

 

// File Declarations
dcl-f WOICCMFM WorkStn UsrOpn InfDS(DspInfDS) IndDS(DspInDS)
               SFile(SUBFILE1:gwRRN1) SFile(SUBFILE2:gwRRN2) SFile(SUBFILE3:gwRRN3);

 

//   * Display Indicators
dcl-ds DspInDS;
       inSfl1Dsp ind pos(10);
       inSfl2Dsp ind pos(20);
       inSfl3Dsp ind pos(30);
       inSfl1DspCtl ind pos(11);
       inSfl2DspCtl ind pos(21);
       inSfl3DspCtl ind pos(31);
       inSfl1Clr ind pos(12);
       inSfl2Clr ind pos(22);
       inSfl3Clr ind pos(32);
       inSfl1NxtChg ind pos(13);
       inSfl2NxtChg ind pos(23);
       inSfl3NxtChg ind pos(33);
       inUpdFields ind pos(40);
end-ds;    

 

gwRRN1 = *Zero;
gwRRN2 = *Zero;
gwRRN3 = *Zero;

gwLastRRN1 = *Zero;
gwLastRRN2 = *Zero;
gwLastRRN3 = *Zero;

SCCURSOR1 = 1;
SCCURSOR2 = 1;
SCCURSOR3 = 1;

inSfl1Dsp = *Off;
inSfl2Dsp = *Off;
inSfl3Dsp = *Off;

inSfl1DspCtl = *Off;
inSfl2DspCtl = *Off;
inSfl3DspCtl = *Off;

inSfl1Clr = *On;
inSfl2Clr = *On;
inSfl3Clr = *On;

Write CONTROL1;
Write CONTROL2;
Write CONTROL3;

inSfl1Dsp = *On;
inSfl2Dsp = *On;
inSfl3Dsp = *On;

inSfl1DspCtl = *On;
inSfl2DspCtl = *On;
inSfl3DspCtl = *On;

inSfl1Clr = *Off;
inSfl2Clr = *Off;
inSfl3Clr = *Off; 

<CODE TO BUILD SUBFILES>

 Write FOOTER;

  Write CONTROL3;

  Write CONTROL2;
  Exfmt CONTROL1;
  Read CONTROL2;
  Read CONTROL3;                    

 

                                                                                         

 

Updated on 2019-09-18T17:56:27Z at 2019-09-18T17:56:27Z by Kevin__Davis