My Blog

CL Outfiles are like totally last year, Dude!

Using the internal cross reference files mean that us lowly IBMi Programmers can access heap of system information just by reading a file... the days of DSPFFD to an outfile then reading the outfile are long gone - we can just read the file field information direct from QADBIFLD instead...

There are eight cross-reference physical files, each containing a different type of information.

How do I right adjust a numeric into an alpha field using RPG4?

I have a NUMERIC in an RPG program that I want to move RIGHT into an Alpha field. In the old days of RPG3 I would use MOVE but in the new days of RPG4 I have a couple of more flexible solutions.  So, lets say we have a numeric field containing the number 1234, defined as an signed numeric 10 long it would be stored as - 0000000123. And a Result field which is a big long alpha field:

d $Numeric          s             10s 0 inz(1234)

d $Result           s             10a   inz(*BLANKS)

Some programmers will forget that $variable = $something else is actually eval $variable = $something because the eval is silent  :)
We have two easy ways of transforming using RPG4:

With Zero Suppression

If we want to be  tranformed right justified  as  '          1234'' then:

Eval(r) ResultVariable = %char($Numeric);

Note that the %CHAR %BIF will zero suppress the front of any numeric value.

Without Zero Suppression

Droid Razr HD - Coming to Verizon Oct 18th?

I remember my Nan and Grandads bakelite phone

I've rarely been as excited to get my hands on a new phone as I have been since the announcement of the Motorola Droid Razr HD model.

According to Droid-Life, whispering points to Motorola and Verizon targeting October 18th as a release date for both the Droid RAZR HD and the Droid RAZR MAXX HD.

...the RAZR HD and RAZR MAXX HD both tout a 4.7-inch 720p Super AMOLED HD display and 1.3-megapixel camera on their faces, as well as an 8-megapixel shooter around back. The two phones also feature 1.5GHz dual-core processors, 1GB RAM, Verizon 4G LTE connectivity, Motorola's Smart Actions software and Android 4.0.4 Ice Cream Sandwich, with an upgrade to Android 4.1 Jelly Bean coming before the end of 2012. The differences between the two phones involve battery size and storage. The RAZR HD features 16GB of memory while the RAZR MAXX HD packs 32GB of storage space (both have microSD slots), and the RAZR HD has a 2,530mAh battery while the RAZR MAXX HD's battery is 3,300mAh...

Doing Loop the Loops in RPG3 and RPG /Free

So, whenever possible, if I'm editing some old RPG3 or RPG400 code I spend a coffee* cleaning the code up to a more readable form:

  • Use CVTRPGSRC if its old RPG3 stuff
  • Change '1' to *ON
  • Change '0' to *OFF
  • Change Z-ADD to EVAL
  • Insert comments where applicable
  • put some spaces between subroutines and blocks of functionally similar code
  • Then its into WDSC7 and convert to /FREE

Websphere is old technology but I'm not going to spend over $800 on IBM's Rational Developer for i version... c'mon IBM come up with a sensible price for a source code editor. Obviously, the most sensible is FREE.

DO LOOPS are something that sometimes make me scratch my head when uplifting to RPG4. So just for my reference here is an example of the exact same code in RPG3, RPG400 and RPG4 (or RPG ILE as its sometimes called).



             DO        SAVRRN        X
             MOVE      PLOP          THING
X            IFGT      10
FIELD1       CAT       FIELD2        RESULT      



Whats better - Hard work, Knowledge or Attitude?

Here is a little something a friend sent me that is indisputable mathematical logic. Nerdish and silly but I suppose it appeals to the dark mathematical side of my soul. But the message is very true.

It goes like this:

What Makes 100%? What does it mean to give MORE than 100%? Ever wonder about those people who say they are giving more than 100%? We have all been to those meetings where someone wants you to give over 100%. How about achieving 103%? What makes up 100% in life?

The new NICKLITTEN dot com is gonna be whacky for a few days

Fear no Eval for RPG Programmers

I've been busy doing real work the last few evenings and seeing my wonderful kids (but HEY I'm biased) so the time I had planned for this website revamp has just kind of drifted away like smoke through my fingers. I managed to grab a few hours this evening and have just completed the Drupal migration from my old domain, upgraded all kinds of bits, SQL'd other stuff and broken all kinds of rules, utterly destroyed the Drupal Database integrity but luckily with some massaging and praying to Shiva (as I understand it he's the God of Destruction and Reinvention, so is the top man for this website gig) I think I've got closer to a working website condition.

some dodgy redneck bed - all squished

I could leave it in Maintenance mode but then its difficult to track the effects of my Google/Bing/Blekko SEO effects....

Anyway... decided to turn the website on just a few minutes ago. So here I am in a redneck (Hmm, maybe I had better be careful what i say around here. If I listen careful I can hear the plaintive 'sproing' of Banjo strings blowing in the wind) Country (ahhh, thats safer) Motel in Virginia at 1.15am on a Friday night, or Saturday morning depending on how you look at it.

I'm tinkering with my laptop when I should be curled up in that wobbly bed behind me...


Theres a good idea...

How can I update Turnover V100 iSeries Client?

Turnover (from Soft Landings Inc) is a pretty cool Software Change Management system running on iseries IBM i.

Arguably its best in class and certainly my preferred SCM tool. Saying that, the old 5250 (green screen) functions are frustratingly lacking in some areas where the company has obviously decided to only focus continued development on its Windows client - Turnover for iSeries.

when does iseries become IBMi

[quote]It's not Turnover for iSeries, its Turnover for IBM-i! Would you sell a Windows package and sell it as Turnover for DOS or maybe Turnover/XP?[/quote]

But, the Windows client is based on the Eclipse IDE and its pretty neat. It's regularly updated, but you need to know how to grab the very latest updates. So here you go.

I recorded this little screen cast with the excellent freebie JING from Techsmith but didn't record any sound... because I am huddled in a super quiet little Dilbert cubicle and it may have awoken my fellow programmers.

The important piece is this URL -

Projex4i New Version - The Community Edition is coming

Projex4i is a free premium IBMi AS400 application for developers

So, I've decided its time for me to step up to the plate (to use a strange Americanism) and get ready to take Projex to the next level...

*Deep Breath* 

I'm at the final part of a major product re-write for PROJEX4I and a new version should ready to be released within two weeks. Projex4i has had over 500 downloads and some great feedback, ranging from critical reviews to glowing ones. Even the odd offer of a beer or two  :)   This has got me to thinking about how to find the time to create some of the funkier utilities I have floating around in my head. So, I think its time to monetize the application and offer Developers Tools that are comprehensively packaged in one easy to access application. Ultimately, the focus is on making tasks easier, therefore timesaving and giving something back to the IBMi community as a whole.

Which Came First, the Apple or the Cray?


Apple Computer purchased a Cray supercomputer in the mid-1980s. According to Legend, Steve Jobs was Cray’s first and only walk-in customer. He arrived unannounced (so the story goes) at Cray headquarters in Mendota Heights, Minnesota and asked to speak to someone about buying a Cray. They nearly threw him out. It’s only slightly less eccentric than someone walking into NASA’s Johnson Space Center and inquiring how to purchase a shuttle orbiter.

Later, Cray’s president John Rollwagen phoned Cray’s CEO Seymour Cray and told him that Apple had just purchased a Cray that would be used in designing the next Macintosh. Seymour thought for a bit, and replied that that seemed reasonable, since he was using a Macintosh to design the next Cray!

New Discovery on Mars: Positive Evidence of IBMi Life!

Positive Evidence of IBMi Life on Mars!

HOUSTON, TX - Scientists rejoiced on Friday after learning NASA’s Phoenix Lander photographed what appeared to be evidence of life on Mars. At first inspection of the photo there seemed to be nothing remarkable about it.

However, when magnified several times, it became clear there was something more than just rocks and sand on the Martian surface.

Peter Smith, the University of Arizona researcher who leads the Phoenix mission’s science team, announced late Saturday that colleagues were convinced that the apparent life forms were trying to communicate with the Phoenix Lander, although at this time it is only speculation.

“To me personally, it was such a thrill to find such strong evidence of life. I was disappointed at the references to the IBM i, since I am a Unix man myself. Still, I’m just sitting on the edge of my chair waiting to see what the Phoenix Lander will reveal to us next.”

The Tale of the IBM vs. Microsoft Programmers

Three Microsoft software engineers and three IBM software engineers are traveling by train to a conference. At the station, the three IBM software engineers each buy tickets and watch as the three Microsoft software engineers buy only a single ticket.

“How are three people going to travel on only one ticket?” asks one of the IBM programmers.

“Watch and you’ll see,” answers the Microsoft programmer.

They all board the train. The IBM software engineers take their respective seats but all three Microsoft software engineers cram into a restroom and close the door behind them.

Shortly after the train has departed, the conductor comes around collecting tickets. He knocks on the restroom door and says, “ticket, please.” The door opens just a crack and a single arm emerges with a ticket in hand. The conductor takes it and moves on.

The IBM software engineers witness all this and agreed it was quite a clever idea. So after the conference, the IBMers decide to copy the Microsofties on the return trip and save some money.

When they get to the station, they buy a single ticket for the return trip. To their astonishment, the Microsoft programmers don’t buy a ticket at all.

“How are you going to travel without a ticket?” asks one of the perplexed IBM employees.

“Watch and you’ll see,” answers one of the Microsoft programmers.

the laughing IBM boardroom commercial

However you feel about the IBM AS400 platform, one thing remains clear - the machines ability to sit and chug away for days, weeks, months and years with little or no user interaction. I've worked at many sites where the an old AS400 or iSeries machine has been quietly whirring away in the corner of some office and running the core computing business for the company.

Compare this model to common Windows Servers with the army of IT technicians servicing the software...

<iframe width="480" height="360" src="//" frameborder="0" allowfullscreen></iframe>

How to use Smileys correctly

smile youre on camera

:-) Smile

(-: User is left handed. 

%-) User has been staring at a green screen for 15 hours straight. 

:*) User is drunk.

[:] User is a robot.

8-) User is wearing sunglasses.

B:-) Sunglasses on head.

::-) User wears normal glasses.

B-) User wears horn-rimmed glasses.

8:-) User is a little girl.

:-)-8 User is a Big girl.

:-{) User has a mustache.

:-{} User wears lipstick.

{:-) User wears a toupee.

}:-( Toupee in an updraft.

:-[ User is a vampire.

:-E Bucktoothed vampire.

:-F Bucktoothed vampire with one tooth missing.

:-7 User juust made a wry statement.

:-* User just ate something sour.

:-)~ User drools.

:-~) User has a cold.

:'-( User is crying.

:'-) User is so happy, s/he is crying.

:-@ User is screaming.

:-# User wears braces.

:^) User has a broken nose.

:v) User has a broken nose, but it's the other way.

:_) User's nose is sliding off of his face.

:<) User is from an Ivy League School.

:-& User is tongue tied.

=:-) User is a hosehead.

-:-) User is a punk rocker.

-:-( Real punk rockers don't smile.

:=) User has two noses.

+-:-) User is the Pope or holds some other religious office.

`:-) User shaved one of his eyebrows off this morning.

Recycle Your Old AS400

recycle your old as400


Rochester, MN - As you know, IBM is a politically correct and an environmentally conscious company.

Because of the success of the new System i and i on Power systems there has been a growing surplus of the old model AS/400s. With the concerns of overburdened landfills and in this age of recycling and protecting our environment, IBM has announced a new program for recycling these older AS/400s. The program is called RECYCLE/400.

For a minimal fee IBM will take your old AS/400 and convert it to a useful product.

You can choose from the following list:

  • metal rhino
  • clothes hanger
  • cutlery
  • rabbit cage
  • fishing hooks
  • tanning booth
  • landrover bonnet
  • highway crash barrier

Convert RPG %DATE into a signed numeric

To convert a DATEFIELD to this 8s0 field with no ‘/’ or ‘-‘ do this:



D  USADate                    8s 0

USADate = %dec(%char(DateField:*iso0):8:0);


Or another even neater function is this:


USADate = %uns(%char(DateField:*USA0));


I prefer this %UNS built in function, since it does not require me to specify length and decimal position parameters. 


What is %UNS?

%UNSH (Convert to Unsigned Format with Half Adjust)


%UNSH(numeric expression)

%UNSH is like %UNS except that if the numeric expression is a decimal or a float value, half adjust is applied to the value of the numeric expression when converting to unsigned type. No message is issued if half adjust cannot be performed.



Can I upgrade JBA SYSTEM21 from IBM-i v5r4 to V6 or V7?

Just what is JBA anyway?

JBA Softwre Company from BirminghamThe JBA ERP system is a 30 year old Enterprise Resource Planning system running on IBMi operating system (an on the earlier i5/OS and OS400 versions). I can sense your eyebrow raising when you read "30 years", but think of it as a system that has evolved for thirty years and grown incredibly. Originally developed and distributed by UK based company JBA (from in-house developed system called Olympic and also by blending in field developed products from many client sources). The entire product line was later bought and distributed by GEAC in the USA. Following the demise of GEAC the latest and greatest version is (at the time of writing) provided and supported by Infor.

  • The older JBA/GEAC versions of System21 and all related apps will run on any system upto and including V5R4.
  • The current version of System21 is called Aurora, supplied by Infor and runs on all the latest version of IBMi (currently IBMi Version6 but Version7 is in beta so watch this space)
I think that the last version of JBA System21 was V3.5.2 and this was the basis for the new improved Infor version. From what I understand, the Infor version is a total conversion of all the old System21 OPM RPG source Code to ILE RPG and recompilation. Infor has also added lots of new web-friendly components and modernised the entire package for the new millenium.

infor system looks good

What OS versions will JBA run on
  • JBA System 21 will run on all versions upto and including v5.4
  • Infor Aurora will run on all version upto and including the current version.
Upgrading to V6 is as big an upgrade as the old Cisc-Risc upgrade in the mid-nineties and requires programs to have their observability included in the object description to process each object as part of the upgrade. 

sync podcasts between devices

Surf over and sign up for the GPODDER.NET service at


On your Android

Install application called GPODDER.NET ACCOUNT

goto settings | accounts | add account | gpodder - and enter your information. the default device name is 'podax'

then goto tgpodder website and add your device and you are all set.


Install PODAX

​PODAX will synchronise your subscriptions... 


This will end up keeping your Android Device and your Desktop/laptop/kneetop/whatever synchronized....

add days to 100 Year date from EXCEL using RPG

vintage computing

So, we had a file coming in from an external partner today – containing a date in Julian Format. Or what I initially thought to be Julian format. 

[quote=Some Website Out There]Many applications (especially mainframe systems) store dates in the Julian format, which is a 5 digit number, consisting of a 2 digit year and a 3 digit day-of-year number.   For example, 24-August-1999 is stored as 99236, since 24-August is the 236th day of the year...[/quote]

Then when I looked at the date in question I realised the value was 42345 but this was representing an actual date of December 8th 2015! So, this clearly isnt a Julian date... Hmmm...

Cutting to the chase, it turns out that this date is stored in what the customer refers to as '100 year date format' which is basically the number of days since the last day of 1899. Which just goes to show that those crazy Victorian's where utter whackjobs. 

Luckily its simple to figure out programmatically using RPG4: