Showing posts with label rpg. Show all posts
Showing posts with label rpg. Show all posts

Wednesday, January 17, 2007

Debug Tips: RPGLE w/ SQL

I learned this one today. We were debugging an RPGLE program w/ embedded SQL. While stepping through we discovered our bug pretty quick. So to end the debug session, we hit F3 to exit. This closed most of the files we had open. Yeah, a few files were left open. This could have posed a dirty data issue. After a brief analysis of the open files we discovered the files were opened by our embedded  SQL.

This led to a discussion about "open" files and the process involved with "running" a program. I learned that the AS400 actually opens a new "instance" of a program and you will have object locks on files. There are good reasons to do this. If you look at some web applications, such as a "shopping cart", you want more than one.

 I know I am omitting some details. I am a simple guy and I try to keep it simple. This has led me to a new process when I am debugging a program. If I think I might or do know I have some files open.

  • log out and log back in. (Sort of a reboot.)
  • check the library list. (I keep missing this.smile_sarcastic

If you have any ideas or suggestions, let me know.

Thursday, October 19, 2006

RPG: not just for Gamers

I was talking to my friend yesterday about RPG, the programming language. He works for L-3 Communications. He's a programmer. Anyways he wasn't sure what RPG is. I first mentioned that RPG is a prevalent language used at my job. He responded, "Isn't that a gamer language?" Well if you type RPG in Google that will be the majority of the sites you get. I think it comes from the Dungeon & Dragons era of Role Playing Games.

RPG is the acronym for Report Program Generator. It was developed initially around 1960-64 by IBM. So it's been around as long as COBOL, which stands for Common Business Oriented Language. We do use COBOL here in our shop. However I'll post on that later.

RPG has gone through a number of changes. Over they years IBM has released several flavors of RPG.

-RPG about the time of 80-punch car (SCARY) -RPG II the glorious year of 1969 (my birth) -RPG III 1978 new functions like DO, IF-ELSE -RPG IV is the latest uses the ILE RPG compiler

RPG IV allows the programmer to create modules. This point alone will really extend the strength of RPG.

The book I am studying now is RPG IV 3rd edition by Robert Cozzi, Jr. It is a really good book. He has a teaching style that I find easy to read.

I am discovering that to really understand RPG it helps to understand the iSeries IFS, Integrated File System. With the iSeries I have found one tip of Wisdom: "The Library List means Everything." Once you understand that concept it makes programming with RPG or any language in the iSeries a lot easier.

If you want to learn more I suggest RPG IV website.