425 pts.
 RPG Life Cycle
Can someone suggest simple web-links to know about RPG life cycle programing. How the cycle works with a good example.

Software/Hardware used:
Iseries
ASKED: February 26, 2010  2:42 PM
UPDATED: March 4, 2010  12:57 AM

Answer Wiki:
This is just for the purpose of interview preparation only, anyhow I'm not goint to do rpg cycle programs. You are mixing 2 separate things here. Program cycle and development life cycle. The RPG PROGRAM CYCLE is what I think you're after. There are a bunch of features to it, but only a few that you'd see frequently. - Input Primary file : automatically does the read of the next record in your primary file. No explicit I/O operation in the code. Will also do the update if "UP" instead of "IP". - Level breaks : automatically sets L1, L2, etc. indicators when the value(s) of specified field(s) changes from the prior record. Very handy for things like having a report force a page break if the company number has changed. Also can do special processing (subroutine-like or printer output) that happens after the record read but before that data rolls into the field values. - Last record processing : a special case of level breaks. You can have certain code or printer output that only runs when the Input Primary read gets an end-of-file. You might see new programs written that use Primary files (a fine techniques if reading the entire file anyway) but more rare to see other features in a new program. Any academic style book on RPG will cover the program cycle. The development life cycle is not unique to RPG. Unlikely you're asking about this.
Last Wiki Answer Submitted:  February 26, 2010  5:38 pm  by  Kar   425 pts.
All Answer Wiki Contributors:  Kar   425 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

 

The RPG Cycle isn’t totally unique. The whole concept of SQL “set at a time” processing works because of an internal “SQL Cycle”.

A big difference is that the RPG Cycle is reasonably well documented so you can know when in the Cycle your pieces of code will execute. For SQL, it’s sometimes a little harder to see that a particular clause happens at the start, at the end, at level breaks or at each detail time. But there are parallels for them all.

Any similar documentation for SQL takes a little insight to see how it could be documented much the same way as the RPG Cycle.

Tom

 108,330 pts.

 

For the most part the RPG cycle is no longer used. it’s unfortuneate because it can do alot of things for you in batch programs. Many people using RPG today are trained via event driven programing vs procedural. RPG has a built in ‘Cycle” which allows it to automatically fetch the records of the primary file in a program. After each record is fetched the program falls thru the calculations executing the lines based on indicators, if statements etc. There is also special “level break” indicators which can be indicated in the input specifications. These indicators will automatically turn on when the value of a field in the primary file changes. you can them have calc specs associated with that level break indicator(L1 thru L9) and they are automatically executed. (If L2 turns on, L1 is automatically turned on also). At EOF the special “LR” indicator is turned on and you can have calcs associated with it that are only executed after all records in primary file are read. THERE IS A VERY, VERY COOL RAD DEVELOPMENT TOOL CALLED UniPaaS FROM MAGIC SOFTWARE THAT HAS A RUNTIME ENGINE THAT HAS AN ENHANCED CYCLE WHICH IN ITS BEGINNINGS IN THE LATE 80′S WAS JUST LIKE RPG. THE PROGRAM IS STORED IN ITS OWN DATABASE(XML). IT IS A COMPLETELY VISUAL TABLE DRIVEN PARADIGM WHERE YOU FILL IN TABLES AND DRILL DOWN AS NECESSARY. EVERYTHING IS DONE IN ONE PLACE. FORMS, DBMS, DATABASE,DATA DEFINITIONS, MODELS, LOGIC, ETC. IT IS IBM CERTIFIED AND HAS A SUBSYSTEM THAT RUNS ON THE AS400(EASYCOM) WHICH PROVIDES DIRECT ACCESS TO SQL AND ISAM FILES AS WELL AS THE ABILITY TO CALL PROGRAMS/Cl ON THE AS400, PASS PARMS BETWEEN THE PROGRAMS, COPY SPOOLFILES, AND MANY OTHER FEATURES. IT’S AN INCREDIBLY FAST DEV ENVIRONMENT. YOU CAN DEVELOP GUI PROGRAMS WHICH ARE SIMULTANEOUSLY ACCESSING /UPDATING AS400, ORACLE, MS SQL, ETC. IT HAS A “GET DEFINITION” UTILITY THAT CAN AUTOMATICALLY LOAD FILE DEFINITIONS INTO THE UniPaaS DATA REPOSITIORY(1 FILE, SEVERAL, OR all FILES IN A LIBRARY OR DATABASE). CHECK IT OUT AT http://WWW.MAGICSOFTWARE.COM. YOU CAN DOWNLOAD A FREE COPY TO EVAL. iT EVEN INCLUDES A TRAINING CURRICULUM.

 115 pts.