My Blog

IBM i is a radio star

This morning I was hammering at my keyboard while listening to a weekly podcast from BBC Three Counties radio (my old local radio station back in Blighty). The show finished before I could get my cunning IBM i Journal Trigger process working, so I decided to take a coffee break and download a fresh podcast or two. I fire up Juice and spend a few minutes surfing to find something new to burble away in the background, titillating my back brain while my front brain was in RPGLE programming land.

Imagine my delight when I stumbled across an IBM i specific podcast!

Quite remarkably, its been out there since July 2011 and its none other than the chief i-architect at IBM - Steve Will

Life with Bailey the English Springer Spaniel

This is Bailey Version 2.0

bailey the springer spaniel after his first haircut

He's my wing man and constant companion. He never nags, never complains and is always thrilled to see me wether I have left him alone for a minute or for a day. To test if your dog loves you more than your wife - trying locking your pet and your wife in travel cage, in the hold of a plane, for 6 hours. See which one is more pleased to see you when you land. To test if your dog loves you more than your husband - try taking him to the Docs and getting his balls snipped off and then see how pleased he is to see you.

How do I check for numeric values using RPGLE?

IBM RPG is a lovely language.

RPGLE (as the latest version is known) has got some heritage. Some might say its an old language, but it's kept young by its constantly evolving syntax. The current version of RPGLE (IBM i V7R1 at time of writing this) has free form code, multitudes of built in functions and handles big system database crunching with as much ease as it handles little web page servlets. RPG's evolved over 20+ years from an archaic and mystical thing bound by the rules of something called 'the logic cycle' into the modern power language for all IBM i Systems everywhere.

Personally, I find a few of the older functions still a bit annoying and wish there was a nicer way of handling them.

In this case, it's time to convict RPGLE's ability of checking data variables to see if they contain numeric or alphanumeric variables:

Your Honor - I present the defendant: TESTN

TEST(N) Is just a little bit smelly when it comes to really/truly finding out if a field is numeric or not.

PDM user defined options

Brief: PDM's user-defined options can enhance your productivity by reducing the need to key frequently used commands. This article offers some practical tips on how to implement user-defined options into your programming environment.

PDM's predefined options allow you to perform various tasks against libraries, objects, and members. But did you know that you can create your own user- defined options to execute almost any command including your own? You can also optionally, have PDM fill in or prompt command parameters.

User-defined options save you from having to enter frequently used commands. For example, if you often key the Work with Spooled Files (WRKSPLF) command, you could save time by creating a user-defined option called SP. Then, when you need to access your spooled files, you can use option SP. In this article, I'll give you some tips on configuring and using PDM's user-defined options. For additional information on using PDM, see "Getting the Most Out of PDM," MC, July 1992.

Creating an Option File

IBM. IFS. DLS. DOS. WTF?

So, an old colleague of mine just asked me:

Going to need your help here, it occurred to me that we don’t have a plan for backing up those Vendor Schedules we turned into pdf’s on the DLS a while back. QDLS is easy but IFS, well same thing really without the restricted dos naming but finding them is a bit more humpty than finding your folder in the QDLS. 

Can you either help me on what command I can use on IBMi to review folders with vendor looking documents in them or as I should have access to the network, any clues on a path that should work ?

Here is my email reply - remember this is all very much IMHO - Neatly copy/pasted into this blog in case it helps anyone else out there in IBM-i-land:

IBM i Emails with IFS attachments from RPG and CL using SNDSMTPEMM

Life as a IBM i Software Developer is fun, but life as an AS400 software maintenance programmer can be a bit a grim.

I seem to spend the bulk of my time maintaining older applications - archaic code monstrosities that started life in the AS400 generation. "The AS400 generation?" You remember these days in the early 90's when email was a new an exciting thing, Yahoo was the search engine of choice and the phrase 'social networking' hadn't been dreamed up. So, when I find that a new exciting snippet of IBM i Software has slipped passed my radar it gets me all twitchy.

Guess what I found out today?

SNDSMTPEMM is a native IBM i command that will send emails with IFS attachments!

By native I mean, it comes quietly packaged with the operating system. I can now send emails from within RPGLE programs or from the command line by simply entering the command. I can attach any kind of files from the IFS (PDF, TXT, HTML, XML, yadda yadda) and I can even format the body of the emails using HTML to make it look all pretty.

Land Rover LR3 V6 2006 - the Big Boris Breakdown

The Full Boris

This damn problem has been going on forever. I’m sick of it. Sick sick sick bleeuuuuurgh!

So come on people… someone out there must have a solution? It’s a totally weird starting problem but at least its now showing a repetitive solution. So lets go through it in clear English (well as clear as I can make it) and perhaps… just perhaps someone will kindly put me out of my misery.

CARFAX Vehicle Description: 2006 LAND ROVER LR3 SE

VIN: SALAD24436A347352

Body Style: 4 DR. WAGON/SPORT UTILITY

Driveline: ALL WHEEL DRIVE

Engine: 4.0L V6 FI

Here we go:

This starting problem is utterly random. It might work perfectly for days, weeks on end then suddenly refuse to start. It happens when the car is hot, cold, wet, on a hill, in the sunshine, in a garage, while refueling or anywhere at any time basically. When the car is running it runs perfectly. When it starts it starts perfectly. It never misfires or does anything else naughty.

When the car is refusing to start – it will totally refuse to start. I have tried setting the alarm, immobilizer and even opening manually with the key override. Boris will not start.

I have tried leaving the car for an hour and then trying again. Boris will not start.

Recharging the English with podcasts

I love living in the USA.

The weather is fantastic, people are friendly, I can see palms trees out the window, petrol gas is cheap and I can own a gun. Life is good.

However, I've been here over four years now and I've definitely noticed that I'm picking up a few verbal american'isms. I find myself developing a transatlantic inflection on many of my speech patterns. I'm frequently asked either (a) "Are you Australian?" or (b) "My cousin lives in England - do you know him?". Luckily, the answer to both questions is "No"

I regularly recharge my English Accent Batteries by listening to podcasts from the BBC. A fun alternative to the incessant twang of country music geeetars on my local radio. If you haven't played with podcasts yet grab yourself a free podcast listener like Juice (or even iTunes if you have gone to the dark side) and click one of the links below.

Enjoy.

The big list of most excellent British Broadcasting Corporation Podcasts follows:

 

Dirty Hack of the WDSC Turnover V100 plugins

It's Dirty but it works!

So this is a technique that I discovered while trying to get WDSSC7.0.0.8 working with the April 2013 build of Turnover V100 Windows Client. This works but I wouldn't recommend it as this is a much simpler solution. Well.. while we are waiting for Unicom to release a backward compatible plugins selection for Turnover V100. Assuming they ever will of course :(

If you absolutely must have the latest iteration of the standard Turnover V100 client - then you could try this. I wouldn't recommend this technique as it is blending both versions, but it does work. Use at your own risk.

But wait we can trick it into working with our old WDSC install. It's fairly straightforward but a little fiddly:

  1. Install WDSC
  2. ​Install the latest V100 Client
  3. Replace the Plugins from this new V100 client with the *older* ones
  4. Tada! It works lovely... maybe... try at your own risk  :)

Ready?

Then lets go...

 

Fix WDSC Turnover V100 extension problems

Having Extension Problems?

Did Viagra not help in any way shape or form?

Then you have come to the right place.

If you are seeing compatibility errors, perspective crashes or white screen of death when trying to open Turnover from within WDSC then this might just help. I've had a horrible time trying to get WDSC7 Turnover Perspective working when using the latest download of the Turnover Client.

turnover error

I finally figured out a simple way of fixing it (detailed here) and also discovered a more complicated and dirty way of getting it to work (at the bottom but not recommended)

Problem

If you install the latest 2013 version of the Turnover Client - you will soon find it does not support the old WDSC7. It seems that it supports the newer IBM Rational Developer product line, and compatibility with WDSC has ben rudely thrown in the trash.

Solution

F$%#^K#$ing Landrover LR3

I am angrier than an angry bird.

I am angrier than a very Angry Bird.

Boris the Landrover is once again proving that it can refuse to start in nearly every State in the USA...

What makes it worse is that last Friday - I just got it back from the Garage who happily told me the problem was fixed. "A new battery, alternator and a full service will do the trick" I was happily informed. More dollars came spilling out of a wallet that was already empty and filled with dust and cobwebbs.

For a glorious five days he has been running nicely and I've been all happy thinking the curse has finally been broken.

But... *sigh*... BUT.... it firking hasnt.

Today its back!

AAAAaaaarrghrghrghgrhrgrhgrhrgrhgrhrgrhgrh
 

The power of Christ did not compel these engine demons to leave  :(

How to add the Turnover V100 Perspective to WDSC7

OK.

So we already agree that using WDSC for IBM i software editing, for free, is pretty cool. But, adding Turnover V100 to it, so you can do everything from one place is even cooler. Once we have added the Turnover perspective to our existing WDSC7 setup then we can flick between perspectives to edit/compile source code, then check in/out of turnover worklists.

 

1 - Install WDSC

I am going to assume you have already done this. If not then just follow these instructions. Come back here when you're done

 

2 - Install Turnover V100 Client

Run the latest Turnover Client Install from your V100 ISO Disk or download it from http://support.softlanding.com  

note: the client software is in the DOCSCLIENT.iso and can be found here \Clients\Software - ISO 9660 archive, unpacked size 290,146,213 bytes

To install just execute the T100client.exe:

Turnover runs on IBM i not on 'iSeries'

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

NOTICE FOR SOFTLANDING SYSTEMS You are marketing your Change Management Product as 'Turnover for iSeries V100'. But IBM no longer sell the iSeries systems. In fact, IBM haven't sold this machine for a few years now and as we all know - a year in IT is a decade in the real world.

The hardware is the IBM Power System and, as we all know, the operating system is IBM i.

So, isn't it time to rebrand your change management software and call it - Turnover for IBM i V100?

when does iseries become IBMi

Caveat Emptor with Boris the Landrover LR3

Just like Lazarus, Boris lives!

After last weeks engine death – well kind of choking spluttering whimpering suicide - I waited for the AAA recovery truck and had Boris truck to a local garage that foolishly admitted to working on Landrover. All the time thanking the Gods that I signed up for AAA car recovery last year.

Anyway, the garage called me last night confidently saying  “Boris is fixed! It was the alternator, which was shorting out and causing the electrical glitches. It finally died, caused a direct short which drained the battery in a minute flat and this caused the breakdown”. Now a more skeptical man than myself may not believe this explanation. I know for a fact that all these engine problems over the last two years are down to the engine being haunted, and not due to any physical problem on this plain of existence. But, as they also told me it has cost me $720 and that includes a new battery, alternator, oil change and mini-service – well who am I to complain?

But I’ve been here before haven’t I?

So, lets review the number of visits to a garage (or *shop* as you yanks say) since that cursed day in September 2011 when I took ownership of Boris the Landrover:

Stop spam users from registering drupal accounts

stop drupal spam

If you have a Drupal website then you will be well aware of the near daily battle with annoying spam trying to get a free ride of your sites visitors.

Obviously, I'm not talking about the delicious pinkish world war two meaty thing made of Pork, water, sugar and some starchy stuff... but instead, I'm referring to those annoying little people submitting links to their porn, holiday, credit card and dating websites.

I've tried Mollom, CAPTCHA, ReCaptcha, AntiSpam and just about every spam module out there over the years... but I do believe I have now found the right balance.

So if you're using Drupal then what modules do you need to download?

Mollom 7.x-2.7 Automatically moderates user-submitted content and protects your site from spam and profanity.

Mollom is an "intelligent" content moderation web service. By monitoring content activity on all sites in the Mollom network, Mollom is in a unique position to determine if a post is potentially spam; not only based on the posted content, but also on the past activity and reputation of the poster. In short, Mollom handles incoming posts intelligently, in much the same way a human moderator decides what posts are acceptable.

Is this it? Did Boris finally die?

An excruciating new chapter in the Book of Boris (no relation to The Book of Mormon)

Land Rover being TowedDriving to a client office today all hell broke loose on the dashboard... every warning light blinking, alarms sounding, star-trek doors whooshing open and closed and phasers set to KILL! Engine computer was reporting suspension failure, HDC failure, break failure, *everything* failure... after swearing loudly I managed to quickly pull into a Shell Station which was conveniently only a hundred yards down the road.

Boris quietly pulled up to a pump.. before spluttering and dying.

Insert Key and absolutely nothing happens.

Pop open bonnet (which is a hood to you Americans) and only a faint whiff of electrical burning smell. *gulp*

I'm typing this after it was towed off to a local garage for investigation.

*sigh*

If I had started numbering my vehicle breakdowns over the last two years I wonder if this one would have put me into treble digits?

 

CKEDITOR and JQUERY mismatch between versions

stuck between iraq and a hard place

This week I have been mainly using ERPAL.

If you have no point of reference with 'The Fast Show' then just ignore this and read on...

So, I've been playing with Drupal and the wonderful ERPAL Project Management module this week - I found an annoying problem where I thought I was caught between a rock and hard place. It seems that CKEDITOR 4.x needs JQuery 1.5 to work properly. But JQuery 1.5 gives me problems with some older browsers that my client is using (IE7/8) so I switch to JQUERY1.8 and the site looks good in IE but suddenly CKEDITOR it not working. Aaaargh...

Luckily, by an act of extremely good timing, the latest DEV version of JQUERY UPDATE adds the ability to switch between JQUERY versions when in normal and administration modes. So, by downloading and installing the dev version from 2013-May-02 (http://ftp.drupal.org/files/projects/jquery_update-7.x-2.x-dev.tar.gz) this lets me specify a version for the main site and a older version when in ADMIN mode.

Once you installed the Update goto http://your-site.com/admin/config/development/jquery_update

bloody nails

Driving home and suddenly the dashboard lights up with warning lights telling me about a suspension failure!

"Oh No" I think "Not that bloody air suspension stuff I had replaced last year"

The lights continue to blink with various warnings to 'slow to 30 mph' and 'grip the steering wheel as tight as possible in case I explode into flame and roll down the road like they do in the movies' (not really... I made that one up... the one about 30 mph). But, anyway, when I had a chance to pull over and investigate I discovered things weren't quite as bad as expected and the very clever engine computer had detected that it had suddenly lost air pressure in the rear drivers side tire.

Blame this on one big fat nail:

oh dear

So, things aren't as bad as they could be and its time to spend an hour with Litten Junior and teach him how to change a tire on a Landrover   :0

Less haste and more speed

John Donahoe

It's not often I blog about somebody elses blog... is that Blogging2?

But this morning I read this excellent article by John Donahoe, CEO of Ebay. Titled 'To Beat the Chaos, Take a Thinking Day', John explains that modern business often moves at such a pace, we find ourselves washed along in the frenzy of the tide. Taking time to step back, and review the global picture of what we are working on and what we have scheduled ahead might bring fresh insights.

I for one, am sometimes guilty of diving into the technical nitty-gritty of a project and hitting a wall at a later point. Often times, these walls could have been avoided if I had just stepped back and looked ahead on the 'virtual map of whats coming up'.

I really enjoyed reading this - smart advice:

One of the most under-discussed elements of effective leadership is how fast a leader must learn to stay at peak performance. Most successful leaders never stop learning. In fact, they are voracious learners who are always trying to find ways to improve and enhance their own performance and that of those around them.

SQLRPGLE getting a count with variable file name

as400 squirrel

Been having fun with SQL and RPGLE this afternoon... the question was "how do I find out if and how many Policy numbers exist in one of the Policy files at any given time?" So, this meant using a variable file name in the RPG code, with a variable policy number. Took some playing but it looks like this:

A Dynamic SQL statement with a variable file name in RPGLE

/free

wSelectStatmnt = 'Select Count(*) '
 + 'From ' + %Trim(wInpFileName)
 + cBlank
 + ' Where LsPol# = '
 + cSqlQuote
 + %Trim(IwPol#)
 + cSqlQuote;

exec sql prepare stmt from :wSelectStatmnt ;

exec sql declare C1 cursor with return to client for stmt;

exec sql open C1;

exec sql fetch C1 into :wNumClaims ;

Dsply wNumClaims;  

exec sql Close C1;

/end-free

Pages