ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Multiple Display File

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

  • Multiple Display File

    Hi,

    I want to display records from two different display files at a time on the screen, below is the code I used n its not working. could someone tell what m missing. thanks.

    HeaderD
    Code:
         A                                      DSPSIZ(24 80 *DS3)                  
         A          R HEADER                                                        
         A                                      ASSUME                              
         A                                      KEEP                                
         A                                      OVERLAY                             
         A                                  4  6'this is the header from - headerd -
         A                                      file'
    FooterD
    Code:
         A                                      DSPSIZ(24 80 *DS3)                  
         A          R FOOTER                                                        
         A                                      OVERLAY                             
         A                                 11  6'this is the FOOTER from - footerD -
         A                                      file'
    RPGLE Code
    Code:
         FheaderD   CF   E             WorkStn                              
         FfooterD   CF   E             WorkStn                              
                                                                            
         C                   Write     header                               
         C                   Write     footer                               
         C                   Read      footer                               
         C                   SetOn                                        LR

  • #2
    Re: Multiple Display File

    Hi Kishor:

    I think you want 2 different display formats not 2 different display files:

    MYDSPLY:

    Code:
         A                                      DSPSIZ(24 80 *DS3)                  
         A          R HEADER                                                        
         A                                      ASSUME                              
         A                                      KEEP                                
         A                                      OVERLAY                             
         A                                  4  6'this is the header from - headerd -
         A                                      file'                
         A          R FOOTER                                                        
         A                                      OVERLAY                             
         A                                 11  6'this is the FOOTER from - footerD -
         A                                      file'
    Code:
         FMydsply  CF   E             WorkStn                              
                           
                                                                            
         C                   Write     header                               
         C                   Write     footer                               
         C                   Read      footer                               
         C                   SetOn                                        LR
    Why not use free-form


    Code:
         FMydsply  CF   E             WorkStn                              
                           
           /free                                                                 
                            Write     header ;                              
                            Write     footer  ;                             
                            Read      footer ;                              
                            *inlr = *on;
          /end-free
    Best of Luck
    GLS
    The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

    Comment


    • #3
      Re: Multiple Display File

      Hi GLS... m sure that I want two different display files

      Comment


      • #4
        Re: Multiple Display File

        You would have to put them in windows.
        Regards

        Kit
        http://www.ecofitonline.com
        DeskfIT - ChangefIT - XrefIT
        ___________________________________
        There are only 3 kinds of people -
        Those that can count and those that can't.

        Comment


        • #5
          Re: Multiple Display File
          • Remove the ASSUME, KEEP and OVERLAY keywords from HEADERD. This screen is displayed first, and therefore, you don't want it to overlay everything. (If you made it overlay, it'd show whatever happened to be on the screen before your program was called...)
          • Add a new record to FOOTERD. This is a record that will never be used -- most people name it 'DUMMY'. It should consist only of the ASSUME keyword -- but that would create an error (no fields) so you also have to print something, usually I put a blank somewhere on the screen. What you print doesn't matter since this record will never be written.


          HEADERD:
          Code:
               A                                      DSPSIZ(24 80 *DS3)        
               A          R HEADER                                              
               A                                      FRCDTA                    
               A                                  4  6'this is the header from -
               A                                      file'
          FOOTERD:
          Code:
               A                                      DSPSIZ(24 80 *DS3)        
               A          R FOOTER                                              
               A                                      OVERLAY                   
               A                                 11  6'this is the FOOTER from -
               A                                      file'                     
               A          R DUMMY                                               
               A                                      ASSUME                    
               A                                  2  2' '
          The ASSUME keyword does two things: (1) It assumes that the output data is already on the display (so nothing in an ASSUME record format is written to the display). This is why it's put into it's own "dummy" record format. (2) It prevents the screen from being cleared when the display file is open -- since this affects the whole file, it doesn't matter where the ASSUME keyword is coded.

          I'm not sure this will work with two consecutive WRITEs, though. You may have to change the RPG code to do an EXFMT. This is a very weird scenario you've created...

          Comment

          Working...
          X