TomLiotta
7740 pts. | Nov 12 2009 2:51AM GMT
Note that the whole concept of “set-at-a-time” in SQL is little more than Cycle processing without ever mentioning the concept. Implicit open/close? Or apply logic to each processed record? That’s a basic Cycle.
As for why many don’t understand or relize the RPG Cycle even in concept…? I have no idea. Maybe it’s simply not taught.
Tom
Philpl1jb
24510 pts. | Nov 12 2009 3:58AM GMT
Actually we use the cycle all the time, just not to process records from a primary or secondary file or automatically pop lines onto a report. Those just don’t seem to mesh well with the complexity that exists in our processing environments.
So this isn’t RPG anymore .. it’s RPG-COBOL-C-JAVA-RPG IV SQL.
Phil
BigKat
2540 pts. | Nov 12 2009 3:52PM GMT
When I (VERY RARELY) am writing a program that needs to just brute force sequentially process every record in a file, I will code an IP or UP, but as others have stated, this isn’t really the types of processes we need right now.
Graybeard52
2405 pts. | Nov 12 2009 8:34PM GMT
Anytime I need to process a complete file (usually a transaction file), I use IP file type. Its just so much cleaner that coding loops, esp if you need level breaks. I used to have a programmer sitting next to me who would code 30 lines or more to avoid using the cycle or level breaks. He was tausght NEVER to code IP or L1’s in any program. He spent more time debugging …
MurrayInfoSys
570 pts. | Nov 13 2009 2:59AM GMT
AUTOREPORT
Way cool!
I can create a roll-up summary report. AKA a balance Sheet report in less than 5 min.
What is even better is that at creation time, I can point the source code to a source file and tweak the code with my special programing requirements.
Phil
Graybeard52
2405 pts. | Nov 16 2009 8:47PM GMT
AUTOREPORT was a print layout that was pre-processed much the way SQL is now. The output specs listed the fields and headings on the same line, and the auto-report processor created a print layout speced nicely, overflow and headings, and all the O-specs. If accum as requested, it also inserted the proper C specs to roll totals. It went away (afaik) when printer files in DDS were introduced with RPG-III.
Splat
1040 pts. | Nov 17 2009 3:53PM GMT
If I’ve got most of a file to go through sequentially, I use the cycle - it’s fast and efficient.
I’ve never used AUTOREPORT and never played around with matching records enough to get the hang of it.
ASWDEVELOPER
180 pts. | Nov 17 2009 4:33PM GMT
An additional design thought …
If you want to use Input/Update Primary processing on a transaction file to find
only new records … say with a program run daily by the IBM job scheduler … but you don’t like the idea of reading through the entire file every time, create a physical file with a processing flag field and then make a logical view that selects only records with the processing flag blank. Once the processing flag is set to ‘Y’ the daily program never reads it again.






