tags:

views:

254

answers:

2

difference between primary and full procedural files in terms of functioning ....in rpg

A: 

Yes, it is COMPLETELY different in RPG. Same database table, but 100% different way of program logic.

This choice is the heart and soul of RPG programming. Therefore, start reading the RPG Programmer's guide.

If you are new to iSeries programming (and by your other questions I know you are ;-), then use full procedural files. This is simular to other languages and systems.

Even better, use the latest version of ILE RPG. This support all the concepts that you know from other languages (procedures, functions, local variables and free format). Older versions are also quite good and do what they are made for, but their concepts are a little bit more exotic.

robertnl
A: 

A primary file uses the RPG logic cycle for reading through your data. A full procedural file is one where your logic controls access to your data records. Full procedural files are by far the most common usage. In fact, I don't think I've ever written a program that uses the logic cycle since school. I rarely see them in the wild.

The RPG logic cycle works roughly like this:

  1. Read a record in the primary file.
  2. Perform level-break calculation specs
  3. Move the data from the file area to fields in your RPG program
  4. Perform detail level calculation specs
  5. Go back to the beginning.

After the last record is read, the LR indicator gets set and level break calculations are executed and then the program ends.

Tracy Probst
Believe me, they are still there. I've written quite a lot of programs with the Program Cycle myself. Always loved the "Total time" indicator.Maybe, it's because I worked in a different area (Logistics, ERP), or maybe it is just the age ... ;-)
robertnl
"Total time". There's an expression I haven't heard in a long time.
Tracy Probst