|
On Thu, 2004-07-15 at 15:57, William Washington III wrote: > I waited awhile until I started writing in "free-format" mode. Now it's my > preferred method of programming RPG IV. However, there are many programs in > "fixed-format out there, so take the baby steps... 1) RPG IV with fixed-format > programming, 2) understanding procedures (vs subroutines), 3) free-format > programming (since you know Java and C++, this will probably seem more > "natural" to you than most), 4) using D-specs and procedure interfaces for > parameter passing instead of PARM, and finally 5) the "ILE mode" of > development > (service programs, binding, etc.) > > Steps 1 & 2 are the bulk of the learning, and one week of serious effort will > get you there! You already know 80% of the language... good luck, Pete! > > William Pete, Just for a different point of view, I would actually say that points 2, 4, and 5 are very tightly related and they will actually take the bulk of the learning. If you can read RPGIII, you can read RPGIV fixed-format. EVAL will be the first OPCODE you learn that doesn't exist in RPGIII, and in fixed format you will use it A LOT ... so much so, in fact, that it is the assumed opcode in /free. All RPGIII is considered "OPM" (Original Program Model). You can also run RPGIV code as OPM, but in order to take advantage of procedures, prototyping, service programs, binding directories, and the like that you have probably heard of you will need to run in "ILE" (Integrated Languages Environment). ILE is a different design approach, and as such I think this takes more time to become familiar with. The good news is that you can begin in the ILE model even with straight converted (RPGIII to RPGIV) code by compiling in SEU (still with option 14) by changing one compile parameter: DFTACTGRP(*NO) - *YES is the default and that created OPM programs. I don't want to get too far into it at this point... try this for a long term outline of action (and this could take you several weeks to get comfortable with). Remember we are working on basics at this point, so take your time and don't be discouraged: 1. Convert some source from RPGIII to RPGIV using the IBM supplied converter. Go to SEU and compile it with DFTACTGRP(*NO). The program should appear to run just as before, and you will actually have a working ILE program, just one that doesn't use any ILE features. Then hit the books... the ILE Concepts manual should be required reading at this point... 2. After reading up some on Sub-Procedures vs. Sub-Routines, convert a subroutine to an internal subprocedure. 3. Move your Sub-Procedure to it's own source member and compile it with option 15 in SEU. Also compile your original source member with 15. This will give you two *MODULE objects, a procedure module and a main. Use the CRTPGM command to create a program that conatins both *MODULE objects. 4. Use your procedure *MODULE to create a service program (*SRVPGM object type). Re-create your program referencing the service program and the main *MODULE. 5. Create a binding directory (*BNDDIR object type) and list the *SRVPGM in the directory. Re-create your program again, but this time put an H-Spec in that references the binding directory. Now the only *MODULE you have to reference is your main module. Working through this exercise will get you started down the ILE path. Along the way, the advanced features of RPGIV will start to make more sense as they come into play. When you get to step 4 above, I have a series of ILE articles that may help. You can find them listed at: http://www.rpgnext.com/tutorials.php Best of Luck, Joel http://www.rpgnext.com
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.