February 28, 2007

It's just struck me that as from the 19th, I'll be working somewhere that doesn't have an AS/400 for the first time in nearly twenty years. Gulp.

I still get Synon/2E gig offers all the time. Here's why.

Posted by Simon Brunning at 01:44 PM | Permalink | Comments (0)
July 04, 2005
iSeries Open Source

I have a spot of '400 work to do. It sounded a bit daunting to begin with; I need to make an HTTP request and look at the response. Doesn't sound too hard, does it? Bear in mind, though, that I have to use RPG, and that RPG doesn't come with support for anything above the level of raw sockets, and that by using the notoriously hairy '400 API calls. Pointer arithmetic everywhere. Yuck.

But no. A spot of googling revealed a piece of honest-to-goodness open source for the 'Series - Scott Klement's HTTPAPI. Marvelous.

There are a few other useful libraries on Scott's site, too, and a nice RPG IV Socket Tutorial.

Posted by Simon Brunning at 02:22 PM | Permalink | Comments (2)
May 27, 2005
My Recent Past...

Charles Arthur points out The Worst Web Application Ever. It looks exactly like a screen scraped 5250 iSeries green-screen application to me. Anyone want to try PWRDWNSYS *IMMED?

(It could be a 3270 mainframe system though, I suppose.)

My first break away from pure green-screen code grinding came with a Java applet based screen scraping conversion using Jacada. We made a much better job of it than these guys did, though, I must say. Not only did ours look a lot better, but we plugged in a lot of new functionality; prompting, documents attached to major business entities, data import and export, and we even managed to give the user multiple sessions in the same window, allowing then to with between up to sixteen windows each.

Update: Phil tells me that this is a 3270 mainframe system, and it's converted using ResQNet.

Posted by Simon Brunning at 02:09 PM | Permalink | Comments (4)
June 09, 2004
5250 fans aren't Luddites

Well, not all of them, anyway. ;-)

One of our biggest recent projects was a new Java front end to an old 5250 green screen application of ours. The majority of users were more than happy with the pretty new front end, but some were not. These users were finding that the GUI slowed them down.

Mouse considered harmful: "Have you ever watched an experineced heads down data entry clerk do thier job? With a green screen system they rarely look at the keyboard and in most cases ignore the screen. They are responding to audible feed back (key press clicks, console beeps, etc) with thier eyes focused on the data to be input. They remember key sequences (press 1, A, down arrow 2 times, F2 to save) to navigate. A mental model of the screens become engrained in thier head. They "SEE" the application in thier head and that vision is updated realtime. They know the system because it's predictable."

What's more, if the 5250 user gets ahead of the system, it doesn't matter - the 'dumb' terminal will just buffer their keystrokes, and play them back when the application is ready for them. So, they can enter data as fast as they can hit the keys.

I heard a story, probably apocryphal, about a salesman trying to sell what IBM calls a 'refacing' tool, and what the rest of the industry calls either a screen-scraper or a 'lipstick-on-a-pig' tool. He demonstrated how easy it was to slap a new front end on the 5250 app. The head of the data entry department then snipped off his mouse with a pair of scissors, and asked him to enter some data. "It costs us a penny every time one of our data entry people takes their hand off the keyboard," he explained.

Anyway, I've implemented a keystroke buffer for a Java app once before, and I know it's pretty much top of our to-do list for our pretty new front end. Perhaps then we can wean the last of our 5250 users onto it...

Via James Robertson.

Posted by Simon Brunning at 01:45 PM | Permalink | Comments (3)
May 28, 2004
Bugs can be a right bugger

Steve's bug hunting. So am I, and the bloody ILE debugger doesn't let you add a conditional breakpoint depending on two fields' values. IBM left this feature out deliberately to piss me off.

Posted by Simon Brunning at 12:39 PM | Permalink | Comments (1)
May 05, 2004
The Ride Of The Valkyrie

I've got a few one-off data fixes to do. I have to do them all in RPG: though the client has SQL, they don't really know how to use it, so they don't want me using it. Also, they consider it dangerous.

Don't know SQL? Don't know SQL! SQL has to be the single most ubiquitously useful and transferable skill in IT. If you don't know SQL, and know it well, learn it now.

I can't recommend any introductory books on SQL, but I can recommend Joe Celko’s SQL for Smarties. At an advanced level, it's the only SQL book you'll need. (Platform specific stuff, you say? Don't use it.)

Dangerous? Well, yes, it's dangerous. You can indeed hose a lot of data very quickly with SQL. But then, screwing up a database with a compiler takes only a little longer. Both approaches are as safe as one another; test thoroughly, and you'll be fine. And doing the data fix right is usually quicker with SQL, too.

One piece of advice, though; no matter how sure you are that your SQL statement is right, test your query one more time over tha actual data that you are going to update before running the update.

Once upon a time, in the dim and distant past, I had a big live data update to perform. So, on the test system, I constructed test data, ran and printed a bunch of queries, wrote my SQL statement, re-ran my queries to show that the update has worked properly, cut-n-paste my SQL statement into a Word document, printed that, and dumped the whole lot onto my bosses desk to check. He gave the go-ahead, so I opened up a session on the live box, set (and double checked) my library list, cut-n-paste my SQL statement from the Word document into the live session, hit enter, and went for a cup of tea.

It was only when I got back to my desk that I realised that the last cut-n-paste had left all the 'not' symbols ('¬'s) behind. Thank God for journals. The system was down for several hours, though. Sigh.

Random SQL links: Pronunciation of SQL, and Ten Things I Hate About You.

Posted by Simon Brunning at 02:35 PM | Permalink | Comments (5)
May 04, 2004
AS/400? No, iSeries? No, eServer i5.

Good God, IBM's marketing of the, uh, whatever it's called is a total mystery to me. Either it's totally crap, or it's so clever that it's way over my head.

It looks like there's another rebranding on the way. Say hello to the "eServer i5". I first came across this name in this news item from The Register: IBM's Power5 pops up first in new iSeries. So, I had a quick google, and found MSN's First IBM Power5 server to debut Monday. "The iSeries label that replaced AS/400 in 2000 will itself be phased out in favor of eServer i5, sources said. And though the OS/400 label for the operating system survived the 2000 rebranding, it now will be replaced with i5/OS, sources said."

i5? I shudder to think about the ads we've got coming, with brash Americans jumping up and down and slapping each other's palms. Sigh.

And don't talk to me about "WebSphere" - does IBM make any software that isn't called WebSphere something-or-other these days?

Update: See also IBM rolls out Power 5-based iSeries server.

Posted by Simon Brunning at 12:43 PM | Permalink | Comments (4)
April 29, 2004
The power of RPG

RPG's built in %DEC function is generally happy with embedded spaces - but if the string that you are trying to convert is completly blank, it throws an error. This is fair enough, I suppose, but not what I want - I want a zero.

No problem, thought I. I'll throw together a quick subprocedure.

 * Convert string to packed decimal                                        
p str_to_packed   b                                                                            
d str_to_packed   pi            31p11                                                          
d  from_str                     40    value                                                    
d  precision                     2p 0 value                                                    
d  scale                         2p 0 value                                                    
d return_value    s             31p11                                                          
c                   if        from_str = *blanks                                               
c                   eval      return_value = *zero                                             
c                   else                                                                       
c                   eval      return_value = %dec(from_str:precision:scale)                    
c                   endif                                                                      
c                   return    return_value                                                     
p                 e                                                                            

Does this work? Does it fuck. It fails to compile, because the %DEC function needs its scale and precision arguments fixed at compile time, would you believe. Arse.

Update: Looks like I'll have to do it the hard way. Sigh.

And while I'm ranting about RPG, what's the bloody point of introducing exception catching if you can't raise exceptions?

Posted by Simon Brunning at 02:39 PM | Permalink | Comments (2)
April 21, 2004
Command line parsing

I mentioned Michele Simionato's lovely command line parser the other day. The nice thing about this is that it takes the command line option definitions from a human readable definition in the module's docstring.

David Boddie commented on this recipe, pointing out his lovely command line parser. The nice thing about this one is that it can throw up an automatically generated GUI form allowing the options to be specified in addition to accepting the options from the command line. (There's nothing new in the world - this is similar in concept to the way the iSeries' commands work.) But the syntax that David's parser uses isn't too user friendly.

So, what I'd really like would be a combination of the two approaches; David's GUI generating parser, but driven from a human readable docstring. Well, I have the code to both, so I'll have a bash at a cut-n-shunt job.

Posted by Simon Brunning at 01:18 PM | Permalink | Comments (14)
Without the aid of a safety net

Bugger! Bloody SEU doesn't have an undo facility. I just deleted a whole bunch of source by accident. :-(

That's two hours work down the drain...

Posted by Simon Brunning at 12:09 PM | Permalink | Comments (8)
April 13, 2004
A language comparison: postcode splitting in RPG and Python

As you might have guessed from my last post, I've got some postcode parsing to do. The requirement is pretty simple; I have to parse a postcode into an outcode and (optional) incode. The good new is that I don't have to perform any validation - I just have to chop up what I've been provided with in a vaguely intelligent manner. I can't assume much about my import in terms of formatting, i.e. case and embedded spaces. But this isn't the bad news; the bad news is that I have to do it all in RPG. :-(

Nevertheless, I threw a little Python function together to clarify my thinking. I often do this when I'm coding something nasty in Java. It's worthwhile to make sure that the algorithm that I'm using works before grappling with Java, and Python is perfect for this. And given RPG's awkwardness, it's worth prototyping even the simplest algorithm - you don't want to spend all that time cutting code only to find that it doesn't work even in principal!

Anyway, the Python function:

def parse_uk_postcode(postcode):
    postcode = postcode.replace(' ', '').upper()
    if len(postcode) <= 4:
        return postcode, ''
        return postcode[:-3], postcode[-3:]

(A syntax highlighted version with unit tests here: postcode.py.)

Then I put the RPG version together: postcode.rpg. It's much longer and ugler, but it seems to work.

This is a very tolerant way of dealing with postcodes. It will accept just about anything. In my case, that's what I want; I'm pulling data in from a big SAP database. If that's inaccurate, it's definitively inaccurate. ;-)

In other cases, you might want to validate the postcode. Even here, you have more than one choice. One approach is to make sure that the postcode follows the rules as specified at the Universal Postal Union and the UK Govornment Data Standards Catalogue. I've coded this up: postcode_strict.py. This might even be useful to someone! (I didn't bother with an RPG version of this; I don't need one, and life's too short for writing this kind of thing in RPG if you don't really need it.) The other approach would be to validate against a list, should you have one. Duncan Gough steered me towards Brainstorm's downlaodable postcode lists, but these contain outcodes only.

Oh, BTW, any suggested improvements to any of these functions in any of these languages would be gratefully recieved, as would Java versions for comparison.

Update 14th April: Alan Green's done a Java version of the simple version. Thanks, Alan!

Also, I've spotted a bug in the strict version, which I'll fix at lunchtime. Basically, I'm using the list of characters valid at the 4th position to check characters at both the 3rd and 4th positions. This is incorrect; there's a different list of valid characters for the 3rd position. :-(

Another update 14th April: It's fixed, it works now, and I've even added a docstring or two. Look at postcode.py, or download a zip file containing postcode.py.

Posted by Simon Brunning at 04:57 PM | Permalink | Comments (18)
April 05, 2004
What's wrong with RPG

It's been quite a while since I've been an RPG programmer. Now I'm back with it for a month or two, and I can't say that I'm liking it much. I've become accustomed to loads of nice things that I no longer have available.

Firstly, there's the language itself. RPG is ugly, inexpressive and fiddly. I think that these are somewhat related - to quote ESR, Ugly programs are like ugly suspension bridges: they're much more liable to collapse than pretty ones, because the way humans (especially engineer-humans) perceive beauty is intimately related to our ability to process and understand complexity. A language that makes it hard to write elegant code makes it hard to write good code.

A few examples: Opening a file in anything but the most standard of ways involves fiddling with an unholy mix of F, D and I specs, all of which are column oriented records, and all of which need to be located in different parts of the source deck. The C specs don't have to be column oriented, but I've yet to see the new free format RPG used in anger. Using the old style column oriented C specs, if your expression gets too long, it'll end up running into the comment column, and will be ignored. If you're unlucky, the compiler won't notice, and your expression will compile with a bit missing. This gets picked up in testing, of course, but there ain't no jUnit for RPG.

There's a narrow range of activities for which RPG works reasonably well, and it must be said, it's very well integrated with the iSeries's built in database. The iSeries is pretty much an accountant's machine, and you can build the applications that you want with RPG, I suppose. But all the fiddling leaves you with appalling productivity.

Then there's the standard library. Or, to be more specific, the complete and utter lack of one. Java has a huge standard library, and Python's standard library is either even larger or much smaller, depending upon whether you are talking about functionality, or lines of code. ;-) And if I can't find what I'm looking for in the standard libraries, well, Google and PyPI are my friends, and there's almost always something to download. RPG, on the other hand, has no standard library at all, and there's little stuff on the 'net. RPG does support software components, just about, but there isn't a community making stuff available. So, every project reinvents its string and date handling, for example.

Lastly, there's the development environment. The site that I'm at, just like every other iSeries site that I'm aware of, use the SEU source editor, which is out of the Ark. This is particularly irritating, because there's a fantastic Eclipse-based replacement, WDSc. This comes as part of the same WDS bundle as SEU does, so if you have one, you have the other - but no one uses it!

In short, if you catch me whinging about Java again, just slap me.

Posted by Simon Brunning at 01:54 PM | Permalink | Comments (11)
March 30, 2004
Why Do Java Developers Like to Make Things So Hard?

Why Do Java Developers Like to Make Things So Hard?

"Imagine if the Perl cafe and Javahut were across the street from each other. You walk into Javahut, and ask to sit down. "I'm sorry," says the person at the door. I'm not actually the hostess, I'm a Factory class that can give you a hostess if you tell me what type of seat you want." You say you want a non-smoking seat, and the person calls over a NonSmokingSeatHostess. The hostess takes you to your seat, and asks if you'll want breakfast, lunch, or dinner. You say lunch, and she beckons a LunchWaitress. The LunchWaitress takes your order, brings over your food, but there's no plates to put it on because you forgot to get a CutleryFactory and invoke getPlates, so the Waitress throws a null pointer exception and you get thrown out of the place."

This is so true it hurts.

Still, could be worse. Working with RPGIV, there are no restaurants. Nor are there any supermarkets; you have to grow your own food. And make your own cutlery.

Via Ian Bicking.

Posted by Simon Brunning at 01:06 PM | Permalink | Comments (12)
March 22, 2004
Karmic feedback

I'm getting a spot of Karmic feedback for taking the piss out of Mark for his burger flipping VB6 programming - I'm starting on a six week RPGIV project at a client site next week!

This is bad: in decreasing order of love, my used-at-work programming languages are:

As you can see, RPGIV isn't high on the list. Sigh.

Still, I'll be working with one or two people I know and like, so it isn't all bad.

Posted by Simon Brunning at 04:29 PM | Permalink | Comments (9)
January 13, 2004
Small world

The iSeries world is a small one, and the Synon/2 world is smaller still. So, it's really no surprise that Steve is now working with my old mate Michael.

Anyway, the three of us are meeting up at The Prince of Wales, Wimbledon tomorrow evening. All welcome.

Posted by Simon Brunning at 12:47 PM | Permalink | Comments (4)
December 04, 2003
Service programs and the binder source language

It's been a long time since my last '400 related post. But then, it's been a long while since I touched a '400, so that's hardly surprising.

Still, this is interesting. When I was using ILE, I didn't use service programs (which are basically just like Windows' DLLs), and I used CRTPGM's MODULE parameter to specify the, uh, modules.

If you are in the same place, then Service Programs with a Smile, Binder Source: The Little Language That Could and Customizing Your Development with Extensible RPG might be worth a read.

Posted by Simon Brunning at 12:16 PM | Permalink | Comments (0)
November 06, 2003

Is anyone else unable to download JTOpen at the moment, or is is just me? I've been trying on and off for a week or so now...

Posted by Simon Brunning at 01:48 PM | Permalink | Comments (0)
November 03, 2003
Still cutting edge?

Ted Leung points out a couple of iSeries related articles. An Object-based Systems Architecture, which talks about how OS/400 is object oriented to the very core, and its capability-based security features. Few people outside of IBM's Rochester development lab. are aware that the AS/400 is a marvellous bit of advanced technology - still (IMHO) many years in advance of anything else on the market.

WinFS Vs GNOME Storage? Can you Say OS/400? is about the '400's database based filesystem, how ahead if its time this was, and how bloody useful it is.

I just went over to a client this morning to make a quick fix, and I have to say that the '400 doesn't feel particularly cutting edge. But that's just the tools, really - PDM, SEU and DFU, (the tools I used today) are all out of the ark. IBM have certainly provided more up to date tools, but in my experience, no one uses them.

In fact, I was using a 5250 dumb terminal today. Good God, no cut and paste! I kept looking over my shoulder, worried about being attacked by a saber-tooth.

Posted by Simon Brunning at 12:01 PM | Permalink | Comments (5)
October 09, 2003
I'm resting, darling

I met Steve last night. I'm rather heartened by our conversation about his 'between jobs' situation, I must say. It seems that he has several irons in the fire at the moment, so things are decidedly looking up.

Interestingly, all but one of these prospects have come through people who know Steve, and have worked with him. The other prospect is a friend-of-a-friend thing, with me being the friend. None of them have been put to him by a recruitment consultancy. Thing is, the Synon/2[1] market is a small one, and people know one another. Steve's reputation is good - very good - and it's now that this is paying off for him.

So, there are grounds for optimism here. Good luck, Steve!

[1] OK, OK, it's called Advantage 2E these days. But it will always be Synon/2 in my heart. Just as the AS/400 will always be the AS/400, though IBM have called it the iSeries for some time now...

BTW, The Stage Door turns out to be a lovely pub. First off, it really is a pub - rather than a bar - with a proper pub feel. Good, attentive staff, more interested in serving beer than chatting, unlike in many places I could mention. And not to pricey for a London pub, either. Recommended.

Not enough eye-candy for Steve, though, so at his suggestion we decamped to The Fire Station later on in the evening.

Posted by Simon Brunning at 09:56 AM | Permalink | Comments (2)
September 09, 2003
Not my finest hour

There's a debate going on right now on python-dev about what kind of changes are acceptable in micro releases. (Micro releases are where you go from x.y.z to x.y.z+1 - for example, from 2.2.1 to 2.2.2.)

At one point, Fred Drake said "We might not be able to remove a core dump since it would allow code to run that was not run before, thereby changing the behavior of the code".

No one would rely on something like a core dump, right? Well, perhaps, but I was reminded of one of my nastiest ever iSeries hacks, which was very nearly as bad. Scarily enough, this was (and is) used in production code.

Posted by Simon Brunning at 12:31 PM | Permalink | Comments (0)
August 12, 2003
WebSphere Development Studio Client 5.1

IBM Announces New Release of WDSc, New Software Ships in September.

The new WDSc is based on Eclipse 2.1, which rocks. It's nice to see that IBM are keeping up to date.

The next time I have any iSeries work to do, I'll upgrade.

Posted by Simon Brunning at 11:33 AM | Permalink | Comments (0)
August 11, 2003
OS/400 on a PSone?

IBM gets AS/400 running on PSone, according to The Register.

Bollocks, say I.

Now, OS/400 on a PS/2 I do believe. It's based on the PowerPC architecture, and I've heard Frank Soltis talk about the posibility before.

Via an email from Jay.

Posted by Simon Brunning at 02:57 PM | Permalink | Comments (1)
July 24, 2003
Database connection pooling

See Using the Jakarta Commons, Part 3. Lots of cool stuff here, but I'm particularly interested in looking at DBCP, the database connection pool package.

One of my team's apps runs on Tomcat 4.0.x, and we use Tomcat's connection pooling. I'm not sure if it doesn't work how we want it to, or whether we are just using it wrong, but we are having real problems with it. Mainly, the problem is that it seems very keen on throwing connections away. Unless you go to the pool very soon after a connection has been returned, you'll find the pool empty, and have to wait for a new one to be built. Which is, of course, exactly what we are using a pool to avoid. (Note to self - try Evo on Tomcat 4.1.x.)

I also looked into using IBM's AS400JDBCConnectionPool, since it's a '400 that we are trying to get to. But I can't get that going under Tomcat at all.

So, perhaps DBCP is the way to go. Certainly it's worth a look. Unless anyone has any suggestions as to where I'm going wrong with either of the other two approaches?

Posted by Simon Brunning at 10:28 AM | Permalink | Comments (23)
July 18, 2003
You know you've been away from the '400 for too long...

When you start up SEU, and drag the bottom of your 5250 emulator window down to see more lines of source. Sigh.

Posted by Simon Brunning at 12:06 PM | Permalink | Comments (1)
April 28, 2003
The Future of Programming on the iSeries

The Future of Programming on the iSeries, Part 1 and Part 2.

Some interesting history here, but no real news. According to IBM, RPG III is strictly legacy, and RPG IV must coexist with Java.

My, I'm inclined to doubt that many new systems will be written using any RPG at all. Though the developpment tools are improving, RPG itself is still a pig. My current company is a '400 shop, and our main product is in RPG III, but even we haven't written a new system in any flavour of RPG for some years. There is still plenty of maintenance and enhancement work for the RPG people, but it's strictly legacy stuff.

And if you are a '400 developer, and you don't know Java yet, then now is the time.

Some other iSeries stuff:

Posted by Simon Brunning at 01:53 PM | Permalink | Comments (2)
February 20, 2003
IBM actually trying to sell the '400 for a change?

IBM pitches eServer iSeries to wider user base

The IBM eServer iSeries platform, formerly known as AS/400, is very highly regarded by those who work with it day in and day out, says The Register.

Damn right it is. I'm one of them. The iSeries (still known as the AS/400), is a good box for business. Not exciting, not even particularly interesting, but solid, capable, reliable, predictable, cost effective, simple to administer, and scalable.

But for some reason, IBM has never made much of a noise about them. Might this change?

Posted by Simon Brunning at 12:14 PM | Permalink | Comments (0)
February 04, 2003
RPG's MONITOR opcode

RPG doesn't have anything like as powerful as Exception handling, but it is ironic that for many years the iSeries' scripting language, CL, has offered a more powerful error handling via its MONMSG command than RPG offered.

Well, RPG is finally being dragged kicking and screaming onto the eighties. Power of MONITOR Opcode shows you how to make use of RPG's new

Posted by Simon Brunning at 09:07 AM | Permalink | Comments (2)
January 27, 2003

TN5250j is a 5250 terminal emulator for the AS/400 written in Java, which allows Python scripting!

(Well, Jython scripting, to be precise.)

This is going to be so useful...

Via Daily Python-URL

Posted by Simon Brunning at 01:39 PM | Permalink | Comments (2)
January 21, 2003
V5R1 - Journaling, data queues and data areas

As as V5R1, you can journal changes to data areas and data queues. See Add a Safety Net with Journalized Data Queues for an overview.

Now this is useful. I've always shied away from data areas and data queues, partly because you can't journal them. The other reason is that I'm a relational database bigot, and data areas and data queues just don't feel right.

So, data areas and data queues will still probably be plan B, 'cos of the second reason that I mention, but I won't feel quite so dead set against then in future. After all, both object types can be pretty useful at times.

'Journalize' seems to be an Americanism - on the UK, I've only ever heard it referred to as 'journaling'. A bit odd, this - most IT related Americanisms (disk, program, and so forth) make it across the pond unchanged, which is fair enough, really, since most refer to things invented in the US. But 'journalize' didn't, possibly because it really jars on the British ear.

Posted by Simon Brunning at 05:56 PM | Permalink | Comments (0)
December 10, 2002
ASCII banner generator

The ASCII banner generator (a web based version of figlet) is fun.

Why in the iSeries category? 'Cos I recently used it to produce a new green-screen banner page. Probably the first new 5250 banner page to have been written in 5 years.

Posted by Simon Brunning at 02:41 PM | Permalink | Comments (4)
TCP/IP exit point intro

A primer to writing TCP/IP exit point programs.

Pretty useful, but FTP is only one of the things which you need to cover. ODBC and JDBC are other important ones, and I should imagine that securing those would be quite a job - you'd need to parse the incoming SQL to decide what was being read and/or updated. Not trivial by any means.

Posted by Simon Brunning at 02:24 PM | Permalink | Comments (0)
November 26, 2002
Java Access to AS/400 Data

Java Access to AS/400 Data

We are sticking to JDBC at the moment on my projects. Since the prospect of our running the database on anything other than a '400 is just about zero for the foreseeable future ('cos we are interfacing with a rather old, but very capable and very large system), perhaps record level access shouldn't be ruled out?

Program Call Markup Language (PCML) is worth bearing in mind for some things, too.

Posted by Simon Brunning at 11:45 AM | Permalink | Comments (1)
November 18, 2002
Using SQL's scalar functions from RPG

SQL to the Rescue! shows how to use SQL's scalar functions from RPG. SQL has a rich set of functions, so this could be very handy. (See also SQL's One-Row, One-Column Table for a follow up.)

Also for RPG developers - Data Structure Parameters in RPG Prototypes.

Posted by Simon Brunning at 01:48 PM | Permalink | Comments (1)
November 04, 2002
WebFacing into Tomcat does go!

They said it should work, and it does. So, can anyone tell me why a WebFacing user needs WAS?

Posted by Simon Brunning at 01:03 PM | Permalink | Comments (1)
October 18, 2002
GZip for iSeries

Midrange Server has info on getting and using gzip on the iSeries.

Posted by Simon Brunning at 01:14 PM | Permalink | Comments (1)
October 15, 2002
iSeries roundup
Posted by Simon Brunning at 12:50 PM | Permalink | Comments (0)
October 04, 2002

A friend of mine needs to process some XML on the '400 with RPG. I pointed him at these:

Good luck, Paul!

Posted by Simon Brunning at 02:33 PM | Permalink | Comments (1)
October 02, 2002
Quantum Eclipse Plug-in

My friend Jay Graves pointed out Quantum to me. It's a nice simple database access plug-in for Eclipse.

Built-in iSeries support!

Posted by Simon Brunning at 02:55 PM | Permalink | Comments (1)
September 30, 2002
IBM's iSeries Tools Strategy

Two Minutes with Dave Slater on the iSeries Tools Strategy. The future of the WebSphere Development Studio Client, itself the future of iSeries development tools.

There is a nice new Redbook about this - WebSphere Development Studio Client for iSeries: Bringing New Life into 5250 Applications. Six meg, but well worth the download.

Posted by Simon Brunning at 01:05 PM | Permalink | Comments (0)
WebSphere Host Access Transformation Server

IBM plays Host to Websphere integration

Sigh. Yet another way of accessing green-screen apps via a browser.

We have gone with Jacada for Java. It's rather heavyweight, but it allows you to customise it almost endlessly by extending the Java that it generates. It's been around for a while, and it's solid. It has to be said though - its interface sucks big time, and it is totally non-automateable, which causes us a huge amount of manual work with our integration builds.

Posted by Simon Brunning at 12:54 PM | Permalink | Comments (0)
September 20, 2002
iSeries and OS/400 roadmaps

On IBM's iSeries and OS/400 roadmaps

Posted by Simon Brunning at 01:55 PM | Permalink | Comments (0)
September 17, 2002
SQL triggers

Easily maintain SQL triggers is a nice example of the kind of thing that you can do with SQL on the '400 these days.

'Smart' databases might seem like an unalloyed good thing, but I'm not so sure anymore. Do you really want your business rules mixed up with your database?

Sure, triggers mean that you can't break the rules even when editing data with SQL, DFU, or the wonderful WRKDBF, but the temptation would be to put too much intelligence into the trigger.

You want your business rules to live in your business objects. These are the things it which you code all your business rules - usually in the form of OO classes, but you can use an RPG service program or suchlike to take the same role. Your triggers should be thin wrappers, simply calling out to the business objects for verification of the required data change, and for any consequential database operations. The database should be just a repository for your data.

Of course, your front end (be it a GUI, a web service, or whatever) should also be as thin as possible, and hook into your business objects.

And thus a 3-tier architecture is born!

Posted by Simon Brunning at 10:56 AM | Permalink | Comments (3)
August 30, 2002
Adding Subprocedures to a Service Program

This ILE business isn't simple. I know a lot of bright people who have had real problems moving across from RPGIII to RPGIV and ILE. So you can imagine the problems that not-so-bright people like me have had.

It's not the RPGIV part that's the problem, on the whole. RPGIV is just RPGIII dragged kicking and screaming into the nineteen-eighties. The thing that people have real problems with is ILE.

You can find a lot of good stuff in Who Knew You Could Do That with RPG IV? A Sorcerer's Guide. The first four chapters are essential reading for RPG programmers.

Adding Subprocedures to a Service Program is a nice little tutorial on binder language. You can use this to avoid the need for mass recompilation when you change a service program. It's knowing things like this which mean the difference between ILE being useful and being a complete nightmare.

Update (Frday) 13th of July: Reader Feedback and Insights: Binder Language clears up a few bits and bobs.

Posted by Simon Brunning at 09:18 AM | Permalink | Comments (1)
August 28, 2002
August 27, 2002
Time to open-source OS/400?

Open Source OS/400: A Crazy Idea for Crazy Times

Posted by Simon Brunning at 04:29 PM | Permalink | Comments (0)
August 23, 2002
V5R2 DB2 UDB enhancements

Sigh. I know that I've written about DB2 UDB enhancements at V5R2 again and again and again, but here is Port of Entry by Kent Milligan. This one is definitive.

Posted by Simon Brunning at 02:16 PM | Permalink | Comments (1)
August 19, 2002
DB2 UDB for iSeries enhancements at V5R2 - yet more

Yet more new information about DBG2 UDB for iSeries enhancements at V5R2.

This is on top of the earlier stuff. V5R2 is looking like a huge release for DB2 - possibly the biggest since the initial System/38 release all those years ago.

Scalar subselects are the kind of thing that don't look too exciting. Until you need them, that is, at which point you really need them.

Savepoints also look really handy, as do external UDTFs. UDTFs, User Defined Data Tables, allow you to treat the output of a program as an SQL table.

Temporary tables are somewhat useful - nothing you can't do by creating tables in QTEMP, but these will work cross-platform.

Also in The Four Hundred this week - a summary of the state of play with WebSphere Development Studio Client (WDSc) and Eclipse for the iSeries, (no news here, but a nice summary anyway,) and an article explaining why companies should hire mediocre rather than talented people, which explains why I have a job.

Posted by Simon Brunning at 01:21 PM | Permalink | Comments (1)
August 15, 2002
Source colouring in SEU

I don't have to use SEU very often any more, thank God. And soon, no one else will - either.

But nevertheless, this is a neat hack.

Update: the site seems to be down, so here's the google cache: http://google.com/search?q=cache%3Ahttp%3A%2F%2Fwww.400times.co.uk%2FFrameData%2FSEUCOLOR1.htm

Posted by Simon Brunning at 03:07 PM | Permalink | Comments (1)
Single Sign-on Support in V5R2

Single Sign-on Support in V5R2. Very interesting...

Posted by Simon Brunning at 02:56 PM | Permalink | Comments (0)
The CLEAR op-code in RPG

"CLEAR" advantage over resetting work fields discusses the CLEAR op-code in RPG.

Doesn't mention the RESET op-code, which I use a lot. Or did - I haven't touched RPG in months, thank God. RESET allows you to customize what the fields in a structure get set to.

Also - Using date data-type fields in RPG-IV and A new and improved find command.

Posted by Simon Brunning at 02:25 PM | Permalink | Comments (1)
Don't bank on IDS

iSeries security pros know it, and the Tories know it.

Posted by Simon Brunning at 01:56 PM | Permalink | Comments (1)
August 13, 2002
iSeries Tools and the Power of X

iSeries Tools and the Power of X: Why FTP?

I'd not heard of this - using VNC to run iSeries based X Windows sessions. Wild! You can now use EMACS to edit iSeries files.

If Eclipse for the iSeries wasn't around, I'd be looking at using this.

Posted by Simon Brunning at 04:35 PM | Permalink | Comments (1)

JTOpen is the open source version of IBM's Java toolbox for iSeries. JTOpen--The Right Tools for the Job is a nice introduction.

I am using JTOpen in my current project - mainly the JDBC driver.

Posted by Simon Brunning at 04:00 PM | Permalink | Comments (0)
August 05, 2002
iSeries web servers

Which Web Server Is the Right One for You? is an interesting discussion of the various web servers which you can run on an iSeries.

IBM claim that Apache/Tomcat doesn't scale as well as WebSphere. Is this true?

Can you run JBoss on a '400?

Posted by Simon Brunning at 01:07 PM | Permalink | Comments (0)
July 26, 2002
Too late to move to ILE RPG?

Too Late to Switch to ILE?, at the iSeries Network, contends that if you are still using RPGIII, you will probably never move to RPGIV and ILE.

If you were to have started with RPGIV at V3R2, when it was first released, then the leap from RPGIII wasn't too big. But since then the gulf has widened considerably. Today's RPGIV wouldn't look anything like RPG to an RPGIII programmer.

This is true, I suppose, but I think that the bigger issue is attitude. Most iSeries developers are, uh, not exactly neophiles. RPGIII has always been good enough for them in the past, so it's good enough for them now.

Outside the iSeries world, the machine is seen as old fashioned. Which is a shame, 'cos it's a superb box for business, and it isn't old fashioned at all. But the uses to which it is usually put are, and that is where the reputation comes from, I think.

Ah well. Anyway, another interesting RPG article today - Generate random numbers using RPG.

Posted by Simon Brunning at 09:33 AM | Permalink | Comments (1)
July 25, 2002
Free iSeries utilities

Kisco is making some of its utilities available for free. (That's free as in beer, not free as in speech.)

SMARTTTN is a set of mini-apps for green screen users - calculator, calendar, note pad, that sort of thing.

CPYFSEL is a smart file copy utility.

BTW, not new, but very useful - the WRKDBF file editor. Well worth a look.

Posted by Simon Brunning at 10:23 AM | Permalink | Comments (1)
July 24, 2002
Using environment variables with RPGIV

Useful little RPG tip - Using environment variables with ILE-RPG.

Posted by Simon Brunning at 01:58 PM | Permalink | Comments (1)
July 19, 2002
Running an iSeries Command from Java

iSeries Toolbox for Java: Running an iSeries Command.

There is a bit more to it than you'd think, but it's all covered here.

Posted by Simon Brunning at 03:58 PM | Permalink | Comments (0)
July 17, 2002
Parameter prototyping

An interesting article explaining prototyping of parameters in RPG IV.

Death to PLISTs! Who Knew You Could Do That with RPG IV? A Sorcerer's Guide to System Access and More is an absolute must-read for RPG IV developers.

Also worth a look: Until such a time as we all start using Eclipse do develop our iSeries software, defining your own SEU commands is still a worthwhile hack.

Posted by Simon Brunning at 09:26 AM | Permalink | Comments (0)
July 15, 2002
Pointers on pointers

Some Pointers on Using Pointers in RPG IV.

I have to say, I find it a bit bizarre that just as so many modern languages (Java, Python) were doing away with the concept of pointers (as opposed to references, i.e. pointers without the arithmetic), IBM were busy adding them to RPG.

You can have quality software, or you can have pointer arithmetic; but you cannot have both at the same time. - Bertrand Meyer, 1989

Having said that, there are things in RPG that you can only do using pointers, and some that are much more efficient using pointers, so their use cannot be ruled out altogether. And OS/400 won't let you fandango on core.

Posted by Simon Brunning at 03:55 PM | Permalink | Comments (1)
Monster iSeries sold

IBM has sold some of its iSeries Model 890 "Regatta-H" servers, according to the iSeries Network and The Register.

Posted by Simon Brunning at 12:52 PM | Permalink | Comments (0)
July 02, 2002
Striving for Optimal Journal Performance

Striving for Optimal Journal Performance on DB2 Universal Database for iSeries.

You don't need this. But if you do need it, you need it bad.

Posted by Simon Brunning at 03:30 PM | Permalink | Comments (1)
Code modernisation

One Company's Code Modernization Process at eServer magazine is a case study of the modernisation of a legacy iSeries application.

"We had a well-structured RPG program model that we’ve reused over and over again, so we knew how to tell user-interface subroutines from business- and editing-rule subroutines," Daniels explains. Sigh. Most of us don't have this, so we need RPG refactoring tools, about which I have ranted before.

Posted by Simon Brunning at 10:11 AM | Permalink | Comments (0)
More details on UDB2/400 enhancements at V5R2

Midrange Computing has an article, What's New with DB2 in V5R2.

I've mentioned some of the SQL enhancements before, but the MC article covers more, and give examples. I don't know about you, but I find examples so much easier to comprehend. There are also SQL enhancements mentioned that didn't make it to the IBM document - The CREATE TABLE LIKE command, and the more flexible ORDER BY clause. Genuinely useful stuff.

Also new at V5R2 is the JDBC 3.0 support.

Posted by Simon Brunning at 09:23 AM | Permalink | Comments (1)
July 01, 2002
Connection Pooling with Tomcat

Connection Pooling with Tomcat is just what I have been looking for - I've been trying to work this out for hours!

Dive into connection pooling with J2EE is a good follow-up read, but it doesn't have a simple step-by-step guide to getting started.

Posted by Simon Brunning at 02:21 PM | Permalink | Comments (0)
Eclipse 2.0 final released

Get it here.

(It's a bit slashdotted, so be patient.)

See also the Slashdot coverage.

Nothing to report myself as yet - I'm still downloading!

Update: Downloaded & installed. I can't see anything different, but that's only to be expected, since I've been running a release candidate for a while.

Posted by Simon Brunning at 09:46 AM | Permalink | Comments (1)
June 27, 2002
Stargate Eclipse - iSeries Development Update

The dawn of Eclipse.

My boss and I attended the Stargate event at IBM yesterday. There we were shown the new version of the WebSphere Development Studio Client. This comes in a bewildering variety of versions, and consists of an equally bewildering array of subcomponents. All of the versions of WDSc, and all of the subcomponents were referred to by acronym, and all the acronyms began with W, and we were thoroughly confused.

But anyway, the long and the short of it is that if you are an iSeries shop, you get the lot.

The new version of WDSc is based in the Eclipse framework. As anyone who has used Eclipse will know, it is just beautiful.

Eclipse is basically a framework for building IDEs, and other things. It ships with a plug in which makes it into a Java IDE, which as I said, is superb. Tools vendors other than IBM are also basing tools on Eclipse.

WDSc consists of a number of plug-ins to Eclipse to enable iSeries development. It has tools to navigate libraries and objects on the iSeries - think of a cross between PDM and Windows Explorer, but with filtering options more powerful than either. You can edit and compile RPG, DDS and so on, with any one of several powerful editors. SEU is ancient history now.

There are also some powerful tools for developing Java based web applications possibly involving iSeries components, though not necessarily. The tools for building JSPs, beans of various types (including EJBs) and so on are powerful. There are also tools to building wrappers around iSeries based RPG modules and turning them into beans and/or web services.

All great stuff, and for iSeries development it is going to be wonderful.

It is missing one crucial set of tools, though, as far as I am concerned. There are no tools for refactoring RPG. All these clever tools which IBM provide are meant to work on nice modular systems, where your presentation and business logic are nicely separated. Our legacy system isn't like this - it consists of large programs (5000 to 15000 lines) with the business and presentation logic thoroughly mixed. There are no separate callable modules implementing business functions, and that is what much of the new tooling requires.

Now, obviously there is no way to automate the modularise of a large program - it is inevitably a manual job, and a big one. But there are tools which can help - or there could be.

The Java development tools which ship with Eclipse include a number of powerful refactoring tools. For example, you can highlight a block of code and extract into a separate function (method). All inputs to and outputs from the selected code are automatically worked out, and turned into parameters (arguments). If large RPG systems are to be modernised, this is the sort of tool which we need.

I brought this up at the event. IBM have no plans to build this sort of thing into WDSc. Eclipse is totally modular and extensible, though, so anyone could do it. It was suggested that this might be an opportunity for my company! We are not a tools vendor, though, so it isn't going to happen. There were a number of tools vendors present, though, and a couple were interested enough in the idea to come and talk to me...

The latest version of WebFacing was also demoed - on which more later.

Update: Eclipse Forces Developers Across the Java Divide at the iSeries Network.

Update 02 July 2002: See Welcome to the Dawn of Eclipse by Phil Coulthard and George Farr, the guys who presented Stargate. Plenty of screenshots, and lots about the RPG tooling.

Posted by Simon Brunning at 11:50 AM | Permalink | Comments (1)
June 25, 2002
Stargate Eclipse - iSeries Development Update

Tomorrow, I'm going to IBM's Stargate Eclipse - iSeries Development Update event. Should be interesting.

No updates tomorrow. ;-)

Posted by Simon Brunning at 01:38 PM | Permalink | Comments (1)
June 20, 2002
RPGIV enhancements at V5R2

RPGIV enhancements at V5R2.

No changes to SEU, surprise surprise.

%DEC and %INT (character to numeric conversion) should have been in from the start, IMHO. I've had to write them more than once. (At different sites, I hasten to add!)

The field lists now supported by the database I/O opcodes (CHAIN and friends) sound interesting. No more level checks?

But what might be the biggest thing is the continued Java integration.

Nothing else earth shattering.

Posted by Simon Brunning at 09:20 AM | Permalink | Comments (1)
June 18, 2002
Eclipse: An IDE for Tomorrow?

Eclipse: An IDE for Tomorrow? at Midrange Computing talks about the way IBM is building the new WebSphere Studio Tools around Eclipse.

It explains what Eclipse is, and lists the new Websphere tools which will plug into it.

What has happened to eclipse.org? It seems to be dead at the moment.

Update: eclipse.org is back.

Posted by Simon Brunning at 01:47 PM | Permalink | Comments (1)
Start NT programs from the iSeries

Start NT programs from the iSeries at Search 400 is a useful technique.

Not that I'd use VB, naturally. The NT side if things can all be done with Python - sockets are built in, COM support comes as part of win32all, and py2exe allows you to run your scripts as NT services.

Posted by Simon Brunning at 09:04 AM | Permalink | Comments (1)
June 11, 2002
RPG toolbox

400times has a review of Linoma Software's RPGToolBox.

SEU sucks. This looks like it will make it suck less hard.

But never mind that - check out the menu applet on the review page!

Posted by Simon Brunning at 10:11 AM | Permalink | Comments (0)
June 06, 2002
Eclipse F2 is out.

Eclipse F2 - get it now!.

Other Ecllipse news:

New version of WebSphere Development Studio to be based on Eclipse.

QNX Releases Eclipse-based IDE.

Posted by Simon Brunning at 01:34 PM | Permalink | Comments (1)
May 22, 2002
iSeries triggers at V5R1

An interesting article about DB2 UDB for iSeries triggers over at DB2 magazine.

I have used basic triggers extensively, but the V5R1 changes (column level triggers and the STATE parameter on the CHGPFTRG) are new to me. Also, some nice examples of procedural SQL.

Posted by Simon Brunning at 09:18 AM | Permalink | Comments (1)
May 21, 2002
Eclipse 2.0 soon

According to the release schedule for Eclipse 2.0, it will be released at the end of June.

We use Eclipse as our IDE for Java development. It is bloody good.

It is also going to form the basis of future versions of the WebSphere Development Tools for iSeries. RPG in Eclipse - I can't wait!

There are also Eclipse plug-ins for C# and Ruby - perhaps a Python plug-in is in progress? Can't find one.

Posted by Simon Brunning at 12:33 PM | Permalink | Comments (0)
May 20, 2002
What is Well-Commented Code?

Interesting discussion at Slashdot Developers.

I must say that I am commenting a lot less these days. Using modern IDEs like Eclipse or Boa, long names are not a problem., so I'd rather give a function a self explanitory name, and not bother commenting it at all.

Back on the iSeries, 90% of my work is on existing RPGIV code. With a six character limit on field and subroutine names, well, loads of comments are needed..

One of the comments on the /. discussion agrees with this. And has a link to a Radio 4 live feed! Cool!

Posted by Simon Brunning at 12:57 PM | Permalink | Comments (1)
May 16, 2002
iSeries DocFinder

If you develop on the iSeries, or operate one, you need a shortcut to the iSeries DocFinder in your favorites list.

My shortcut is called 'INDEX 400', which tells you how long I've been using it!

The other must-have shortcut is to comp.sys.ibm.as400.misc - whatever problem you might have, you are not the first.

Posted by Simon Brunning at 01:35 PM | Permalink | Comments (1)
What's New in DB2 for iSeries at V5R2

IBM has published an overview of the changes to DB2 on the iSeries at V5R2.

Personally, I'm most interested in the SQL enhancements. Views over unions will be useful, and identity columns will make a lot of jobs simpler.

Posted by Simon Brunning at 12:09 PM | Permalink | Comments (1)
May 09, 2002
iSeries tool vendors plugging into Eclipse

The Vendors Ponder Eclipse article at the iSeries Network says that a number of iSeries tool vendors are building tools to plug into the Eclipse framework. I'm looking forward to the results...

Posted by Simon Brunning at 01:08 PM | Permalink | Comments (0)
May 01, 2002
IBM releases iSeries model 890 Regattas

Story at The Register.

Lots of macho hardware figures here, but what's new in terms of OS/400? (Or have they rebranded it as iOS yet?)

Posted by Simon Brunning at 11:55 AM | Permalink | Comments (0)
April 29, 2002
Python on the iSeries

Per Gummedal has updated his iSeries port of Python to version 2.2.1. Get it here.

I've been working on PC based Java stuff for a while now, so I haven't been keeping an eye on Per's work, but it looks to have come on a long way.

I'm still not sure that it can beat a Jython/JTOpen toolkit combination for functionality, though.

Posted by Simon Brunning at 01:30 PM | Permalink | Comments (5)