ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

more than one field in the same position in subfile record format

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

  • more than one field in the same position in subfile record format

    Hi All,

    Well i am not at all good with subfiles. I am doing an RnD in an application which deals with a subfile program.
    In this subfile record format more than 3 fields are defined at the same position. Of course only one is displayed at a given time. But you have an option to press a function key to toggle between the three fields - meaning, press F11 and the next field is displayed with different set of records, again press F11 and 3rd field is displayed. i am not able to find how this has been done (while creating the DDS).


    Keyword Indicators/+ Resp Text
    CA11 11 F11=ALT VIEW

    Code:
    OLO           10A  B  4 67               
                              DSPATR(RI)     
                              DSPATR(MDT)    
                          4 50'VA Loan#.....'
    VLO           12A  B  4 67               
                              DSPATR(RI)     
                              DSPATR(MDT)    
                          4 50'Close Date...'
    CDT            8Y 0B  4 67

    any help please.
    TIA
    Regards,
    Ruma

  • #2
    Re: more than one field in the same position in subfile record format

    Well I would like to see more of the DDS....I would expect there to be indicators on the far left.. I dont see them here.

    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


    • #3
      Re: more than one field in the same position in subfile record format

      yes u r right Jamie,

      Code:
      51                              4 50'O Loan#...
      51        OLO           10A  B  4 67               
      30                                  DSPATR(RI)     
      30                                  DSPATR(MDT)    
      52                              4 50'VA Loan#.....'
      52        VLO           12A  B  4 67               
      30                                  DSPATR(RI)     
      30                                  DSPATR(MDT)    
      53                              4 50'Close Date...'
      53        CDT            8Y 0B  4 67               
      30                                  DSPATR(RI)     
      30                                  DSPATR(MDT)
      Regards,
      Ruma

      Comment


      • #4
        Re: more than one field in the same position in subfile record format

        I would say that you need to look into the RPG for the answer.
        what is happening is something like this.



        Code:
        When *in11 = *On
        
        select
        when *in51
        eval *in51 = *off
        eval *in52 = *on
        eval *in53 = *off
        
        when *in52
        eval *in51 = *off
        eval *in52 = *off
        eval *in53 = *on
        
        when *in53
        eval *in51 = *on
        eval *in52 = *off
        eval *in53 = *off
        
        endsl
        When the indicator for the field is *on it displays if its *off its as if it doesnt exist.

        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


        • #5
          Re: more than one field in the same position in subfile record format

          You may also want to change the indicators on your attribute fields to either match to the display fields or use unique indicators altogether.

          I sent Jamie some code where you can control the display attribute using hidden fields. Except it wont work with the MDT.
          Never trust a dog to watch your food.

          Comment


          • #6
            Re: more than one field in the same position in subfile record format

            Jamie:
            Yes thats exactly what is happening in the RPG. So does that mean that if 'field indicator' is set off, then that field is not displayed on the screen?
            Regards,
            Ruma

            Comment


            • #7
              Re: more than one field in the same position in subfile record format

              Originally posted by Sbp0718
              You may also want to change the indicators on your attribute fields to either match to the display fields or use unique indicators altogether.

              I sent Jamie some code where you can control the display attribute using hidden fields. Except it wont work with the MDT.
              could you please send it to me too?
              Regards,
              Ruma

              Comment


              • #8
                Re: more than one field in the same position in subfile record format

                Yes if *on it displays if *off it will not show



                Happy friday
                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


                • #9
                  Re: more than one field in the same position in subfile record format

                  Thanks
                  Happy weekend
                  Regards,
                  Ruma

                  Comment


                  • #10
                    Re: more than one field in the same position in subfile record format

                    Code:
                            * A snap shot of the screen file.
                         A                                      DSPSIZ(24 80 *DS3)
                         A                                      CA03
                         A                                      CA06
                         A          R I5541081                  TEXT('Header Record 1')
                    	*
                         A                                      OVERLAY
                         A                                  1 28'Enter Branch'
                         A                                  3  2'Branch'
                         A            BRANCH        12   B  3  9DSPATR(&BRANCHATTR)
                         A            BRANCHATTR     1   P    
                    	*
                         A          R I5541082                  TEXT('Bottom Line')
                         A                                      OVERLAY
                         A            MSGLINE       78   O 24  2DSPATR(&MSGLINEATT)
                         A            MSGLINEATT     1   P          
                    
                          // Copy book of display attributes
                    
                    	// Will not work for MDT (Set changed data tag when displayed), 
                     	//                   OID (Operator identification), 
                    	//                   PC (Position Cursor) or 
                    	//                   SP (Select by light pen)
                    
                          // Valid P-field values Non-protected for display files
                          // Ledgend: Bl - Blink, Cs - Column separator, HI - High intensity,
                          //          RI - Revers image, and Un - Underscore
                    
                          // Colors: B - Blue, G - Green, R - Red, P - Pink, T - Turquoise,
                          //         W - White, and Y - Yellow
                    
                    	// Non protected fields.
                    
                         D NP_Normal       c                   x'20'                                Green
                         D NP_RI           c                   x'21'                                Green
                         D NP_HI           c                   x'22'                                White
                         D NP_HI_RI        c                   x'23'                                White
                         D NP_Un           c                   x'24'                                Green
                         D NP_Un_RI        c                   x'25'                                Green
                         D NP_Un_HI        c                   x'26'                                White
                         D NP_Nondisplay1  c                   x'27'                                Nondisplay
                         D NP_Bl           c                   x'28'                                Red
                         D NP_Bl_RI        c                   x'29'                                Red
                         D NP_Bl_HI        c                   x'2A'                                Red
                         D NP_Bl_HI_RI     c                   x'2B'                                Red
                         D NP_Bl_Un        c                   x'2C'                                Red
                         D NP_Bl_Un_RI     c                   x'2D'                                Red
                         D NP_Bl_Un_HI     c                   x'2E'                                Red
                         D NP_Nondisplay2  c                   x'2F'                                Non display
                         D NP_Cs           c                   x'30'                                Turquoise
                         D NP_RI_Cs        c                   x'31'                                Turquoise
                         D NP_HI_Cs        c                   x'32'                                Turquoise
                         D NP_HI_RI_Cs     c                   x'33'                                Turquoise
                         D NP_Un_Cs        c                   x'34'                                Turquoise
                         D NP_Un_RI_Cs     c                   x'35'                                Turquoise
                         D NP_Un_HI_Cs     c                   x'36'                                Turquoise
                         D NP_Nondisplay3  c                   x'37'                                Nondisplay
                         D NP_Bl_Cs        c                   x'38'                                Pink
                         D NP_Bl_RI_Cs     c                   x'39'                                Pink
                         D NP_Bl_HI_Cs     c                   x'3A'                                Blue
                         D NP_Bl_HI_RI_Cs  c                   x'3B'                                Blue
                         D NP_Bl_Un_Cs     c                   x'3C'                                Pink
                         D NP_Bl_Un_RI_Cs  c                   x'3D'                                Pink
                         D NP_Bl_Un_HI_Cs  c                   x'3E'                                Pink
                         D NP_Nondisplay4  c                   x'3F'                                Nondisplay
                    
                    
                          // Valid P-field values for Protected display files
                         D P_Normal        c                   x'A0'                                Green
                         D P_RI            c                   x'A1'                                Green
                         D P_HI            c                   x'A2'                                White
                         D P_HI_RI         c                   x'A3'                                White
                         D P_Un            c                   x'A4'                                Green
                         D P_Un_RI         c                   x'A5'                                Green
                         D P_Un_HI         c                   x'A6'                                White
                         D P_Nondisplay1   c                   x'A7'                                Nondisplay
                         D P_Bl            c                   x'A8'                                Red
                         D P_Bl_RI         c                   x'A9'                                Red
                         D P_Bl_HI         c                   x'AA'                                Red
                         D P_Bl_HI_RI      c                   x'AB'                                Red
                         D P_Bl_Un         c                   x'AC'                                Red
                         D P_Bl_Un_RI      c                   x'AD'                                Red
                         D P_Bl_Un_HI      c                   x'AE'                                Red
                         D P_Nondisplay2   c                   x'AF'                                Non display
                         D P_Cs            c                   x'B0'                                Turquoise
                         D P_RI_Cs         c                   x'B1'                                Turquoise
                         D P_HI_Cs         c                   x'B2'                                Turquoise
                         D P_HI_RI_Cs      c                   x'B3'                                Turquoise
                         D P_Un_Cs         c                   x'B4'                                Turquoise
                         D P_Un_RI_Cs      c                   x'B5'                                Turquoise
                         D P_Un_HI_Cs      c                   x'B6'                                Turquoise
                         D P_Nondisplay3   c                   x'B7'                                Nondisplay
                         D P_Bl_Cs         c                   x'B8'                                Pink
                         D P_Bl_RI_Cs      c                   x'B9'                                Pink
                         D P_Bl_HI_Cs      c                   x'BA'                                Blue
                         D P_Bl_HI_RI_Cs   c                   x'BB'                                Blue
                         D P_Bl_Un_Cs      c                   x'BC'                                Pink
                         D P_Bl_Un_RI_Cs   c                   x'BD'                                Pink
                         D P_Bl_Un_HI_Cs   c                   x'BE'                                Pink
                         D P_Nondisplay4   c                   x'BF'                                Nondisplay    
                    
                    	 // Basic Code
                         FV5541080  cf   E             workstn InfDS(Ws_Ds) 
                            
                         D error           s               n   inz('0') 		    
                         D msgBranch       c                   'Enter the Branch Plant  F3 = Exit'
                         D msgBranchInv    c                   'The branch is invalid.  Please re-
                         D                                     enter.  F3 = Exit'
                         D msgF3Exit       c                   'F3 = Exit'                                
                    
                           // if the default branch doesn't exist then have the user enter it on
                           msgLine = msgBranch;
                           msgLineAtt = P_HI;
                           branchAttr = Np_Un;
                           dou dfltBranch <> *blanks and error = *off;
                    
                             error = *off;
                    
                             write I5541082;
                             exfmt I5541081;
                    
                             if cmd_Key = F3;
                               *inlr = *on;
                               return;
                             endIf;
                    
                             evalR branch = %trim(branch);
                             evalr dfltBranch = branch;
                    
                             if dfltBranch = *blanks;
                               iter;
                             endIf;
                    
                             // verify that the branch entered is valid
                             error = verifyBranch(dfltBranch);
                    
                             if error;
                               msgLine = msgBranchInv;
                               msgLineAtt = P_Hi;
                               branchAttr = Np_Un_RI;
                             endIf;
                    
                           endDo;
                    Never trust a dog to watch your food.

                    Comment


                    • #11
                      Re: more than one field in the same position in subfile record format

                      Thanks Sbp0718
                      Regards,
                      Ruma

                      Comment

                      Working...
                      X