sflend(*More)

475 pts.
Tags:
AS/400
AS/400 Subfiles
Subfile
I have an order entry program where the detail is entered at the bottom of the subfile and the More... stays on all the time even when the indicator is on or off. If the file I am reading only has one record in it and my subfile page is 8 and subfile size is 9 the More... still shows. Can anyone shed some light on this problem I am having? Thanks.

Answer Wiki

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

The indicator with SFLEND doesn’t cause it to display/not display but rather changes what it displays on the last page of the currently loaded subfile.

In the old days, this would be the indicator for EOF of the file (not the subfile) being loaded.

If the indicator is on (and refered to without the ‘N’) — ‘More…’ appears until you page down to the last page of the subfile then ‘Bottom’ is shown.

If the indicator *off then ‘MORE…’ is shown as you pagedown including the last page, since it’s assumed that your program will load more on demand, not your case at all.

In your case, it sounds like you don’t want the words MORE… or BOTTOM. If that’s the case don’t use SFLEND.

Phil

===========================================
*in90 is coming from your program .. when/if you’ve loaded all lines of detail turn it on.
90 SFLEND(*MORE)
The last page of the subfile will now read ‘BOTTOM’.
Phil
============================================

I’m reaching here, cause this always works … until now

90 could be turned off in the control record by some other use — not likely.
wrong version??? remember to enddbg.
Recompile the display before the rpg
If you use PAGEDOWN (ROLLUP) it should be N90 so that at the eof pagedown won’t return to the pgm.
Phil

=======================================
Great the code helps???
Sorry – by version, I meant the version of your code — this has worked since the time of Moses.

The only thing I see that I’m not so sure about is:

C write sf1ctl
C exfmt detail

For a hoot .. just to see what’s happening try:

C Exfmt sf1ctl
C*** exfmt detail

This won’t solve your problem but it should show what’s happening.

I’m not sure about
Drollup c const(X’F5′)

Since you don’t have a rollup???

But this logic would have a problem if there were 25 details — the flag goes on on the 26th read.
Phil

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Should you turn SFL_END on???
as in D SFL_End 90 90N
Phil

————————————–
You got it —
you must turn on position 90 in the Indicators DS which is not indicator 90.

Now to deal with the extra read that you need — to set more… correctly when you have 24 records
put your intial read just after the SETLL and a secondary read at the bottom of the load loop
after the load loap eval sfl_end = *in90

The other oddity you will want to take care of is to make the sflsiz = multiple of the sflpage
say 8 and 24 not 8 and 25. So you load 3 pages at a time and then come back for more…that’s where you’ll need the rollup/pagedown .. with the 90 .. so you’ll know that the user wants to load more.

However, depending on your expectations, this is all simplier doing a load all up front.
Phil

Oh yea .. I’m older than you.

Discuss This Question: 12  Replies

 
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
  • filuphaze
    That is my problem. I have 90 SFLEND(*MORE) in my dds which is the indicator used for the file read. Even if *IN90 is on or off the word More... shows on the screen on the first page (which it should as *IN90 is off as there are more records) and on the last page even though *IN90 is on.
    475 pointsBadges:
    report
  • filuphaze
    Yes I want the words MORE... or BOTTOM to show but BOTTOM never does. I have debugged the program and before i write the CTL indicator 90 is on as I am at the end of the file and the word MORE... still shows on the screen. I can keep pressing page down and recheck the indicator during debug and there are no more records to be read and indicator 90 is on and therefore MORE... keeps showing. I cannot get BOTTOM to show.
    475 pointsBadges:
    report
  • filuphaze
    I just tried using the PAGEDOWN with N90. No change. You mentioned wrong version. I am using V4R4M0. Do you think that has something to do with it. I have other similar programs and the MORE... BOTTOM works ok. I am at a loss. I am not using any other indicator 90 except for the SFLEND(*MORE) and on the reade for my data file. If I change the SFLEND to N90 then initially the screen reads BOTTOM and I pagedown and it still reads BOTTOM which it should as I am at the end on page 2 but when I pageup the BOTTOM switches to MORE... and everthing works correctly until I exit the program and go back in.
    475 pointsBadges:
    report
  • Teandy
    This would be much easier to diagnose if you could post your code. In the mean time, it sounds like the indicator is not being set to on. Make sure that: 1.) You are using the same indicator for end of file as you are for SFLEND. 2.) The resulting indicator is in the EQ column (position 76 - 76). Example:
     
    
    CL0N01Factor1+++++++Opcode&ExtFactor2+++++++Result++++++++Len++D+HiLoEq
    
    C                                           READ      ADCPTIL1                                                                        40
    
    
    5,860 pointsBadges:
    report
  • Teandy
    Sorry, the spacing did not come out right. Lets try that again. Example: CL0N01Factor1+++++++Opcode&ExtFactor2+++++++Result++++++++Len++D+HiLoEq C READ ADCPTIL1 40
    5,860 pointsBadges:
    report
  • Teandy
    Sorry again for the typo and spacing. It should read positions 75 - 76.
    
    CL0N01Factor1+++++++Opcode&ExtFactor2+++++++Result++++++++Len++D+HiLoEq
    
    C                                           READ           MYFILE                                                                         40
    
    
    5,860 pointsBadges:
    report
  • filuphaze
    F*********************************************************************** Fford0090 cf e workstn F sfile(sfl1:rrn1) F infds(info) F indds(indicators) Ffrorhd uf a e k disk Ffrordt uf a e k disk Ffrordn uf a e k disk Finvtry if e k disk Fcustmr if e k disk Ffrcsfr if e k disk Ffrbcit if e k disk Ffrcspc if e k disk D* D psds sds D #pgnam *proc D #user 254 263 D* Dinfo ds D cfkey 369 369 D* D Indicators DS D SFL_Clr 31 31N D SFL_Dsp 32 32N D Pos_Cursr 60 60N D Pos_Qtyor 61 61N D Broch_Err 70 70N D Item_Err 71 71N D Nxtchg 74 74N D SFL_End 90 90N D* D System_Date s d datfmt(*iso) D inz(*sys) D Today s d D* Dexit c const(X'33') Dcancel c const(X'3C') Dprompt c const(X'34') Dadd c const(X'36') Denter c const(X'F1') Drollup c const(X'F5') Dsflpag c const(8) Ddisplay c const('5') Dchange c const('2') Ddelete c const('4') D* Dlstrrn s 4 0 inz(0) Dselrrn s 4 0 inz(0) Dcount s 4 0 inz(0) D* C***************************************************************** C* Main Routine C***************************************************************** C* C* Clear then build the initial subfile C* C exsr clrsf1 C odtk01 setll frordt C exsr sflbld C* C* Do loop to process the subfile until F3 is pressed. C* C dou cfkey = exit or cfkey = cancel C* C write fkey1 C write sf1ctl C exfmt detail C if cfkey=exit C or cfkey=cancel C iter C endif * C***************************************************************** C* CLRSF1 - Clear the subfile C***************************************************************** C* C clrsf1 begsr C* C* Clear relative record numbers and subfile C* C eval rrn1 = *zero C eval lstrrn = *zero C eval SFL_Clr = *on C write sf1ctl C eval SFL_Clr = *off C eval SFL_Dsp= *on C* C endsr C***************************************************************** C* SFLBLD - Build the List C***************************************************************** C* C sflbld begsr C* C* Make RRN1 = to the last relative record number of the subfile C* so that the load process will correctly add records to the bottom C* C eval rrn1 = lstrrn C* C* Load the subfile with one page of data or until end-of-file C* C do sflpag C odtk01 reade frordt 90 C if *in90 C leave C endif C eval rrn1 = rrn1 + 1 C eval option = *blank C eval brochr = ffbccd C invk01 chain invtry C write sfl1 C enddo C* "C* If no records are loaded to subfile, don't display it" C* C if rrn1 = *zero C eval SFL_Dsp = *off C eval Pos_Cursr = *off C eval Pos_Qtyor = *off C endif C* C eval lstrrn = rrn1 C* C endsr C* C*****************************************************************
    475 pointsBadges:
    report
  • filuphaze
    A          R SFL1                      SFL
    A*
    A  74                                  SFLNXTCHG
    A            FFLIN#    R        H      REFFLD(FRORDTR/FFLIN# *LIBL/FRORDT)
    A            OPTION         1A  B 11  3VALUES(' ' '2' '4')
    A            FFBCCD    R        O 11  8REFFLD(FRORDTR/FFBCCD *LIBL/FRORDT)
    A            FFITM#    R        O 11 17REFFLD(FRORDTR/FFITM# *LIBL/FRORDT)
    A            INDESC    R        O 11 26REFFLD(INVTRYR/INDESC *LIBL/INVTRY)
    A            FFQTOR    R        O 11 62REFFLD(FRORDTR/FFQTOR *LIBL/FRORDT)
    A                                      EDTCDE(4)
    A*
    A          R SF1CTL                    SFLCTL(SFL1)
    A*
    A                                      SFLSIZ(0025)
    A                                      SFLPAG(0008)
    A                                      OVERLAY
    A  32                                  SFLDSP
    A                                      SFLDSPCTL
    A  31                                  SFLCLR
    A  90                                  SFLEND(*MORE)
    A            RRN1           4S 0H      SFLRCDNBR
    A            ORMODE         6A  O  1  2DSPATR(HI)
    A                                  1 28'Fundraiser Order Entry'
    A                                      DSPATR(HI)
    A                       g
    475 pointsBadges:
    report
  • filuphaze
    ADD                       Fundraiser Order Entry                      6/25/09  
                                                                         14:58:16  
    COMPANY/LOCATION . . . . . .  04 04                                            
    CUSTOMER NUMBER  . . . . . .   44073 STACIA  - BROCHURE ACCT              
    FUNDRAISER CODE  . . . . . .  BA1        BROCHURE ACCT 1                       
    SELLER NAME  . . . . . . . .  JOHN BROWN                                       
    Type options, press Enter.                                                     
      2=Change       4=Delete                                                      
         Brochure                                                                  
    Opt    Code    Item #   Item Description                     Qty Ord           
          B1       400900   SID ICE AGE PLUSH                       5.00           
          B2       400092   LIGHT UP MOTION DECTECTOR AD 105        3.00           
          B2       400092   LIGHT UP MOTION DECTECTOR AD 105        4.00           
          B2       400092   LIGHT UP MOTION DECTECTOR AD 105        5.00           
          B2       400092   LIGHT UP MOTION DECTECTOR AD 105        2.00           
          B2       400092   LIGHT UP MOTION DECTECTOR AD 105        1.00           
          B2       400092   LIGHT UP MOTION DECTECTOR AD 105        4.00           
          B2       400092   LIGHT UP MOTION DECTECTOR AD 105        3.00           
                                                                           More... 
          Broch    Item #     Qty Ord                                              
          B2    *         *                                                        
                                                                                   
      F3=Exit    F4=Prompt    F12=Cancel                            
    
    
    
    
    
    
    
    
    After I page down:
    
    
     ADD                       Fundraiser Order Entry                      6/25/09  
                                                                          15:01:16  
     COMPANY/LOCATION . . . . . .  04 04                                            
     CUSTOMER NUMBER  . . . . . .   44073 STACIA - BROCHURE ACCT              
     FUNDRAISER CODE  . . . . . .  BA1        BROCHURE ACCT 1                       
     SELLER NAME  . . . . . . . .  JOHN BROWN                                       
     Type options, press Enter.                                                     
       2=Change       4=Delete                                                      
          Brochure                                                                  
     Opt    Code    Item #   Item Description                     Qty Ord           
           B2       400092   LIGHT UP MOTION DECTECTOR AD 105        5.00           
           B2       400092   LIGHT UP MOTION DECTECTOR AD 105        8.00           
           B2       400092   LIGHT UP MOTION DECTECTOR AD 105        6.00           
           B1       400900   SID ICE AGE PLUSH                       6.00           
                                                                                    
                                                                                    
                                                                                    
                                                                                    
                                                                            More... 
           Broch    Item #     Qty Ord                                              
           B1    *         *                                                        
                                                                                    
       F3=Exit    F4=Prompt    F12=Cancel
    475 pointsBadges:
    report
  • filuphaze
    OMG!! During my SFLBLD routine when 90 comes on at the end of file, I moved '1' to SFL_End and that worked!! I guess the *in90 on my file read does not coincide with the definition. I don't know why but it works now. Thank you Philpl1jb. Your last comment did the trick. I am glad you stuck with me. sometimes someone else comes up with the obvious answer. i am never too old to learn something.
    475 pointsBadges:
    report
  • Teandy
    It works because you have set up *in90 as a named indicator in your D specs (SFL_End 90 90N) and are using an indicator data structure to communicate with the screen. In other words, you set up an indicator DS called Indicators. In your F specs you told the screen to use this DS to communicate indicator status between the program and the screen (F indds(indicators)). When *IN90 came on at EOF the screen ignore it because you told it to use the name SFL_End instead. When you set SFL_End on at EOF, the screen “saw” it and changed from MORE to BOTTOM.
    5,860 pointsBadges:
    report
  • filuphaze
    Thank you both for all your help. It all makes sense now. That's what I get for trying something new like defining the Indicators in my program instead of the old way of using *in##. I appreciate your patience.
    475 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