1,380 pts.
 AS400 Subfile position to fields
I haven't found the issue with this.

I have a subfile with 2 positioning fields on the sflctl rcdfmt. SFLCTL has the overlay keyword as does SFLHEAD. CMDKEY does not.

In the program, I build the sfl, write the cmdkey, write the sflhead, and exfmt sflctl. This works on another program.

This all works fine except that the 2 position to fields are not showing up. I can tab down to them and even enter data in them. They are defined as B for both input/output, no conditioning, no other fields/text on the same line. Any idears why they are not showing up?



Software/Hardware used:
ASKED: November 21, 2011  10:59 PM
UPDATED: March 6, 2012  6:15 PM

Answer Wiki:
I took out the CHGINPDFT on the file keywords. Note to self: don’t copy everything....
Last Wiki Answer Submitted:  November 21, 2011  11:13 pm  by  NickHutcheson1   1,380 pts.
All Answer Wiki Contributors:  NickHutcheson1   1,380 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

as does SFLHEAD

Out of curiosity, why do you have a SFLHEAD format? Why wouldn’t you simply use the SFLCTL format? What’s the benefit of using two formats instead of just one?

Tom

 107,735 pts.

 

Can you post the DDS Source?

 32,785 pts.

 

Tom, it seems that I tried that before and it didn’t work. I could give it another shot and refresh my memory as to why.

Charlie Brown, enjoy…

A                                      DSPSIZ(24 80 *DS3)
A****                                  CHGINPDFT         
A                                      PRINT             
A                                      CF01(01 'PROCEED')
A                                      CF07(07 'GO BACK')
A                                      CF12(12 'GO BACK')
A                                      CF24(84 'EXIT')   
A                                      ROLLUP            
A                                      ROLLDOWN          
A          R SFLRCD                    SFL                    
A*%%TS  SD  20111121  135705  NICKH       REL-V5R4M0  5722-WDS
A  94                                  SFLNXTCHG              
 * Line 1                                                     
A            FMSEL          1A  B  8  3DSPATR(UL)             
A            FMPART        20A  O  8  6                       
A            FMDESC        30A  O  8 37                       
 * Line 2                                                     
A            FMDESC2       30A  O  9 37                       
A*----------------------------------------------              
A          R SFLCTL                    SFLCTL(SFLRCD)         
A*%%TS  SD  20111121  155748  NICKH       REL-V5R4M0  5722-WDS
A                                      SFLSIZ(0006)           
A                                      SFLPAG(0005)           
A                                      OVERLAY                
A                                      CF05(05 'SELECT ALL')  
A N72                                  SFLDSP                 
A N71                                  SFLDSPCTL              
A  71                                  SFLCLR                 
A  73                                  SFLEND(*MORE)          
A            RRN            4S 0H      SFLRCDNBR(CURSOR)      
A            RECNO          5S 0H                             
A  88        MESSAGE       75A  O 19  5DSPATR(UL)             
A  88                                  DSPATR(RI)             
A  88                                  COLOR(RED)             
A                                 20  2'Begin At:'            
A            POSPART       20A  B 21  6                       
A            POSDESC       30A  B 21 37                       
A*----------------------------------------------              
A          R SFLHEAD                                          
A                                      OVERLAY                
A                                  1  3DATE                   
A                                      EDTCDE(Y)              
A                                  1 70TIME                                
A            A4USER        10A  O  2  3                                    
A                                  2 29'Warranty Reporting Tool'           
A            A4PNAM        10A  O  2 70                                    
A                                  3 32'Part Selections'                   
A                                  6  3'Selection Criteria:'               
A                                      DSPATR(HI)                          
A                                      DSPATR(UL)                          
A                                  7  2'Sel Part                          -
A                                       Desc                              -
A                                           '                              
A                                      DSPATR(UL)                          
A                                      DSPATR(RI)                          
A          R CMDKEY                                                        
A                                 22  2'                                  -
A                                                                         -
A                                              '                           
A                                      DSPATR(UL)                          
A                                      DSPATR(HI)                          
A                                 23  2'F1=Proceed  '                      
A                                      DSPATR(HI)                          
A                                 23 15'            '                      
A                                      DSPATR(HI)                          
A                                 23 28'            '                      
A                                      DSPATR(HI)                          
A                                 23 42'            '                      
A                                      DSPATR(HI)                          
A                                 23 55'F5=SelectAll'                      
A                                      DSPATR(HI)                          
A                                 23 68'            '                      
A                                      DSPATR(HI)                          
A                                 24  2'F7=Go Back  '                      
A                                      DSPATR(HI)                          
A                                 24 15'            '
A                                      DSPATR(HI)    
A                                 24 28'            '
A                                      DSPATR(HI)    
A                                 24 42'            '
A                                      DSPATR(HI)    
A                                 24 55'            '
A                                      DSPATR(HI)    
A                                 24 68'F24=End     '
A                                      DSPATR(HI)
 1,380 pts.

 

Another quirk I just noticed is after positioning, and rolling to the end of the records, then rolling down(page up) the subfile rolls back through. It goes back to the start, hit page up once more, shows the last page again, page up once more, shows the page above that, then back to the last page, all over again.
I don’t remember how or if I can make it stop. This is loading a page at a time, ‘dynamic grow’. So I write 5 records, display, page down is hit, I try to load 5 more, etc. CPF handles rolldown.

 1,380 pts.

 

Yet one more challenge. This program reads a join logical to load by part number, and reads another join logical to load by description. Isn’t there a ‘newer’ / neater way to do this?

ISTKMPR                                           
I              AWpart                      AVpart 
I              AWDES1                      AVDES1 
I              AWDES2                      AVDES2 
 *                                                
ISTKMP9                                           
I              AWpart                      AVpart 
I              AWDES1                      AVDES1 
I              AWDES2                      AVDES2
 1,380 pts.

 

Tom,
and the answer is,,,,
CPD7812 30 1 Message . . . . : Subfile control record overlaps subfile record.

This environment is different than most places. They like and are used to having the positioning fields at the bottom instead of the top of the screen. This is why I seperated the SFLCTL from the Headings.

 1,380 pts.

 

This is why I seperated the SFLCTL from the Headings.

With positioning at the bottom, that would explain it. The name SFLHEAD was misleading me.

Tom

 107,735 pts.

 

SFLHead is just headings. SFLCTL is all of the SFL keywords plus the positioning fields at the bottom.

Yeah, they looked at me funny the first time I did a subfile here with position to fields. They were at the top of the screen. They said, uh, let’s make it like the other programs that were developed in the 80′s.
Ok, it pays the same….and you guys have to look at it every day.

 1,380 pts.

 

Maybe I should make some of these different posts but this is all related.
I am ‘simulating’ a wild card search with logicals and RPGLE.
The user can enter all or the first part of part# and/or description.
Here is what I am doing, I am open for any suggestions on how to do it better/cleaner. SQL is not an option with large data base file.
After reading a record from the file (routine will read from LF by part or LF by Desc), I check the EOF indicator. Then….

* Simulate a wild card search
C If pospart <> *blanks
C eval len = %scan(' ':pospart:1) -1
C If len < 1
C eval len = 1
C endif
C If %subst(avpart:1:len) <>
C %trimR(%subst(pospart:1:len))
C Iter
C Endif
C If posdesc <> *blanks
C eval len = %scan(' ':posdesc:1) -1
C If len < 1
C eval len = 1
C endif
C If %subst(avdes1:1:len) <>
C %trimR(%subst(posdesc:1:len))
C Iter
C Endif
C Endif
C Endif
*
C If posdesc <> *blanks
C eval len = %scan(' ':posdesc:1) -1
C If len < 1
C eval len = 1
C endif
C If %subst(avdes1:1:len) <>
C %trimR(%subst(posdesc:1:len))
C Iter
C Endif
C Endif
*
C ExSr $mov2sfl
C EVAL RRN = RRN + 1
C EVAL Cnt = Cnt + 1
C WRITE sflrcd
*
C ENDDO

 1,380 pts.

 

It looks like the basic logic can be restated this way without any difference in result (/free):

 // Simulate a wild card search
 If pospart <> *blanks ;
    len = %len(%trimr(pospart)) ;
    If %subst(avpart:1:len) <> %subst(pospart:1:len) ;
       Iter ;
    Endif ;
 Endif ;

 If posdesc <> *blanks ;
    len = %len(%trimr(posdesc)) ;
    If %subst(avdes1:1:len) <> %subst(posdesc:1:len) ;
       Iter ;
    Endif ;
 Endif ;

 ExSr $mov2sfl;  ...etc.

Tom

 107,735 pts.

 

Thanks Tom.
Great minds think alike. I had already incorporated that after reviewing the code. Trying to K.I.S.S. Remember that? My first boss preached that. Keep It Simple Stupid.
<Sigh> Another great person gone is my first boss. R.I.P. Daniel Moffat.

 1,380 pts.