ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Another display file window problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Another display file window problem

    Having never played about with windowed subfile programs before, I thought I'd give it a go.

    I use a program generator to create my base display file code then 'hack' about with it after there.

    My DDS appears to be fine, compiling correctly and looking as I would expect when viewed with SDA, however, when I call my program I get a session/device error when reading from my header format.

    Can anyone give me any ideas as I am at a loss here (sorry for the messy code, haven't got round to tidying up the commented out bits yet.)

    Code:
    0001  * Display File: MMHELP Maximise Help Text Display
    0002  * Source Code Created on 2006/03/06 at 16:00:39 by User LOMASC
    0003  *
    0004  * Standard Indicator Usage :-
    0005  *  01 - Response indicator for all command keys
    0006  *  02 - Format level Change Ind (Any data on Subfile - not option field)
    0007  *  03 - Set SFLNXTCHG on Subfile record write/update
    0008  *  04 - On = SFLCLR, Off = SFLDSP & SFLDSPCTL
    0009  *  05 - Reposition field change indicator
    0010  *  06 - Switch off HI, for empty sfl records
    0011  *  07 - General Protect on all Both type fields
    0012  *  08 - Switch on RI PC for all fields, used for file error reporting
    0013  *  09 - 19 Specific Format Protect iIndicators
    0014  *  20 > 99 Specific Field RI & PC indicators
    0015  *
    0016 A                                      CA03(01)
    0017 A                                      CA01(01)
    0018 A                                      CA05(01)
    0019 A                                      CA10(01)
    0020 A                                      CA12(01)
    0021 A                                      CA14(01)
    0022 A                                      PRINT
    0023 A                                      CHGINPDFT(UL)
    0024 A                                      HELP(01)
    0025 A                                      DSPSIZ(24 80)
    0026 A          R CLEARDISP
    0027 A                                      ASSUME KEEP
    0028 A                                  1  2' '
    0029 A          R HD
    0030 A                                      CLRL(*NO)
    0031 A                                      OVERLAY
    0032 A                                      PUTOVR
    0033 A                                      BLINK
    0034 A                                      CHANGE(02)
    0035 A                                      CSRLOC(UGCRLINE UGCRCOLUMN)
    0036 A                                      RTNCSRLOC(&UGCRFORMAT &UGCRFIELD +
    0037 A                                                &UGCRFLDPOS)
    0038  *
    0039 A            UGCRLINE       3S 0H      TEXT('Returned Cursor Line')
    0040 A            UGCRCOLUMN     3S 0H      TEXT('Returned Cursor Column')
    0041 A            UGCRFORMAT    10A  H      TEXT('Cursor in Format')
    0042 A            UGCRFIELD     10A  H      TEXT('Cursor in Field')
    0043 A            UGCRFLDPOS     4S 0H      TEXT('Cursor in Field Position')
    0044 A            HDHIDSFD  R        H      REFFLD(HIDSFD MMHLPI)
    0045 A            HDHIDSPF  R        H      REFFLD(HIDSPF MMHLPI)
    0046 A            HDHIPROD  R        H      REFFLD(HIPROD MMHLPI)
    0047 A            HDHIREF#  R        H      REFFLD(HIREF# MMHLPI)
    0048 A            HDHITOCD  R        H      REFFLD(HITOCD MMHLPI)
    0049 A            HOHIDSFD  R        H      REFFLD(HDHIDSFD *SRC)
    0050 A            HOHIDSPF  R        H      REFFLD(HDHIDSPF *SRC)
    0051 A            HOHIPROD  R        H      REFFLD(HDHIPROD *SRC)
    0052 A            HOHIREF#  R        H      REFFLD(HDHIREF# *SRC)
    0053 A            HOHITOCD  R        H      REFFLD(HDHITOCD *SRC)
    0054 A            HDINDS        99A  H      TEXT('Indicator save area')
    0055 A            HDRRN          9S 0H      TEXT('RRN of DB Record')
    0056 A                                  2  2SYSNAME
    0057 A                               O  1 13' Maximise '
    0058 A                                      DSPATR(RI)
    0059 A                               O  1 59' Maximise '
    0060 A                                      DSPATR(RI)
    0061 A                                  1 71DATE EDTCDE(Y)
    0062 A            UGPROGRAM     10   O  1  2
    0063 A            UGPGMLIB      10   O  2 70
    0064 A                               O  2 26'Maximise Help Syste+
    0065 A                                      m Display'
    0066 A                                      DSPATR(HI UL)
    0067  *
    0068 A          R SFL
    0070CA**************************************CLRL(*NO)
    0071 A                                      SFL
    0072 A  03                                  SFLNXTCHG
    0073  *
    0074 A            FDHLREF#  R        H      REFFLD(HLREF# MMHLPT)
    0075 A            FDHLSEQ#  R        H      REFFLD(HLSEQ# MMHLPT)
    0076 A            FDHLSORO  R        H      REFFLD(HLSORO MMHLPT)
    0077 A            FDHLTYPE  R        H      REFFLD(HLTYPE MMHLPT)
    0078 A            FDHLPROD  R        H      REFFLD(HLPROD MMHLPT)
    0079 A            FOHLREF#  R        H      REFFLD(FDHLREF# *SRC)
    0080 A            FOHLSEQ#  R        H      REFFLD(FDHLSEQ# *SRC)
    0081 A            FOHLSORO  R        H      REFFLD(FDHLSORO *SRC)
    0082 A            FOHLTYPE  R        H      REFFLD(FDHLTYPE *SRC)
    0083 A            FOHLPROD  R        H      REFFLD(FDHLPROD *SRC)
    0084 A            SFLRLC         1A  H      TEXT('Reposition Requested')
    0085 A            SFLINDS       99A  H      TEXT('Indicator save area')
    0086 A            SFLSFC         1A  H      TEXT('Data Changed Flag')
    0087 A            SFLRRN         9S 0H      TEXT('RRN of DB Record')
    0088 A            SFLWRN         1A  H      TEXT('Warning Issued Flag')
    0089 A            SFLOPT         1A  H
    0091CA**06**********************************DSPATR(PC)
    0093CA            FDHLTEXT  R        O  2  1REFFLD(HLTEXT MMHLPT)
    0094 A  08                                  DSPATR(RI PC)
    0095 A    N06N08                            DSPATR(HI)
    0096 A            FOHLTEXT  R        H      REFFLD(HLTEXT MMHLPT)
    0097  *
    0098 A          R SFC
    0100CA*********************************     CLRL(*NO)
    0101AA                                      WINDOW(7 18 8 40)
    0102 A                                      OVERLAY
    0103 A                                      SFLCTL(SFL)
    0104 A N04                                  SFLDSP
    0105 A N04                                  SFLDSPCTL
    0106 A  04                                  SFLCLR
    0107 A                                      SFLSIZ(0007)
    0108 A                                      SFLPAG(06)
    0109 A                                      ROLLUP
    0110 A                                      ROLLDOWN
    0111 A                                      BLINK
    0112 A                                      SFLDROP(CF11)
    0113 A                                      SFLMODE(&SFLMODE)
    0114 A                                      CHANGE(02)
    0115 A                                      CSRLOC(UGCRLINE UGCRCOLUMN)
    0116 A                                      RTNCSRLOC(&UGCRFORMAT &UGCRFIELD +
    0117 A                                                &UGCRFLDPOS)
    0118  *
    0119 A            SFCSRN         4S 0H      SFLRCDNBR
    0120 A            SFLMODE        1A  H
    0121 A            UGCRLINE       3S 0H      TEXT('Returned Cursor Line')
    0122 A            UGCRCOLUMN     3S 0H      TEXT('Returned Cursor Column')
    0123 A            UGCRFORMAT    10A  H      TEXT('Cursor in Format')
    0124 A            UGCRFIELD     10A  H      TEXT('Cursor in Field')
    0125 A            UGCRFLDPOS     4S 0H      TEXT('Cursor in Field Position')
    0126 A            SFCINDS       99A  H      TEXT('Indicator save area')
    0127 A            SFCRRN         9S 0H      TEXT('RRN of DB Record')
    0128 A          R TR
    0129 A                                      CLRL(*NO)
    0130 A                                      OVERLAY
    0131 A                                      PUTOVR
    0132 A                                      BLINK
    0133 A                                      CHANGE(02)
    0134 A                                      CSRLOC(UGCRLINE UGCRCOLUMN)
    0135 A                                      RTNCSRLOC(&UGCRFORMAT &UGCRFIELD +
    0136 A                                                &UGCRFLDPOS)
    0137 A                                      CF02
    0138 A                                      CF04
    0139 A                                      CF06
    0140 A                                      CF07
    0141 A                                      CF08
    0142 A                                      CF09
    0143 A                                      CF11
    0144 A                                      CF13
    0145 A                                      CF15
    0146 A                                      CF16
    0147 A                                      CF17
    0148 A                                      CF18
    0149 A                                      CF19
    0150 A                                      CF20
    0151 A                                      CF21
    0152 A                                      CF22
    0153 A                                      CF23
    0154 A                                      CF24
    0155  *
    0156 A            UGCRLINE       3S 0H      TEXT('Returned Cursor Line')
    0157 A            UGCRCOLUMN     3S 0H      TEXT('Returned Cursor Column')
    0158 A            UGCRFORMAT    10A  H      TEXT('Cursor in Format')
    0159 A            UGCRFIELD     10A  H      TEXT('Cursor in Field')
    0160 A            UGCRFLDPOS     4S 0H      TEXT('Cursor in Field Position')
    0161 A            TRINDS        99A  H      TEXT('Indicator save area')
    0162 A            TRRRN          9S 0H      TEXT('RRN of DB Record')
    0163 A                               O 23  2'F3=Exit'
    0164 A                               O 23 10'F12=Previous'
    0165  *
    0166 A          R SFLDC
    0168CA****************                      CLRL(*NO)
    0169 A                                      SFL
    0170 A  03                                  SFLNXTCHG
    0171  *
    0172 A            FDHLREF#  R        H      REFFLD(HLREF# MMHLPT)
    0173 A            FDHLSEQ#  R        H      REFFLD(HLSEQ# MMHLPT)
    0174 A            FDHLSORO  R        H      REFFLD(HLSORO MMHLPT)
    0175 A            FDHLTYPE  R        H      REFFLD(HLTYPE MMHLPT)
    0176 A            FDHLPROD  R        H      REFFLD(HLPROD MMHLPT)
    0177 A            FOHLREF#  R        H      REFFLD(FDHLREF# *SRC)
    0178 A            FOHLSEQ#  R        H      REFFLD(FDHLSEQ# *SRC)
    0179 A            FOHLSORO  R        H      REFFLD(FDHLSORO *SRC)
    0180 A            FOHLTYPE  R        H      REFFLD(FDHLTYPE *SRC)
    0181 A            FOHLPROD  R        H      REFFLD(FDHLPROD *SRC)
    0182 A            SFLDCRLC       1A  H      TEXT('Reposition Requested')
    0183 A            SFLDCINDS     99A  H      TEXT('Indicator save area')
    0184 A            SFLDCSFC       1A  H      TEXT('Data Changed Flag')
    0185 A            SFLDCRRN       9S 0H      TEXT('RRN of DB Record')
    0186 A            SFLDCWRN       1A  H      TEXT('Warning Issued Flag')
    0187 A            SFLDCOPT       1A  H
    0189CA**06**********************************DSPATR(PC)
    0190 A            FDHLTEXT  R        O  9  2REFFLD(HLTEXT MMHLPT)
    0191 A  08                                  DSPATR(RI PC)
    0192 A    N06N08                            DSPATR(HI)
    0193 A            FOHLTEXT  R        H      REFFLD(HLTEXT MMHLPT)
    0194  *
    0195 A          R SFCDCC
    0197CA************************              CLRL(*NO)
    0198 A                                      OVERLAY
    0199 A                                      SFLCTL(SFLDC)
    0200 A N04                                  SFLDSP
    0201 A N04                                  SFLDSPCTL
    0202 A  04                                  SFLCLR
    0203 A                                      SFLSIZ(0007)
    0204 A                                      SFLPAG(06)
    0205 A                                      ROLLUP
    0206 A                                      ROLLDOWN
    0207 A                                      BLINK
    0208 A                                      SFLDROP(CF11)
    0209 A                                      SFLMODE(&SFLMODE)
    0210 A                                      CHANGE(02)
    0211 A                                      CSRLOC(UGCRLINE UGCRCOLUMN)
    0212 A                                      RTNCSRLOC(&UGCRFORMAT &UGCRFIELD +
    0213 A                                                &UGCRFLDPOS)
    0214  *
    0215 A            SFCDCSRN       4S 0H      SFLRCDNBR
    0216 A            SFLMODE        1A  H
    0217 A            UGCRLINE       3S 0H      TEXT('Returned Cursor Line')
    0218 A            UGCRCOLUMN     3S 0H      TEXT('Returned Cursor Column')
    0219 A            UGCRFORMAT    10A  H      TEXT('Cursor in Format')
    0220 A            UGCRFIELD     10A  H      TEXT('Cursor in Field')
    0221 A            UGCRFLDPOS     4S 0H      TEXT('Cursor in Field Position')
    0222 A            SFCDCINDS     99A  H      TEXT('Indicator save area')
    0223 A            SFCDCRRN       9S 0H      TEXT('RRN of DB Record')
    0224 A                               O  8  2'Press Enter to Confirm Delete +
    0225 A                                      F12 to Change Choices' DSPATR(HI)
    0226 A          R SFLPU
    0228CA************************************  CLRL(*NO)
    0229 A                                      SFL
    0230 A  03                                  SFLNXTCHG
    0231  *
    0232 A            FDHLREF#  R        H      REFFLD(HLREF# MMHLPT)
    0233 A            FDHLSEQ#  R        H      REFFLD(HLSEQ# MMHLPT)
    0234 A            FDHLSORO  R        H      REFFLD(HLSORO MMHLPT)
    0235 A            FDHLTYPE  R        H      REFFLD(HLTYPE MMHLPT)
    0236 A            FDHLPROD  R        H      REFFLD(HLPROD MMHLPT)
    0237 A            FOHLREF#  R        H      REFFLD(FDHLREF# *SRC)
    0238 A            FOHLSEQ#  R        H      REFFLD(FDHLSEQ# *SRC)
    0239 A            FOHLSORO  R        H      REFFLD(FDHLSORO *SRC)
    0240 A            FOHLTYPE  R        H      REFFLD(FDHLTYPE *SRC)
    0241 A            FOHLPROD  R        H      REFFLD(FDHLPROD *SRC)
    0242 A            SFLPURLC       1A  H      TEXT('Reposition Requested')
    0243 A            SFLPUINDS     99A  H      TEXT('Indicator save area')
    0244 A            SFLPUSFC       1A  H      TEXT('Data Changed Flag')
    0245 A            SFLPURRN       9S 0H      TEXT('RRN of DB Record')
    0246 A            SFLPUWRN       1A  H      TEXT('Warning Issued Flag')
    0247 A            SFLPUOPT       1A  H
    0249CA**06**********************************DSPATR(PC)
    0250 A            FDHLTEXT  R        O  9  2REFFLD(HLTEXT MMHLPT)
    0251 A  08                                  DSPATR(RI PC)
    0252 A    N06N08                            DSPATR(HI)
    0253 A            FOHLTEXT  R        H      REFFLD(HLTEXT MMHLPT)
    0254  *
    0255 A          R SFCPUC
    0257CA*****************************         CLRL(*NO)
    0258 A                                      OVERLAY
    0259 A                                      SFLCTL(SFLPU)
    0260 A N04                                  SFLDSP
    0261 A N04                                  SFLDSPCTL
    0262 A  04                                  SFLCLR
    0263 A                                      SFLSIZ(0007)
    0264 A                                      SFLPAG(06)
    0265 A                                      ROLLUP
    0266 A                                      ROLLDOWN
    0267 A                                      BLINK
    0268 A                                      SFLDROP(CF11)
    0269 A                                      SFLMODE(&SFLMODE)
    0270 A                                      CHANGE(02)
    0271 A                                      CSRLOC(UGCRLINE UGCRCOLUMN)
    0272 A                                      RTNCSRLOC(&UGCRFORMAT &UGCRFIELD +
    0273 A                                                &UGCRFLDPOS)
    0274  *
    0275 A            SFCPUSRN       4S 0H      SFLRCDNBR
    0276 A            SFLMODE        1A  H
    0277 A            UGCRLINE       3S 0H      TEXT('Returned Cursor Line')
    0278 A            UGCRCOLUMN     3S 0H      TEXT('Returned Cursor Column')
    0279 A            UGCRFORMAT    10A  H      TEXT('Cursor in Format')
    0280 A            UGCRFIELD     10A  H      TEXT('Cursor in Field')
    0281 A            UGCRFLDPOS     4S 0H      TEXT('Cursor in Field Position')
    0282 A            SFCPUINDS     99A  H      TEXT('Indicator save area')
    0283 A            SFCPURRN       9S 0H      TEXT('RRN of DB Record')
    0284 A          R MESSAGESFL                SFL
    0285 A                                      SFLMSGRCD(24)
    0286 A            UGMSGKEY                  SFLMSGKEY
    0287 A            UGPGMQ                    SFLPGMQ
    0288 A          R MESSAGECTL                SFLCTL(MESSAGESFL)
    0289 A                                      OVERLAY
    0290 A                                      SFLDSP
    0291 A                                      SFLDSPCTL
    0292 A                                      SFLINZ
    0293 A  99
    0294 AON99                                  SFLEND
    0295 A                                      SFLSIZ(10)
    0296 A                                      SFLPAG(1)
    0297 A                                      CSRLOC(UGCRLINE UGCRCOLUMN)
    0298 A            UGCRLINE       3S 0H
    0299 A            UGCRCOLUMN     3S 0H
    0300 A            UGPGMQUEUE                SFLPGMQ

  • #2
    Re: Another display file window problem

    Did you turn on your indicators when viewing it through SDA?
    Never trust a dog to watch your food.

    Comment


    • #3
      Re: Another display file window problem

      Im not seeing a window just a regular subfile.

      This error usually means one of many things

      your RRN = *zeros
      the subfile display indicator is *OFF
      the window format has not been written before exfmt of the subfile control.

      can you show us more of the error...

      dspjoblog then <F10> <F5> <F18>
      then <F1> on the line in error

      jamie
      All my answers were extracted from the "Big Dummy's Guide to the As400"
      and I take no responsibility for any of them.

      www.code400.com

      Comment


      • #4
        Re: Another display file window problem

        Yep I tried that Sbp0718... I tried selecting the HD format and then the SFL + SFC formats and the window part doesnt show, I guess there is some conflict between the formats, but I can't pin it down (again this could be me being stupid).

        Comment


        • #5
          Re: Another display file window problem

          Here is the error...

          Message ID . . . . . . : RNQ1255 Severity . . . . . . . : 99
          Message type . . . . . : Inquiry
          Date sent . . . . . . : 06/03/06 Time sent . . . . . . : 16:43:10

          Message . . . . : Session or device error occurred in file MMHELP (C G D F).
          Cause . . . . . : RPG procedure MMHELP in program MAXWORK/MMHELP at
          statement 622 detected a session or device error. Recovery may be possible.
          Examine the major/minor return code value to determine the specific error
          that occurred. If the major return code is 82 then the error occurred while
          acquiring a session or device. If the major return code is 83 then the error
          occurred during an I/O operation and the session or device is still active.
          Recovery . . . : Check the job log for more information on the cause of the
          error and contact the person responsible for program maintenance.
          Possible choices for replying to message . . . . . . . . . . . . . . . :
          D -- Obtain RPG formatted dump.
          S -- Obtain system dump.
          G -- Continue processing at *GETIN.
          C -- Cancel.
          F -- Obtain full formatted dump.
          Technical description . . . . . . . . : The major return code is 83. The
          minor return code is E0.

          Comment


          • #6
            Re: Another display file window problem

            Forgot to add - statement 622 is where I read my HD format in the RPG program

            Comment


            • #7
              Re: Another display file window problem

              A R Sfc SFLCTL(sfl)

              I dont see your control record referencing the subfile on line 98.

              also your subfile display and subfilecontrol display are on all the time.
              (*in04) id pick a larger indicator thats not a function key (*in25 +)

              but if there are no records in the subfile and RRN = *zeros this error will be generated.

              I dont think its the header that the issue to test this just dont write it in the RPG and check...please

              jamie
              All my answers were extracted from the "Big Dummy's Guide to the As400"
              and I take no responsibility for any of them.

              www.code400.com

              Comment


              • #8
                Re: Another display file window problem

                Originally posted by jamief
                A R Sfc SFLCTL(sfl)

                I dont see your control record referencing the subfile on line 98.
                Take a look at line 103

                Originally posted by jamief

                also your subfile display and subfilecontrol display are on all the time.
                (*in04) id pick a larger indicator thats not a function key (*in25 +)

                but if there are no records in the subfile and RRN = *zeros this error will be generated.

                I dont think its the header that the issue to test this just dont write it in the RPG and check...please

                jamie
                OK I'll go do some more playing about, may come back bald as I've pulled a lot of hair out already

                Comment


                • #9
                  Re: Another display file window problem

                  Ok I commented out the write of the HD and I still get the error. So I set about testing your theory of no records in the subfile..

                  You were right in saying there were no records in the displayed subfile, however, I added some records to the file and tried again, I get the exact same error

                  Comment


                  • #10
                    Re: Another display file window problem

                    Your going to have to add it to your program if RRN = *zeros

                    eval RRN +=1 write subfile

                    then see what happens......

                    just cause they are in the file doesnt mean they are being loaded by your rpg program.
                    I know you already know this,,,,,

                    jamie
                    All my answers were extracted from the "Big Dummy's Guide to the As400"
                    and I take no responsibility for any of them.

                    www.code400.com

                    Comment


                    • #11
                      Re: Another display file window problem

                      I ran the program in debug, and at the time of writing the subfile the RRN is 1.. I'm going to unconvert my window to a normal screen and just check it works that way (at least so I know I'm not going crazy).

                      Comment


                      • #12
                        Re: Another display file window problem

                        Ok I changed it to a normal subfile program - everything works fine... I add the WINDOW(7 18 8 40) keyword to my SFC format and change the display positioners of me field on the subfile from 9 2 to 2 1 and it all goes bottom up.

                        Am I being a complete muppet (I won't take offence if you say yes).

                        Gah I give up for today, I'm going to go home and shout at some young kids I think!

                        Comment


                        • #13
                          Re: Another display file window problem

                          Jamie,

                          Do you see a dummy record I'm not.
                          Never trust a dog to watch your food.

                          Comment


                          • #14
                            Re: Another display file window problem

                            Your not.............I typically create a seperate format with the WINDOW specifications on it.. called like FMT1

                            then in my control record I use the WINDOW keyword

                            WINDOW(FMT1)

                            like this
                            All my answers were extracted from the "Big Dummy's Guide to the As400"
                            and I take no responsibility for any of them.

                            www.code400.com

                            Comment


                            • #15
                              Re: Another display file window problem

                              he calls his dummy CLEARDISP
                              All my answers were extracted from the "Big Dummy's Guide to the As400"
                              and I take no responsibility for any of them.

                              www.code400.com

                              Comment

                              Working...
                              X