ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

more than 9999 records and sfldrop ??

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

  • more than 9999 records and sfldrop ??

    hello all,



    i have to load a subfile that contains more than 9999 records and also i have to use the SFLDROP for showing the details of rcords any possibilities??

    page at a time with SFLDROP gives error (ofcourse it will)



    thanks and regards,
    sashi

  • #2
    Re: more than 9999 records and sfldrop ??

    Originally posted by sashimohan
    hello all,



    i have to load a subfile that contains more than 9999 records and also i have to use the SFLDROP for showing the details of rcords any possibilities??

    page at a time with SFLDROP gives error (ofcourse it will)



    thanks and regards,
    sashi
    Sure loading more than 9999 records you have to control pagedown and pageup by yourself.

    Make subfile size and subfile page the same size
    lets say 10 & 10

    when loading you first 10 records store the key value to your file for
    record number one (for pageup) and record number 10 (for pagedown)

    when the pageup/pagedown key is pressed you must c lear the subfile then use the key values that you stored to reload the next or previous 10 records.
    for pageup you must readp for 11 records then read for 10.

    This way you will never have more than 10 records in the subfile at any time.

    THe subfile drop is easy also just read this...Keep track of what mode you are in subfile drop or subfile fold...

    Code:
    Preventing subfiles from folding back up
    
    
    
    Sometimes when a subfile that has a fold/unfold feature is filled 
    a page at a time, the subfile will revert back to the default 
    fold/unfold status when the roll keys are pressed. 
    There is a way to stop this. 
    
    You can control the way the subfile is filled with an indicator, 
    but the trick is letting the program know if the user pressed the 
    command key to fold or unfold. 
    
    The answer to this problem is using the SFLMODE keyword in the 
    control format of the subfile. The keyword is used like this 
    SFLMODE(&FOLD). The &FOLD can be any variable you want to use, 
    but this field name is easy to remember, so we'll use it. 
    You also have to define FOLD as a hidden field in your record. 
    Notice that when using it with the keyword, there is an & 
    in front of it. 
    
    Put both the SFLDROP and SFLFOLD keywords in the control format 
    and and condition them with indicators. For this example, 
    we'll use indicator 88. 
    
    So if 88 is on SFLDROP(CF06), if N88 then SFLFOLD(CF06). 
    This allows the user to toggle by pressing the F6 key. 
    
    Now to the RPG Code. 
    
    Initialize the FOLD variable with a 1 or 0, depending on 
    if you want the default mode to be folded or unfolded on the 
    subfile, then right before you WRITE the subfile, move FOLD to *IN88. 
    This will allow the user to toggle back and forth, roll, and still 
    maintain the view the way they left it.

    good luck
    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


    • #3
      Re: more than 9999 records and sfldrop ??

      jamie,

      thanks for ur reply?
      In dds i made SFLSIZ(10) and SFLSIZ(10) and if i specify SFLDROP
      it gives me error. i searched in IBM webpage and it says that when SFLSIZ=SFLPAG u cant able to use SFLDROP or SFLFOLD.



      In loadall and self extending files we can able to fold & drop but the max records that can be loaded to the subfile is 9999.In Page at a time technique only we can able to load more than 9999 records.but i cant able to use the SFLFOLD or SFLDROP.
      Any chances to load the subfile with more than 9999 records with SFLFOLD??

      thanks and regards,
      sashi

      Comment


      • #4
        Re: more than 9999 records and sfldrop ??

        Originally posted by sashimohan
        jamie,

        thanks for ur reply?
        In dds i made SFLSIZ(10) and SFLSIZ(10) and if i specify SFLDROP
        it gives me error. i searched in IBM webpage and it says that when SFLSIZ=SFLPAG u cant able to use SFLDROP or SFLFOLD.



        In loadall and self extending files we can able to fold & drop but the max records that can be loaded to the subfile is 9999.In Page at a time technique only we can able to load more than 9999 records.but i cant able to use the SFLFOLD or SFLDROP.
        Any chances to load the subfile with more than 9999 records with SFLFOLD??

        thanks and regards,
        sashi
        Okay Well I didnt know that.....

        Lets look at this a different way..... I cant belive a person would hit the pagedown key like 900 times...this seems like a huge waste of time.

        So I would count the RRN when it gets to 9999 and they roll I would send a message that they are at the end of the subfile (message subfile) and they need to use the positioning fields in the control record to locate their desired record.

        If that is not an option then I would create just one long field in the subfile and format it myself maybe using a data structure. You could add a function key to mimic the subfile drop and when it is pressed fill the second line with info.(again using a data structure for formatting) when they pressed the key again for subfile fold then only load first line of data.


        The last option would be duplicate subfiles when the RRn gets to 9999 switch to display subfile number two.....But you are talking about a bunch of code for a situation which I think would rarely if ever happen....Who has time to roll thru a subfile 900 times......


        Hope this helps
        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

        Working...
        X