SUBFILES

210 pts.
Tags:
INDICATORS
RPGLE
Subfile
Hai friends, I need to design a subfile such that when a user press 1 against a employee number,it should display the details of the selected employee.Pls help me.

Software/Hardware used:
AS400,RPGILE

Answer Wiki

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

Yes-you have a choice
Either create the subfile with one row for the basic data and other rows for the details. Show the SFL initially as “folded” which shows only one row and when the user enters 1 show the correct record with DROP
This options uses SFLFLOD, SFLDROP and SFLRCDNBR(*CURSOR) commands.

Alternatively you could show the detail data on a simple record or window record.

Phil

Discuss This Question: 10  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
  • TomLiotta
    What is the problem you are having with subfiles? Are there features that are not working for you? Or are you needing to learn about what subfiles are and how to use them? Tom
    125,585 pointsBadges:
    report
  • senmalar
    Hi, I created the subfile.But I dont know much about the indicators.Can anyone tell me the basics of indicators generally used in subfiles?
    210 pointsBadges:
    report
  • TomLiotta
    Can anyone tell me the basics of indicators generally used in subfiles? There are different "basics" under different circumstances. At this point, I'm not aware that you need any indicators at all. Your description doesn't include anything needing them. Maybe the most basic position is not to add anything with indicators until there is no alternative for what you need to do. If you use no indicators, what fails? Some keywords need indicators to work properly. Determine if things work without the keyword first. Remove the keyword if removing an indicator causes trouble, then find out why you need that keyword. Maybe there is a better alternative. Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    There are three subfile keywords that need indicators. SFLCLR resets the subfile area SFLDSP shows the subfile data SFLDSPCTL shows the fields in the SFLCTL record. Initially you clear the subfile by writing the SFLCTL record with the SFLCLR indicator on and the SFLDSP and SFLDSPCTL off Then you load the subfile records-adding 1 to RRN and writing each SFL record Then you write the control record to show the subfile - this time the SFLCLR is off and the SFLDSP and SFLDSPCTL are on. Phil
    50,860 pointsBadges:
    report
  • TomLiotta
    SFLCLR resets the subfile area SFLDSP shows the subfile data SFLDSPCTL shows the fields in the SFLCTL record. Since SFLCLR is only needed when you want to clear the subfile, it might not be needed here. And since SFLDSPCTL and/or SFLDSP would only need an indicator if some contradictory function (such as SFLCLR) was specified, there is no need for indicators on either of those... yet. Indicators might be added to those later, if needed as the logic develops. Tom
    125,585 pointsBadges:
    report
  • Splat
    To access the subfile record with the 1 by the particular employee you're going to need to do either a READC or a relative record number chain against the subfile format to return the selection to your program.
    7,565 pointsBadges:
    report
  • senmalar
    Hi, I am using Readc.Can anyone tell me the use of SFLDSP and SFLNXTCHG indicator?
    210 pointsBadges:
    report
  • NeilD
    Something that may be of help to you are the examples given by Kevin Vandever on ItJungle. I recently changed jobs and was without skeleton code examples so used his pgms as a basis for my work. RPG: http://www.itjungle.com/mpo/mpo060503-Kevin-PageAtATimeRG.txt DSPF: http://www.itjungle.com/mpo/mpo060503-Kevin-PageAtATimeRG.txt Hope this is of use.
    485 pointsBadges:
    report
  • philpl1jb
    SFLDSP has already been described. It allows the subfile records to be displayed when the SFLCTL record is written or EXFMT The readc reads only changed records in the subfile and drops the changed record flag on them. if you want the record to continue to appear as changed so a later readc will find it then set SflNxtChg on and update the subfile record. Phil
    50,860 pointsBadges:
    report
  • TomLiotta
    Can anyone tell me the use of SFLDSP and SFLNXTCHG indicator? I assume that that should be "Can anyone tell me the use of SFLDSP and SFLNXTCHG indicators?" The SFLDSP indicator would be used when you want to perform a subfile operation against the display without displaying the subfile. The most common use would be when you want to clear the subfile in order to build new records into it. It can be easiest to use the same indicator for SFLCLR and for SFLDSP, but have them specify the opposite of each other. That is, you might use indicator 80 for SFLCLR and indicator N80 for SFLDSP. That makes it impossible for both options to be in effect at the same time. When you set 80 *ON and write the subfile control format, the subfile would be cleared and the subfile wouldn't be displayed at the same time time. The SFLNXTCHG keyword goes with the subfile format rather than the subfile control format. You use an indicator so you can turn the option on or off when you WRITE or UPDATE each subfile record. If the SFLNXTCHG option is in effect when you output a subfile record, then that record will be one of the subfile records that is read when you use READC to read the subfile. Usually, you would use this when the user is updating subfile records and makes an error. Your program reads each subfile record that was changed with READC. If your program finds an error in the record, you can use UPDATE with the SFLNXTCHG indicator on. That puts the record back for the user to change. But the user might not change it; the error might still be there. If you had the SFLNXTCHG option turned on when you updated the subfile, your program would still be able to read it back in with READC. Normally, a READC only reads changed subfile records. But SFLNXTCHG lets you be sure to read that the next time even if the user ignored it. And, of course, the error would still be there; so you'd turn on SFLNXTCHG again, put it back on the display and keep doing it until it gets fixed or until the user cancels the operation. Tom
    125,585 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