Blogs

Some profound changes to RPG

  • Posted on: 25 February 2014
  • By: NickLitten


RPG is a vibrant modern programming language and its getting moderner.

is moderner a verb? it should be :)

If you are an established RPG programmer, its just too easy to use the same old tried and tested techniques when coding. Doing things the good old fashioned way (or perhaps you call it the tried and tested way) generally means no SURPRISE delivering program code to your customers, or Bosses... but... are you taking advantage of all the terrific new opcodes and programming techniques that have been flooding into our IBM i RPG arena in recently?

How do we know whats out there?

There's always the "good ole" RPG Redbook -- Who Knew You Could Do That with RPG IV? A Sorcerer's Guide to System Access and More -- which is probably still the best place to start learning about the more advanced part of RPG programing. This redbook  has a bit of everything. Written for OS400 V4R2 (before the IBM i rebranding?) I think so a fair bit has changed. But it was partly written to show previous generation RPG developers how and why they should make the switch to RPG IV. Even years later, it has some neat programming techniques that still strike me as modern and just plain cool.

HTML for the RPG Programmer - HTML5 the basics

  • Posted on: 30 January 2014
  • By: NickLitten

Over recent weeks I've been discussing career options with my eldest mini-me -- Nathan, who is nearly 15 and at the stage of life where he is asking the "what am I going to do with my life?" big questions.

Obviously, the 'make money in your career' options are "Son, get into Medicine or Law!" but I am obviously biased in my thoughts that you can make a decent living and enjoy laying your hands on a keyboard and sinkning your mind into technology...

An easy way to get into website design and a brilliant over is courtesy of the free online book : "Dive into HTML5".

Example:

What is the best media player for Android, Apple and Windows mobile devices

  • Posted on: 18 January 2014
  • By: NickLitten


So, you've downloaded some video but your standard media player doesnt seem to want to play it?

Video media comes in all shapes and sizes: AVI, MP4, MP5, MOV, XVID, yadda, yadda, yadda

​I cant be bothered with downloading a media player for each format when one player will do the lot. But with various operating systems on the devices in the walls of Castle Litten these are my favorites for my Android Phone, Tablet and also for Windows, IOS7 and Ubuntu Desktops:

For ANDROID the winner is BS PLAYER FREE

bs player free plays everythingSitting on various planes, trains and automobiles this is my favorite solution for watching media. It plays everything!

What is the RPG Open Access Handler all about?

  • Posted on: 8 January 2014
  • By: NickLitten



What is open Access

Rational® Open Access: RPG Edition provides a way for RPG programmers to use the simple and well-understood RPG I/O model to access resources and devices that are not directly supported by RPG.

Open Access opens up RPG's file I/O capabilities, allowing anyone to write innovative I/O handlers to access other devices and resources such as:

  1. Browsers
  2. Mobile devices
  3. Cloud computing resources
  4. Web services
  5. External databases
  6. XML files
  7. Spreadsheets
  8. And more



An Open Access application has three parts:

  1. An RPG program that uses standard RPG coding to define an Open Access file and use I/O operations against the file.
  2. A handler procedure or program that is called by Open Access to handle the I/O operations for the file.
  3. The resource or device that the handler is using or communicating with.

Open Access is the linkage between parts 1 and 2. Licenced program 5733-OAR is required to use Open Access at runtime. Open Access is a full-featured version of the limited support provided by RPG SPECIAL files. It provides a way for RPG programmers to use the simple and well-understood RPG I/O model to access devices that are not directly supported by RPG.

use LIBHTTP to talk SOAP to websites using RPGLE on IBM i

  • Posted on: 18 December 2013
  • By: NickLitten

Thankyou -- Scott Klement!

HTTPAPI (LIBHTTP) on IBM i is the bomb. Luckily I am not boarding a plane at the moment, so I can use that kind of language without getting strip searched by some burly TSA agents.

Firstly, I have never met Mr. Klement but (like almost every IBM i Developer out there) have read many of his excellent articles about programming and tinkering with IBM i systems. Secondly, the man is a genius and I owe him a very large beer. After spending far too long investigating various techniques to get my IBM i system to talk to an external website (Authorize.net in this case) and being led down many wrong roads... I stumbled across scott's collection of open source RPGLE programs called HTTPAPI.

In Scott's words:

Download HTTP API source:

This is an RPG IV service program that uses socket calls to implement the HTTP 1.1 protocol. The HTTP protocol is the data transfer protocol that is used to transfer documents over the World Wide Web.

This service program can, optionally, also do "https" (HTTP over SSL) requests to an SSL-enhanced web server.

Alas Poor Boris... aka... DEATH of a Landrover

  • Posted on: 12 December 2013
  • By: NickLitten

 

This mornings refusal to start (again!!!) was the final straw!

 

NOTE ADDED MAY 2014: A few people have asked me how I get him to start each time. It's simple, but very annoying, embarrassing and just plain irritating. Simply pop the bonnet (American translation "open the hood") remove the first spark plug connection, return the car and turn it over... it will normally start... leave it to run for 10 seconds or so.... carefully reconnect the spark plug without getting a zap on your fingers and you're off...  now back to the story of why I killed Boris..

So, after doing the sums and realizing that I've spent nearly fourteen thousand dollars on repair bills since owning this Landrover in just two years, and he's still going wrong on a regular basis, its time to give up.  To resign myself to the sad decision to banish Boris to a life in the wilderness, outside the walls of castle Litten. I havent got the heart to sell the car to another owner, or even to trade it into a dealer and be able to look someone in the eye while saying "Yes, this is a reliable little motor and I will be sad to see it go" so its time for the car auctions.... Everybody knows that its a case of 'buyer beware' at Auctions. You can get a steaming deal or a steaming Turd. I know which category I wold put Boris into  :)

Talking to Authorize.net using XML, RPG from IBM i

  • Posted on: 30 November 2013
  • By: NickLitten


So, for the last few weeks I've been working on adding credit card handling to a legacy RPG application with an static HTML website over the top. The application code itself was written in the eighties and has evolved through a number of different versions of RPG (a mix of RPG2, RPG3, RPG400 and even a liberal splash of RPGLE) so I've had an enjoyable task of taking a bunch of old code, re-factoring to RPGLE/free and then adding some funky web services.

Now I've added the Authorize.net CIM functions and windows to my website pages, I can manually test the payment process. Now, the authorize.net documentation is not for noobs and makes an awful lots of assumptions, so implementing this technique on IBM i (AS400) using RPG, without a modern PHP Server on the front, is not as clear as it seems. After reading everything I could on the various SOAP, XML, JAVA, RUBY techniques - I've opted for the XML route.

The next step is setting up the XML conversation to this lovely IBM i System talk to Authorize.net. After two days of googling, reading, studying, prototyping, re-prototyping, going down dead ends, trying sample code that doesn't work and repeating moaning and smacking my forehead with a wooden paddle.

So I want to

Latest version of RPG is RPG7.1 right?

  • Posted on: 13 November 2013
  • By: NickLitten

 RPG is not a Rocket Propelled Grenade

RPG2 is that Logic Cycle Thing

RPG3 is the System/38 version

RPG400 is the revamped RPG3 that came with AS400

​everything after that is RPG... unless its ILE then its RPGLE or sometimes RPG4, or its free format so its RPGLE /Free... or its SQL so its RPGSQL or SQLRPGLE... or as many people call RPG/Free - RPG FIVE..... aaaargh

Why doesn't IBM just have a simple version number for each iteration of the wonderful IBM RPG programming language?


IBM i 7.1 Technology Release 7



I love the enhancements to RPG with IBM i V7.1.7. RPG finally looks and reads like a normal modern language. With the advent of this latest version of IBM i, RPG has been neatly upgraded to be a fully free format language. This is a long overdue and a significant change to the language itself. 


Upgrade my written CV to an 'Infographic Resume'

  • Posted on: 9 October 2013
  • By: NickLitten


The peeps at Vizualize.me say:

We believe that the traditional text resume is boring, lengthy and long overdue for a makeover. We are creating an online resume format that is beautiful, relevant and fun. We want to enable people to express their professional accomplishments in a simple yet compelling personal visualization. Our vision is to become the future of resumes.

Sounds groovy right?

The Vizualize website is in open Beta testing so I had to go and have a look... and its brilliant. Within seconds I had clicked a button to login with my Linkedin profile and the Vizualize website simply asked me if I wanted to import my resume from Linkedin and BOSH! It created this awesome infographic, with a cool URL (http://vizualize.me/nick.litten) and active pop-ups showing my work history.

IBM RPG sub-procedures are very saucy indeed

  • Posted on: 25 September 2013
  • By: NickLitten


This morning I got question from an old RPG3 chum of mine:

I know a couple of questions they will ask me, what are the different parms used on sub-procedures like *OMIT/*Nopass. Didn't we use those any way? I thought we were writing programs that did or did not necessarily get parms depending what called them using those keywords? To be honest, I know I can look it up but what the bloody hell is a sub-procedure?

My answer started off little then got into the huge waffling email stage. Bear in mind this is a very high level overview and not designed to get into the nitty-gritty of anything. Anyway, I just decided to copy/paste it here for future reference.

 


 

*OMIT/*NOPASS makes parameters funky

*OMIT - Lets you send a parameter as a value or as *nulls

Lets you use the *OMIT keyword when calling you program. So, if you just dont want to pass anything, you can say *OMIT - I think it just passes *NULLS and in the program that is being called you would say something like 

if %addr( parm1 ) = *NULL ;
  parmvalueinprogram = 'something';
else ;
  parmvalueinprogram = 'parm1';
endif ;

 

*NOPASS - lets you just neglect to pass anything at all

Don't even bother.  I think it just passes *NOTHING and in the program that is being called you would say something like 

Pages