SUBFILES RPG IV PDF
Kevin Vandever's Subfiles in RPG IV (MC Press, ) offered easy-to- understand explanations of subfile Individual E-Version (PDF), ISBN: This book begins with easy-to-understand explanations of subfile concepts then goes on to offer a bounty of practical examples, advanced techniques, and other . change a record on any page of the subfile, and process all changed records only when the way to get the same results using RPG and subfile processing.
|Language:||English, Spanish, Dutch|
|ePub File Size:||24.43 MB|
|PDF File Size:||19.31 MB|
|Distribution:||Free* [*Regsitration Required]|
See more: subfile keywords in as, how to create a subfile in as, single page subfile code in rpgle, subfiles in rpg iv pdf, expandable subfile in as May 9, A simple example of a subfile and accompanying program written in This was rather disappointing as RPGLE is over 21 years old, free format. IBM may not offer the products, services, or features discussed in this document in other countries. Consult your local IBM representative for information on the.
The column will be highlighted, right before you drop the element. Once the element is dropped, it will repeat to all rows within the subfile. Now, bind the value property to the appropriate RPG field.
Rpgle Interview Questions & Answers
This can be done by double-clicking the widget. Note: In addition to output fields, most other widgets can also belong in a subfile, including action elements like buttons and hyperlinks, and input elements like checkboxes and dropdowns.
Set up number of visible rows You can add or remove visible rows by selecting the plus and minus icons at the bottom of the grid. For output fields, you must ensure that the element has a predefined width.
This can be accomplished by resizing the element horizontally or setting the width property manually in the Properties Window.
Setting the clear subfile indicator The grid component contains a number of properties that allow you to control it through server-side RPG coding. One critical property is clear subfile, the equivalent of the CLRSFL keyword from traditional green-screen programming. It is conventional to clear the subfile before loading it with data.
The subfile control record format is longer than the subfile record format, but it is still very simple. Lines 15 — These are the subfile keywords that are needed to control the display of the subfile.
I only have to use two indicators to condition them. Indicator 31 is used just to control the display of the subfile, if there are no records in the subfile I do not want to display it.
Indicator 30 is used for all the display of the subfile control, and I want "More Brian Rusch made suggestion in a comment below that makes good sense. Lines 27 — I also display the "screen id", which is the program name with "-1" on the end.
If the user has a problem with the program I tell them to give me the name of the screen and I know what program to work with. I never hard code this field.
It is taken from the RPG program's data structure. This way if I copy or rename the program it will always show the current program's name. Lines 32 — I am providing a "Position to" field so that the user can position the start of the subfile to a record in the file, and then the program loads the subfile from that point.
IBM - RPG Related Interview Questions
And onto the RPG. For those of you using a release of IBM i that does not allow for free format definitions I have the fixed format equivalents at the bottom of this post here.
I use what I call "open" subprocedures in place of subroutines. Lines 3 — 5: This is my program status data structure. I use this to get the program's name which I use for the screen name on the subfile control record format. Line 6: This is the definition for the display file that contains the subfile. The SFILE keyword is needed for each subfile, I need to give the name of the subfile record format and the name of the field that is used as a "numeric key" for the subfile.
Line 8 — This is the Indicator Communication Area data structure. What I like about these data structures is I can map an indicator from the display file to a meaningful name.
For example: Line In other programs I have coded this as a hidden field in the subfile control, but I am keeping this example simple. This is not a definition line. It is where I create the screen name by appending "-1" onto the end of the program's name.
This next section is the code I need to handle the subfile. As I am using a "Load all" I do not have to code of the user pressing the Page Up or Down key the subfile does all that for me behind the scenes.
Record format REC01 displays the function keys at the bottom of the screen. I WRITE it here so it overlays the previous screen displayed, this is especially useful if there are no records to display in the current subfile. The EXFMT of the subfile control record means that the processing of the program remains "within" the subfile until Enter or one of the valid Function keys are pressed. No code necessary for Page Up or Down as the subfile handles that itself.
Lines 22 — As Dsp. Exit is the equivalent of indicator 3 this code is only executed if F3 has been pressed.
Lines 24 — This is the code for when the F5 key has been pressed.
All this code does is to reload the subfile from the start of the file. Lines 30 — Lines 36 — If none of the above has happened I want to see if the user has entered a value into the option field of the record they want to do something with, which is done in the subprocedure ReadSubfile. But I only want to call that subprocedure if there are any records in the subfile. The indicator Dsp. SflDsp will only be on if there are records in the subfile.
Lines 42 — This is where the existing subfile is deleted, Dspf. DspSfl , to off. The deleting of the existing subfile does not occur until I write the subfile control record. I am going to want the subfile control record format to display at all times so this is where I set on the indicator that flags that I want to display it. I prefer to use the FOR operation code when I need to perform a loop a number of times.
The statement says set Z1RRN to one, then increment it by one each time the For-loop cycles for the number of times held in the constant MaxSfl. Lines 48 — The processing within the For-loop is very simple. Read a record, write to the subfile, until either end of the file or the loop has been performed the prescribed number of times. Line 54 — I only want to display the subfile if it contains any records.
If only one record has been written to the subfile Z1RRN will contain two, and if more record were written the number would be greater.
Lines 60 — It only reads changed subfile records, which will be the ones where the user has entered a value in the option field, as that is the only field in the subfile that can receive input. After all the changed records have been read, or there are no changed records, the end of file indicator is set on.
Lines 64 — After whatever processing is performed I need to clear the option field of the subfile record, and then I need to update the subfile record to clear the option field on the display.
As I said this is a very simple example subfile. You can make yours far more complicated if you so desire.
I hope this will be of use to people writing their first subfile program, and as another example of using free format definition RPG. I have been using it from near the beginning. Free format is the best thing for programmers, IMHO. Thanks for the examples, Simon!
In a more complicated program I agree, the use of qualified fields would make it easier to understand. I like throw in an ERASE to remove the previous subfile rows from the screen if the next search returns nothing.
Search and Inquiry by Name - IBM - RPG
Excellent simple subfile example! One thing i see in many subfiles is that once you position the file you can't page backwards without doing a refresh. Do you have such an example? I would argue that once you have positioned to something you normally do not need to look before the first match.This was rather disappointing as RPGLE is over 21 years old , free format calculations 14 years old, even free format definitions RPG is in its third year.
Subfiles in Free-Format RPG
Lines 3 — 5: This is my program status data structure. Once a young, promising RPG programmer and consultant, he cranked out code, spoke at conferences, wrote articles, penned columns, and published the occasional book. Intitially the only the first one page of the subfile is loaded. Lines 27 — I also display the "screen id", which is the program name with "-1" on the end.
Lines 20 — I always display the user id, date, and time on all my display files. That too when the subfile is display only! Several PF opcodes will not work with subfiles. I use what I call "open" subprocedures in place of subroutines.
I have 9 years experiencein the as development.
- IN NOMINE RPG PDF
- NOBILIS RPG PDF
- ROGUE TRADER RPG PDF
- MAIDANAM NOVEL PDF
- SERVLET TUTORIAL JAVATPOINT PDF
- AZIE FAISON GAME OVER PDF
- PEDAGOGY OF THE OPPRESSED BOOK PDF
- JURISPRUDENCE BOOKS PDF
- THE WILLPOWER INSTINCT EPUB
- BURN BOOK APP
- LINUX SYSTEM PROGRAMMING 2ND EDITION PDF
- NEW ENGLISH FILE INTERMEDIATE PLUS TEACHERS BOOK PDF