ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Multiple Display Files

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

  • Multiple Display Files

    Hi all. This may be more appropriate to the DDS forums, not entirely sure.

    To make a long story short, I'm a student working on a group project, and coming from other languages, my instinct is to template things to standardize them.

    My idea was to use a display file that would contain a header and footer record format that my fellow groupmates would use, and that each program they did would also have a separate display file to incorporate the formats specific to their programs.

    However, putting this into practice has been frustrating at best.

    The header/footer display file (named HEADFOOT) has two formats, named HEADER and FOOTER. Footer is declared with OVERLAY.

    Another display file, named EXAMPLE, has one format (named MAINSCRN), also declared with OVERLAY.

    In trying to display these, how I would do it with a single display file would be:

    Write HEADER;
    Write FOOTER;
    Exfmt MAINSCRN;

    What actually occurs is that upon calling this program, the only thing visible on the screen is MAINSCRN - HEADER and FOOTER never appear. The desired behavior is for HEADER and FOOTER should print, followed by MAINSCRN which actually contains changeable fields.

    A lot of research has lead me to various things such as compiling with RSTDSP(*YES), the nebulous KEEP and ASSUME keywords, dummy record formats, and a lot more. Some of this information seems very dated, or is written in a very cryptic fixed format I can't seem to decipher. Is anyone able to help with this? I can post whatever code is necessary.

  • #2
    Re: Multiple Display Files

    Hi,

    you have to create one display file which conatin below record formats,
    HEADER
    FOOTER
    MAINSCAN
    then put overlay for record formats.

    Then Check with this,
    Write HEADER;
    Write FOOTER;
    Exfmt MAINSCRN;

    Thanks,
    Vishal.

    Comment


    • #3
      Re: Multiple Display Files

      Put the 3 formats all together in one single display file. The formats must never overlap on each other.


      PHP Code:
      __________________________
      HEADER
      .....................
      ..  .. ................
      __________________________
      MAINSCREEN
      ... ..................
      .............
      ...............
      ...  ............ ......
      __________________________
      FOOTER
      ...    ...    ... 
      __________________________ 
      If you cant come up with it feel free to paste here the display file DDS.
      Last edited by Mercury; April 22, 2010, 09:11 AM.
      Philippe

      Comment


      • #4
        Re: Multiple Display Files

        Because of the way display files work, this is not as easy and straightforward as it would appear. If you want a single display file for the header / footer, it could probably be done. At a very high level, you could do the following:

        1. Create an ile application that gets called into a named activation group and returned (but not terminated with LR), that controls the header / footer sections.

        2. Create another application that contains the main screen. (The main screen will likely have to be a window so that the it will not overlay the header / footer screen when it is written out.

        3. When you are ready to write a screen from an application, you need to send the info to some sort of holding area ( like a dataq) that the header / footer application will use to display the header / footer info. Then you need to signal the application to wake up (like using SIGTERM), write the header / footer info, send a response back to the main app stating that the process is completed, and then return.

        4. The main app waits on the header / footer application to complete, then writes out the main screen.


        Or, you could make your applications browser based, in which having standard header / footer areas is a LOT easier to set up.
        Michael Catalani
        IS Director, eCommerce & Web Development
        Acceptance Insurance Corporation
        www.AcceptanceInsurance.com
        www.ProvatoSys.com

        Comment


        • #5
          Re: Multiple Display Files

          Michael do you really think what you suggest is what the OP is looking for ?
          Philippe

          Comment


          • #6
            Re: Multiple Display Files

            Originally posted by Mercury View Post
            Michael do you really think what you suggest is what the OP is looking for ?
            He's looking for a way to use two display files. One display file sounds like it needs to be generic for headers / footers. (In other words, it needs to handle a header / footer for every program, without being changed or copied) For what he stated, he does NOT want to put the header / footer display file section in every application he writes. There is a very limited number of ways to pull this off.

            I'm not saying my way is the best.
            Michael Catalani
            IS Director, eCommerce & Web Development
            Acceptance Insurance Corporation
            www.AcceptanceInsurance.com
            www.ProvatoSys.com

            Comment


            • #7
              Re: Multiple Display Files

              After re-reading his post, it looks like he is ok with using multiple display files in the same program. I thought he was looking for a way to modularize the header/ footer screen.
              Michael Catalani
              IS Director, eCommerce & Web Development
              Acceptance Insurance Corporation
              www.AcceptanceInsurance.com
              www.ProvatoSys.com

              Comment


              • #8
                Re: Multiple Display Files

                I would possibly suggest to use ASSUME on header and footer so that they remain on the screen when mainscreen is written on the same screen. Using this technique formats could even overlap on each other.
                Philippe

                Comment


                • #9
                  Re: Multiple Display Files

                  I appreciate the responses so far.

                  The entire goal here is specifically to utilize two different display files - combining them into one defeats the purpose of this exercise.

                  Michael, your solution is probably outside my level of expertise at this point, and sadly the assignment is strictly limited to greenscreen, otherwise I'd have done this via a PHP/RPG mashup with template files and Smarty.

                  Mercury, I previously tried using ASSUME on MAINSCREEN - the info center seemed to suggest KEEP would have been used on HEADER and FOOTER, but this functionality didn't give me the intended result. I don't know if I tried using ASSUME on HEADER and FOOTER, but I'll give that a try and report back.

                  Comment


                  • #10
                    Re: Multiple Display Files

                    what is on the header & footer screens....

                    With the possibility of a footer having various combinations of function keys
                    and the header an even greater amount of possible options ......

                    Please expain more..

                    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: Multiple Display Files

                      I have INDARA, and CA03/CA12 turned on in the display file with HEADER and FOOTER.

                      HEADER consists of a single line of text (not a field) that says COMPANY NAME, as well as a date that reads *SYSDATE.

                      FOOTER consists of two lines; 23 has "F3=Exit, F12=Cancel", and 24 is a text field named MESSAGE 70 characters in length. FOOTER also has OVERLAY enabled upon it.

                      There are no other record-level keywords being used for either HEADER or FOOTER.

                      I have INDARA and CA03/CA12 turned on in the display file with MAINSCREEN

                      MAINSCREEN occupies the area between row 5 and row 21 - it contains a half dozen text fields of varying lengths (no subfiles or anything). OVERLAY is enabled for MAINSCREEN.


                      As you can see, for the purposes of trying to understand this issue, I stripped these display files down to the absolute basics to eliminate potential conflicts of keywords and such.

                      Comment


                      • #12
                        Re: Multiple Display Files

                        Other than the ASSUME on the header/footer DSPF, I don't see any way of getting this done using more than one DSPF.

                        Anyway, while the goal is standardisation (and minimal-repetition) of the header/footer coding, what can be done to partially achieve the same is:

                        In your DSPFs, use just one field each for the header and footer record formats.

                        In a new module (say, FetchHdFt) that can be bound to multiple programs (or using a subprocedure in a /COPY book), use two or more variables to store (if the text is the same across all your apps) or build (in case you have different displayed texts based on conditions) the header and footer texts.

                        In the program for any of your apps, just call that subprocedure and fill the results into your header and footer fields.

                        Finally, your program will have only
                        Code:
                        Write HEADER;
                        Write FOOTER;
                        Exfmt MAINSCRN;
                        â??No bird soars too high if he soars with his own wingsâ?? â?? William Blake

                        Comment

                        Working...
                        X