RPG

IBMi + WDSC7.0 + TN5250 = Wow Squared!

WebSphere Development Tools for the IBMi is Very Very Very Cool!

I've just installed WDSC7.0 for the first time (/me ducks from the barrage of rotten fruit launched at him from the rowdy-RDi-crowd) and have almost had a religious experience with it.

For years I've been feverishly hammering away in S.E.U. and P.D.M. mistakenly thinking that I just haven't got the time to learn a new G.U.I for writing RPG and CL programs on the IBMi.

Look at that - I used WDSC, RDi, SEU, PDM, GUI and IBMi all in the same paragraph Wink but at least I never used the word leverage or any other business junk phrases like lets run that idea up the flagpole and see who salutes

Possibly I'm the only IBMi Developer who wasnt already using a modern source code editor, in which case you're laughing at me, but just in case you (dear reader) are still in the world of SEU then just stop right now and get a copy of WDSC7 from your IBM business partner. It's FREE as its been replaced by the new, very expensive, re branded Rational Developer.

From my perspective, WDSC7 is simply amazing.

Pay I.T. forward

Wow! It's December already!

After a whirlwind year involving moving the whole family, two dogs and a pile of News 3x/400 magazines to this side of the pond I cant believe it's nearly 2010 already. Two thousand nine has seen us settling into our new life in the US,  focussing mainly on IBMi and I feel that I've reached a kind of career milestone. After a couple of years focusing on other areas, in the IT wilderness, this year has seen my return to the IBM Midrange club and in the immortal words of Gary Glitter “I’m glad to be back

ILE RPG certified programmers are extinct

Well... they will be at the end of 2009!

For some very strange reason, IBM have decided to kill the ILE RPG Programmer certification. As we all know, being an RPG Programmer is a rare skill set nowadays... and it's becoming rarer. I kind of feel guilty for never standing up and doing the certification. But then again, as I'm typing that I'm also thinking that I actually dont want a little plaque in my dilbertesque cubicle announcing to the world that I know how to do my job: I have a job therefore I know how to do it.

Setting RPG Slash Free - Step 4 of 4

Convert it to FREE FORMAT

Of course, I use the Projex400 command to do this step. This is what the SETSRCFREE command gives us:

   h datfmt(*iso) timfmt(*iso) option(*nodebugio) debug
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
* *
* system name: fix slp06 *
* *
* program desc: fix the records on slp06 *
* *
* program no: ef001 *
* *
* date: 09/09/09 (sadly not at 9:09) *
* *
* author: nick...@projex.com *
* *
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
Fefp01l01 if e k disk infsr(*pssr)
Facsummar uf e k disk infsr(*pssr)
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
* Externally defined file defn's for *LDA and *PSDS
D lda e ds extname(lda) dtaara(*LDA)
D pstat esds extname(psds)
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
/FREE
in lda;
setll l#cono acsummar;
reade l#cono acsummar;
dow not %eof(acsummar);
// get customer order total from work file (efp01) which
// is generated by accumulating OEP65 invoices
chain cusn06 efp01l01;
if %found(efp01l01);
bodv06 = amount;
else;
bodv06 = 0;
endif;
update slr06; // Update Account Balances new Order Total
reade l#cono acsummar;
enddo;
// --- Program Termination ---
out lda;
*inlr = *on;
/END-FREE
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
* standard error handling routine. *
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
/Copy qgpl/qrpglesrc,pssr

Thats the same program in RPG Free Format.

Paroling RPG4 - Step 3 of 4

Upgrade RPG4 to use free-friendly code standards

If we were using Rational Developer/i software we could do this automatically. But as a manual process its simple, if a little tedious. Basically when we are going to skim through the code and replace all indicators with the modern and preferred %FOUND BIF technique:
 
     H debug
      *****************************************************************
      *                                                               *
      *  system name:     fix slp06                                   *
      *                                                               *
      *  program desc:    fix the records on slp06                    *
      *                                                               *
      *  program no:      ef001                                       *
      *                                                               *
      *  date:            09/09/09 (sadly not at 9:09)                *
      *                                                               *
      *  author:          Nick.Litten@projex.com                      *
      *                                                               *
      *****************************************************************
     Fefp01l01  if   e           k disk    infsr(*pssr)
     Facsummar  uf   e           k disk    infsr(*pssr)
     D lda           e ds                  extname(lda)
     D pstat         esds                  extname(psds)
     C     *dtaara       define    *lda          lda
     C                   in        lda
     C     l#cono        setll     acsummar
     C     l#cono        reade     acsummar
 1b  C                   dow       not %eof(acsummar)
     C     cusn06        chain     efp01l01
 2b  C                   if        %found(efp01l01)
     C                   eval      bodv06 = amount
 2x  C                   else
     C                   eval      bodv06 = 0
 2e  C                   endif
     C                   update    slr06
     C     l#cono        reade     acsummar
 1e  C                   enddo
     C                   eval      *inlr = *on
     C                   out       lda
     ?*****************************************************************
     ?*  standard error handling routine.
     ?/Copy qgpl/qrpglesrc,pssr

RPG Three becomes Four - Step 2 of 4

CVTRPGSRC - IBM Command to upgrade RPG3 to RPG4

After running CVTRPGSRC on the old source a new member is created in QRPGLESRC:

      * program to fix SLP06 records
     H DEBUG
     FEFP01L01  IF   E           K DISK    INFSR(*PSSR)
     FACSUMMAR  UF   E           K DISK    INFSR(*PSSR)
     D LDA           E DS                  EXTNAME(LDA)
     D PSTAT         ESDS                  EXTNAME(PSDS)
     C     *DTAARA       DEFINE    *LDA          LDA
     C                   IN        LDA
     C     K01           KLIST
     C                   KFLD                    CUSN06
     C     L#CONO        SETLL     ACSUMMAR
     C     L#CONO        READE     ACSUMMAR                               06
 1b  C                   DOW       *IN06        = *OFF
     C     K01           CHAIN     EFP01L01                           02
 2b  C                   IF        *IN02        = *OFF
     C                   EVAL      BODV06 = AMOUNT
 2x  C                   ELSE
     C                   EVAL      BODV06 = 0
 2e  C                   ENDIF
     C                   UPDATE    SLR06
     C     L#CONO        READE     ACSUMMAR                               06
 1e  C                   ENDDO
     C                   EVAL      *INLR = *ON
     C                   OUT       LDA
     ?*****************************************************************
     ?*  standard error handling routine.
     ?/Copy qgpl/qrpglesrc,pssr

 

As you can see the code if more or less the same, with the exception of few elements to make it more readable.

RPG Evolution and Refactoring - Step 1 of 4

I've recently been writing all my new programs in RPG Free format. Attending RPGWORLD earlier this year, gave me the impetus to finally commit myself to the new and improved style of RPG coding.

I'm currently  in contract at a shop that still has twenty year old programs running in production, the developers still write in RPG3 and shun any development techniques that have been introduced this century. "I havent got time to learn all that newfangled business" is the war cry. "Thats why your code is unreadable, the system runs like a dog, change management is out of control and there are so many bugs" is my silently worded response.

As an RPG programmer I am amazed that other programmers are simply not interested in learning the benefits of the latest generations of RPG. There are lots of flavours and any programmer worth his salt should be proficient in all of them:  RPG2, RPG3, RPG400, RPGILE, RPG4, RPG/Freeformat

I wish IBM had simply named it RPG1-2-3-4-5 but in true befuddling IBM style the Report Program Generators language naming structure is nearly as poor as the naming standards for the System i itself.

Anyway, I digress, my task yesterday was to write a bunch of little utility programs adding up various elements of the JBA Accounts Receivable database to compare values with what was stored in the accounts hierarchy.

For example, "Does the total value of orders actually match all the orders added together?" and "How many invoices and how $much are outstanding this year by month" relatively simple to write and the first program was already written.

This first program was, quite amazingly,  written in 2008! Some programmers are frozen in the land of the 1980's and refuses to move up from RPG3. The old style code works, dont get me wrong, but can be easily upgraded to a twenty year newer version which is vastly more readable, efficient and easy to maintain - in a few simple steps.

Evolution of the RPG programmer

/me remembers back in the late 80's when I was a lad, RPGII was this fantastically exciting thing I learned spending hours and hours and hours reading manuals and staring at these weird HUGE sheets of printed green lined paper with seemingly meaningless code typed on them with dodgy faded dot-matrix printouts.

/me spent many a lunch-hour playing with a huge metal ruler with all kinds of RPG2 column based stuff on it so I could figure out which indicator was where, on the aforementioned dodgy faded dot-matrix printouts.

The AS400, Dinosaurs, Whizzkids and the Plodders

The IBM System i has a strong following, in part because companies have not generally been required to upgrade hardware or software on an arbitrary schedule. This means that many business are running legacy computer applications (for legacy read 'old fashioned') that have typically been running on green-on-black terminals for many years - "if it aint broke why fix it?"

Since the 1990's computer technology has been evolving at an incredible pace. Todays mobile phones pack in far more technology and firepower than a desktop computer from ten years ago. Even your family car with its engine computer and GPS/SatNav is doing these incredibly technological things that we now take for granted.

The IBM System i has been evolving at an equally exciting pace, now with fully integrated website support, FTP, email, support for just about every language and even integrated Windows/Linux Servers. The original programming language (RPG - Report Program Generator) has evolved into this incredibly powerful tool that can write/read websites, do incredibly complex maths and convert data to PDF's and emails and talk to just about any other language on any other platform.

So, "why isnt it being adopted by more business?" I hear you ask.

It's our own fault... IBM are just simply terrible at marketting this machine imho of course so speaking as a Software Developer it's definitely down to us to promote this machine and fantasticly versatile language.

The trouble is that developers, programmers, coders or whatever you want to call it, are a fickle lot....

a little something about me

My name is Nick Litten.

View Nick Litten's profile on LinkedIn

Born in the UK and growing up in a military family, we moved all over England and Europe during my formative years. My early career in IT was mainly based in and around London. It took me nearly 30 years to travel to this side of the pond and discover the Blueridge Mountains. I was hooked and quickly decided to choose Virginia, USA, as home. The Blueridge region is beautiful and it's smack in the middle of the East Coast Technology belt.

I consider myself extraordinarily fortunate simply because I really enjoy my career in Information Technology. I live IT, breathe IT and speak IT - with an English accent mind you! I still fight a a daily battle to prevent myself saying "Hey Y'all".

Current weather

Roanoke, Virginia USA

Overcast
  • Overcast
  • Temperature: 57.2 °F
  • Wind: West, 4.6 mph
  • Pressure: 996 hPa
  • Rel. Humidity: 59 %
  • Visibility: 10 mi
Reported on:
Sat, 03/13/2010 - 11:54

Locations of visitors to this page

Bunch of Twits

  • adds 'Thievery Corporation' to his list of groovey background music to play while programming :) 1 day 2 hours ago
  • is watching very serious blokes playing plastic darts.... wtf is that all about? 1 day 16 hours ago
  • has discovered that his mighty hammer Mjölnir is missing. 4 days 4 hours ago
  • grabs a coffee and settles down for a day of post implementation checks, project closure and user documentation... bah! 5 days 4 hours ago
  • is about to embark on an IHOP pancake eating frenzy with the sprogs... 6 days 4 hours ago
  • just watching tv, a female marine running up a beach, teagan says 'i hope shes not wearing heels because thats hard' ;) 6 days 16 hours ago
  • saturday morning, determined to do no work today just gonna hang out with the kids, walk the mutts, watch movies and vejjjjjj... hurrah! 1 week 1 hour ago
  • is al about rpg3, rpg4, php, asp, IBMi, html, xml, wsdl's and any other acronyms I can think of.... 1 week 1 day ago
  • is pretending to type something important to avoid listening to someone talking a load of codswallop. 1 week 1 day ago
  • see... DOTnetnuke.... Microsoft products make my brain shout 'Uncle!' 1 week 3 days ago

Who's online

There are currently 0 users and 33 guests online.

Syndicate content