AS/400 Display Files Not Retaining Last Window

1780 pts.
Tags:
AS/400 - DDS
AS/400 Display File
Display File
So I have used this “dummy record many times before. Now with a new program/dds it will not.. Could it be b/c my new program is defined DSPSIZ(27 132 *DS4) and the program calling the new programs display size is DSPSIZ(24 80 *DS3)… 
i need the calling program 80 column screen to stay while I call the 132 program screen.
So is this the problem and is there anyway around it? Please help ASAP. Thanks

Answer Wiki

Thanks. We'll let you know when a new response is added.

Talked to IBM.. This can not be done I guess.. I find it hard to believe it.. You can do anything on the 400….

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Sloopy
    Yes, you can do (almost) anything on the iSeries, but writing a 132-column window onto an 80-column screen is not one of those things! However, if you specify two screen sizes in your DDS, one for 132-column and the other for 80-column, you can do it. To set the conditioning indicator for the right one, either pass a parameter telling the window program which one to use, or explicitly open the display file in the window program and check the file information data structure for the screen size (this does not always work properly!), OR set the 132-column condition first and monitor for an error. If error, you know you should write the 80-column format. I do have plenty of window programs, which I generate automatically. And getting to the point where they would have the required flexibility did take quite a lot of experimentation. But they are there now. Here is code for the DDS for a typical window (it contains a subfile, and you select a record by cursor position) :
    A                                       DSPSIZ(24 80 *NORMAL 27 132 *WIDE) 
    A                                       REF(FRCODL5   )                    
    A                                       PRINT CLEAR HELP CHGINPDFT         
    A                                       CF01 CF02 CF03 CF04 CF05 CF06      
    A                                       CF07 CF08 CF09 CF10 CF11 CF12      
    A                                       CF13 CF14 CF15 CF16 CF17 CF18      
    A                                       CF19 CF20 CF21 CF22 CF23 CF24      
                                                                               
     * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
                                                                               
    A          R D@SF1                      SFL                                
    A                                       TEXT('Subfile')                    
    A            D#CHRG    R        B004001 REFFLD(FCCHRG)                     
    A N40                                   DSPATR(PR)                         
    A  40N70                                DSPATR(UL HI)                      
    A  40 70                                DSPATR(RI PC)                      
    A            D#CHNM    R        B004005 REFFLD(FCCHNM)                     
    A N40                                   DSPATR(PR)                         
    A  40N70                                DSPATR(UL HI)                      
    A  40 70                                DSPATR(RI PC)                      
                                                                              
    A            H#IN10         1   H       TEXT('Copy of Indicator 10')      
    A            H#IN12         1   H       TEXT('Copy of Indicator 12')      
    A            H#IN13         1   H       TEXT('Copy of Indicator 13')      
    A            H#RRN          9  0H       TEXT('RRN of database record')    
                                                                              
     * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
                                                                              
    A          R D@SF1C                     TEXT('Screen heading/selection')  
    A                                       WINDOW(D@WIN)                     
    A                                       SFLCTL(D@SF1)                     
    A                                       SFLSIZ(11)                        
    A                                       SFLPAG(10)                        
    A                                       SFLDSPCTL                         
    A    N14                                SFLCLR                            
    A     14                                SFLDSP                            
    A N15 14                                ROLLUP                            
    A  16                                   DSPMOD(*WIDE)                     
    A                                       OVERLAY                           
    A                                       SFLCSRRRN(&CRRN)                  
    A                                       RTNCSRLOC(*WINDOW &CROW &CCOL)     
    A                                       RTNCSRLOC(*RECNAME &CREC +         
    A                                                          &CFLD +         
    A                                                          &CINF   )       
                                                                               
    A            D1DRRN         4S 0H       SFLRCDNBR                          
    A            D1TRRN         5S 0H       SFLSCROLL                          
                                                                               
    A            CREC          10A  H       TEXT('Cursor record')              
    A            CFLD          10A  H       TEXT('Cursor field')               
    A            CROW           3S 0H       TEXT('Cursor row')                 
    A            CCOL           3S 0H       TEXT('Cursor column')              
    A            CINF           4S 0H       TEXT('Cursor in field')            
    A            CRRN           5S 0H       TEXT('Subfile cursor RRN')         
                                                                               
    A            PROW           3S 0H       TEXT('Place Cursor row')           
    A            PCOL           3S 0H       TEXT('Place Cursor column')        
                                                                               
    A            D£TITL     00022    001  1 DSPATR(&C#TITL)                    
    A            C#TITL         1A  P       TEXT('Set title colour')           
    A            H#CHRG     00003    002001 COLOR(BLU) DSPATR(UL)             
    A            H#CHNM     00018       + 1 COLOR(BLU) DSPATR(UL)             
    A            S#CHRG    R        B003001 REFFLD(FCCHRG) DSPATR(UL)         
                                            COLOR(WHT)                        
    A            S#CHNM    R        B003005 REFFLD(FCCHNM) DSPATR(UL)         
                                                                              
     * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
                                                                              
     * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
                                                                              
    A          R D@FOOT                     TEXT('Footer')                    
    A                                       WINDOW(D@WIN)                     
    A  16                                   DSPMOD(*WIDE)                     
    A                                       OVERLAY                           
    A                                       RTNCSRLOC(*WINDOW &CROW &CCOL)    
    A                                       RTNCSRLOC(*RECNAME &CREC +        
    A                                                          &CFLD +        
    A                                                          &CINF   )      
                                                                              
    A            CREC          10A  H       TEXT('Cursor record')             
    A            CFLD          10A  H       TEXT('Cursor field')               
    A            CROW           3S 0H       TEXT('Cursor row')                 
    A            CCOL           3S 0H       TEXT('Cursor column')              
    A            CINF           4S 0H       TEXT('Cursor in field')            
                                                                               
    A            PROW           3S 0H       TEXT('Place Cursor row')           
    A            PCOL           3S 0H       TEXT('Place Cursor column')        
                                                                               
    A            ##FOOT     00022    014  1 DSPATR(&C#FOOT)                    
    A            C#FOOT         1A  P       TEXT('Set footer colour')          
                                                                               
     * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
                                                                               
     * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
                                                                               
    A          R D@WIN                      TEXT('Overlaying window')          
    A                                       RMVWDW                             
    A  16                                   DSPMOD(*WIDE)                      
    A                                       OVERLAY                            
    A                                       WINDOW(&##PROW &##PCOL 014 22  +   
    A                                                            *NOMSGLIN +   
    A                                                            *NORSTCSR  )  
    A            ##PROW         3S 0P                                          
    A            ##PCOL         3S 0P                                          
                                                                               
     * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
                                                                               
     * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
                                                                               
    A          R D@NODATA                   TEXT('No data in subfile')         
    A                                       WINDOW(D@WIN)                      
    A  16                                   DSPMOD(*WIDE)                      
    A                                       OVERLAY                            
    A                                  8  2' '                                 
                                                                               
                                                                               
     * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
                                                                               
    A          R D@DUMMY                    TEXT('Dummy format')               
    A                                       KEEP ASSUME OVERLAY                
    A  01                             24  2' '                                 
    A  *WIDE                          27  2                                    
                                                                               
     * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
    
    In the program, use the screen information DS to get the number of columns:
    D ScreenInfDS     DS                   
    D  F#AIDB               369    369     
    D  F#COLS               154    155B 0
    
    If the value is 132, set *IN16 to *ON. Now when you write the screen it will write over a 132-column display. Otherwise it will write over an 80-column display. In this way of doing it, write the D@WIN format before any other, and only write it once (unless you have code to let the user move the window around the screen, which I have). Do your writes and EXFMTs in the screen loop, just like in any screen program:
     *MainLine                                           
    C                   Write     D@WIN                  
                                                         
    C                   DoU       Fkey = fnExit          
                                                         
    C                   If        p_ReturnCode = '*FIRST'
    C                   Eval      p_ReturnCode = *Blank  
    C                   ExSr      LoadScreen             
    C                   Eval      D1DRRN = 1             
    C                   EndIf                            
                                                         
    C                   ExSr      SetLegend              
    C                   Write     D@FOOT                 
    C  N14              Write     D@NODATA               
    C                   ExFmt     D@SF1C                 
    
    The D@DUMMY format must be written just before you close the display file and exit the program. I hope this is some help to you.
    2,195 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following