Archive for the ‘IBM’ Category

Configuring an IBM i for Emacs and Perl hacking

July 31, 2008

An “IBM i” is a descendant of the old AS/400 machines and has undergone numerous name changes over the years. Most code on it is written in a language called RPG, but which unfortunately lacks polyhedral dice altogether. When IBM decided to promote Java for the platform, they had to have a Unix like tool to manage everything, so they built one from scratch with local tools and languages. At the same time, IBM realized they could run the machine with more or less the exact same hardware as their AIX boxes, so a second stream of “Unix-ness” was introduced into the platform.

First you need to install Option 30 (QSHELL) and Option 33 (PASE) on your operating system. PASE is a bonafide AIX type Unix environment. QHSELL is a Unix-like environment that is implemented in native code/objects. You’ll use PASE to run ‘real’ Unix programs and you’ll use QSHELL when you need a tool that groks the differences between Unix and the local environment.

Next you want to go install The iSeries Tools for Developers (product 5799-PTL). This will give you version v5.8.7 of Perl and version 20.7.2 of Emacs relatively painlessly. You’ll want to set up symbolic links for at least these programs:

ln -s /QIBM/ProdData/DeveloperTools/pase/bin/perl /usr/bin/perl 
ln -s /QOpenSys/QIBM/ProdData/DeveloperTools/perl587/bin/perldoc /usr/bin/perldoc 
ln -s /QOpenSys/QIBM/ProdData/DeveloperTools/emacs/bin/emacs /usr/bin/emacs

Now you can call Perl and Emacs from the command line… except you can’t run Emacs, yet.

You’ll need cygwin installed on your Windows box. Pull down the xwindows libraries when you configure your setup. You’re good to go when you can type “startx” from a cywgin command line.

Go to C:\cygwin\usr\X11R6\bin and make a shortcut to startxwin.bat onto your desktop. Run this to go directly to x without having to start cygwin first. Once you’re at the x command line, type “xhost YOURSERVERNAME”.

Now start your 5250 emulator. At the command line, type STRQSH to go into QSHELL. Once there, enter the following commands:

system "strptl CLIENT('')" 
export DISPLAY="" 

If you don’t know what your ip address is to set up your DISPLAY environment variable there, you can just peek in the startxwin.bat to get it. You can also put the above commands into your .profile file so that they run every time you start QSHELL. Both your .emacs and .profile files go in the “home folder” that you start off in when you open QSHELL.


Ronald P. Loui: The Best Student AI Work Is Developed in Gawk

August 15, 2007

Here is some surprising evidence that Perl should still be respected in spite of its “indecent” appearance. And while Gawk appears to beat Lisp at its own game in this case, it may in fact be because it has so much in common with Lisp.

Important Gawk Features based on Ronald P. Loui’s AI class experience:

  • Powerful String Processing Language Features
  • Powerful Constructions for Manipulating a Wide Variety of Data in Efficient Ways
  • Interpreted Language with a Short Learning Curve
  • Automatic Initialization, Implicit Coercion, I/O Support and Lack of Pointers
  • Regular Expressions
  • Associative Arrays
  • Relies on the OS to provide Data Organization, Debugging Tools, and Subroutine Libraries
  • Powerful Uniform Data Structure
  • Trivial Syntax
  • Encourages Bottom-Up Design and Exploratory Programming

If you don’t have time to master Lisp, Gawk might be a pretty good substitute….

(I found the link to the above article in the comments of an blog entry that really trashes poor RPG. Just reading through it I noticed a lot people love to make lame complaints about languages they know nothing about. Whether its Lisp or RPG, most of the things people get hung up on have either been addressed in the 20 years since the person last saw the language or that can be addressed by trivial modifications to a text editor. Anyways, old school RPG’s “program cycle” is very similar to the basic premise of gawk– sans most of the more lispy features, of course. RPG’s tight integration to the OS is is also very similar.)

The Culture That Refused to Sell Itself

August 8, 2007

If you can’t lighten up a little, then you won’t want to read this. If you can’t just pull up a chair, relax a little, and take that chip up there on your shoulder and set it aside for a while, then you might as well move along. If you already know everything, then you won’t learn anything new here. If you’re happy with your current computing platform, then you won’t want to read this. I insult just about all of them at some point, and if you can’t handle that, then you probably should just run along and find some like-minded people you can hang out with and feel all superior-like with. If you think you and your buddies are the end all be all of cyber-ninjitsu, then you won’t want to waste your time here. And if you have no sympathy for all the voiceless masses of people that don’t really care about your little private holy war, then you really won’t get anything out of this.

This is another rambling and poorly written blog entry that will no doubt cause many a cyber-pundit to bemoan the growing dilution of the web. Grow up guys. Just down mod this puppy, delete it from your news reader, and/or close your browser. You should savvy enough by now to write a decent search string on Google that can help you avoid this stuff. Do yourself a favor and wire up a hot key to help you keep on moving the first moment you detect that you’re reading a less-than-useful post.


Part I: An Optional Section Meant to Establish a Tone of Mild Alienation and Evoke Images of Contrasting Sales Techniques Against a Backdrop of the Unplanned Sprawling Landscapes that Evolve in a Mass of Independent Actions that are Randomly Impacting Each Other and Constantly Interacting

So I’m in Houston. People here pick up that I’m from out of town and they ask what brings me out this way… and the answer is, “business.” I used to be a bit more specific when I answered, but I quickly realized that no one really cares about the geeky stuff I’m out here to do. They just need a good non-answer so that they don’t have to think anymore. It’s one of those social protocols geeks like me just barely tolerate. But this town really is amazing. You get off the plane and get into your rental car… and roll out on the Sam Houston Toll Way. What a road! It’s like something out of a Dr Seuss book. You cruise along and wonder about all the people that are just blowing past you and then look down at the dash and realize you’re going 90 miles an hour. And Westheimer is the strip mall that just won’t stop. If you miss the turn for the Borders or Barnes and Noble just keep going. There’ll be another one in fifteen minutes or so. I counted 5 within forty minutes of each other. Crazy.

It didn’t take long for me to get off on the wrong foot here. I stop into a restaurant hoping for Mexican food better than the stuff back home. The waiters all look like they’re in the mafia or something– hair all slicked back… and very urban. “What would you like to drink sir?” I ask for sweet tea. “We don’t have sweet tea.” You don’t have sweet tea?! Sheesh, am I below the Mason Dixon line or not? What is your problem, people? I should retroactively revoke your status as a former member of the Confederacy. I know you guys had to march through the night– some without any shoes– to fight yankees all day at Antietam (without any breakfast!), but what have you done for us lately? You can’t even have some sweet tea for us when we get to town?

Okay Houston, I might let you off the hook this time. (You’ve got a great all-eighties station in town here, so I’m in a better mood than I would be otherwise.) But the Mexican food is terrible. I mean it. The store-bought chips they give you are so blah… and you get two types of “salsa” to go with them: red puree and green slime. (There’s nothing like a real fresh salsa with cilantro, home grown tomatoes, and colored peppers….) One place had a cheese covered puff ball that sounded interesting enough, but when I get it it’s some sort of spherical tostada chip smothered in Velveeta cheese. It had to be the grossest thing I’ve ever ordered. I really had my hopes up that being this close to Mexico would make it all better, but so far it’s just cheap ingredients (that I can get at any grocery store back home) shuffled together carelessly. Restaurants in general are just crappy around here. Quality is lower, service is poorer, and prices are often absurd.

But the Galleria, now… that’s something else. It’s the nth largest mall in the world and one of the n wonders of Texas. Amazing. Yeah, it’s got mostly shops selling expensive stuff for the really happening type people who think cool thoughts and do cool things and hang out with cool people, but yeah you’ve got to see it anyway. It’s even got an ice rink inside. And if you missed that Borders book store while coming in on Westheimer you can just go to the one there in the mall. (I finally got to see an iPhone there at the Macintosh store. Wow. This would be the first hand held gadget in twenty years that actually looked like it could do something useful. You can actually read blogs and use Google Maps almost effortlessly on that thing. If they added one of those GPS directions-while-you-drive things to it I just might be interested.)

And isn’t it crazy that there’s no touristy type stuff around here? Sorry guys… I’m not interested in going to see an Astros game… or seeing drunk astronauts fight over their boyfriends. I looked through the brochures at my hotel and it seemed like most stuff you’d go to was hours away. Except for Bedrock City. Now that’s a pretty amazing place. It’s the world’s only comic shop that’s clean, orderly, and that’s staffed by friendly people that have bathed recently and that won’t insult you for buying stuff from them.

But yeah, so I’m at the Galleria walking past a kiosk with this short olive skinned girl with long curly hair– she’s got some kind of platter with samples on it. As I glance her way she instantly makes eye contact, smiles, and offers me her sample. Simpleton that I am, I’m thinking I’ll just take a piece and keep walking. “Smell it!” she exclaims as she shoves a piece of scented soap toward me. I’d thought at first that they were candies or something. “Here,” she says, “which one do you like better?” She has orange colored and green colored. “This one,” I say picking the lime-cucumber thingy. I really don’t want to be rude or anything so I figure I’ll just play along a little and then keep moving. “Here, let me wrap it up for you,” she says. Well… I’m not moving anywhere now. All forward momentum is gone now. She hands me a little wrapped sample and as I take it she says, “can I ask you something?”

Now that last trick is just about going too far. You see what she’s doing, right? Of course, you do. If I’m not taken in with the thinly veiled flirting then it’s going to be the feigned request for assistance that sucks me in. It would be rude to brush her off. So I let the hook dig in as she reels me in– I’m a “nice guy”, and who knows… she might have a technical problem. (I’m good at technical problems.) “Can I show you this?” She takes me to the side of the kiosk and grabs my hand. Now I really can’t get away. Just think of all the layers of social convention she’s turning against me. She’s friendly, personable, she’s done me a “favor”– never mind I probably didn’t need the free sample to begin with– and now she’s cornered me and she’s holding my hand. It would be rude to walk away when she’s implied a need for assistance… but to jerk my hand away from her and stomp off…. Sigh. There’s just no way out.

So then she starts buffing my thumbnail with a small finely grained sandpaper sponge thing. “You see those ridges there?” She asks in her exotic accent. “Where are you from,” I ask. “Israel.” “Oh wow, Israel. I love Israel. What part?” “I grew up near the sea of Galilee.” You’ve got to be impressed. All those thousands of years of amazing history in the middle east… the holocaust… the reestablishment of Israel as a nation… and it all culminates into this moment: a girl holding my hand, polishing my thumb nail and trying to sell me something. But alas, a discussion of history was not in her script. She continues on with her sales pitch and incredibly my thumbnail is suddenly as shiny as if it had nail polish on it. Wow!

So you’ve got the personal connection… the damsel in distress routine… the outright physical contact… a feigned interest in my personal life… and layers of social convention preventing my escape. Now throw in a trick bordering on magic… and it can be mine… for only fifty dollars. And at the mention of the price tag the spell is broken. “Uhm…” I burble as I try to escape. But that just leads to the high pressure sales coup de gras: “Lifetime guarantee; if you just call this number we send you replacements; blah blah blah.” I physically pull away now and try to mumble something to break things off. This culminates into outright pleading: “Here… you get two gifts for that price… you can give one to your wife and to your aunt…. I normally just surprise people with that after they buy, but for you I’m telling you now… but I can’t do that for you if you come back later….” “Look, ” I finally say, “I’ll think about it and if I’m interested I’ll drop by tomorrow.”

A few days later I saw another young girl attempting to initiate a similar routine on a balding guy in a business suit. What a smile she had for him! But he smirked and knew better than to bite on the “please accept my free gift” routine. Maybe I can be that good at brushing people off some day…. For now, I’m stuck with this irritating shiny thumb nail… I can’t wait for it to go away….

Yeah, so sales can be pretty irritating. That whole bit about pretending to be genuinely interested in a guy or needing help from a guy just to get him to listen to the pitch… now that’s low. But much worse than that are the businesses that don’t even bother with any kind of sales routine… or that go so far as to have a negative sales routine. It’s like that with restaurants for me. I’m not really going out for the food. I want to feel like I’m having an experience. It’s not just that the food has to be good or the steak has to be cooked like I want it… but I want to relax a bit, maybe have a waiter or waitress banter a bit… and certainly not to have to feel like a heel for asking for something that I really shouldn’t have to ask for. There was an Outback back home that my wife and I would go to on every single special occasion we could think of because everything was just right like that. The restaurants have been so bad in Houston for this sort of nebulous thing that I’m trying to describe that I’ve even lost my appetite and skipped several meals even though its own my company’s dime.

But I’m probably finicky about this whole restaurant thing. And the real reason I lost my appetite has to do with something else….

Part II: Another Optional Section Explicating the Dull Background Roar that is My Own Personal Experience in Software Development and that is Meant to Test the Patience of the Various Computer Cultures

But yeah, It’s pretty interesting to me observing good and bad salesmanship in action. It doesn’t manifest itself just in the telemarketing, spam, and brick-and-mortar shops with friendly service. Sometimes it takes place in the culture surrounding the product or service. And of course, culture here often implies not only a community of users, but a way of life and even a religion.

This is one of the things that Microsoft actually understands pretty well. Their products more or less look like they work out of the box… and yeah you’ll have to reboot your machine some, but you can get a tutorial or example file for just about anything that you’re likely to want to do. But in the real world with real projects and shifting requirements, the novice is bound to get into trouble. For me six years ago there was just about always a friendly person waiting online to clarify something or help pin down the correct syntax for something. Nine times out of ten, that person turned out to be an MVP.  (Or someone trying to become one….) There’s a ton of these guys cruising hang outs on the web throwing out lifelines to people. Some of the people getting help aren’t really programmers at all… and others just need a little extra nudge to get over a hurdle or two. But if you think about what just a few of these interactions accomplished… it easily resulted in my own purchase of a few thousand dollars in tools, books, and so forth. And it resulted in me pushing the adoption of key Microsoft platforms for several projects on the job. Microsoft does well to reward the efforts of the MVP’s and fly them out for special swag and get-togethers.

It didn’t take long before I was able to pitch in and handle some of the more common problems people would post on message boards and newsgroups. I tried to give back as much as I’d taken… and it was kind of fun, too. There’s sort of a nonstop geek competition going on. Somewhere in all of this I got a hankering to learn Perl. I was working through one of the O’Reilly books and couldn’t get get something to work. I posted a question on a board that I had frequently helped out on and got a response from a savvy Perl hacker in record time. He asked a couple of clarifying questions and I posted back that I was trying to get the code to run on a Windows box. “Oh,” he says, “… windows.” And I never again heard from him or any other Perl user. Instead I ended up learning C#.

In this scenario, Microsoft plays the part of the aggressively evangelistic come-as-you-are urban mega-church. But in fifteen seconds and one interaction, the Perl community transformed itself from being a group of really cool hackers that I admired and wanted to emulate… and suddenly they were playing the part of an ascetic holier-than-thou inbred rural congregation that actively turns away outsiders that are interested in their way of life. I don’t even have to post a question on a newsgroup to get that same feeling from the Emacs community. In my installation, if I select Spell Check Buffer from the Tools menu, I get the message “Searching for program: no such file or directory, ispell.” Nice, guys. That’s just a great way to say, “frak you” to every single Windows user that’s wondering what they’re missing by not having experienced the joy of Emacs. The Open Source zealots constantly insult the intelligence of Windows users… and I wonder… how many web pages will I have to google before I can configure this properly? I don’t care. You see people on the web proudly declaring that their blog entry was written in Emacs. Oh yeah! That’s a real selling point, man. I’m so impressed that your text editor works for uh… writing… text?! You have to advertise that? Give me a break. Maybe those rabid Open Source nuts wouldn’t have to tell so many to people to “RTFM” if their software just worked. Sheesh. I get tired of cleaning up after such brilliant genius-implementers collaborating in wonderful world of the bazaar. Why don’t we all just hold hands and skip through the daisies while singing praises to the clique of cranky long haired genius hackers that hate their own users more than they hate Microsoft! (Wait… my pills…. Hold on a sec….) And I used to wonder why Emacs came with a built-in psychiatrist. Really.

But this article really was written with Emacs, by the way. Seriously.

Now Linux is taking a good turn with the ubiquitous twenty dollar “everything you need to get started” magazines. And PCLinuxOS lets you try it without going through the hassle of setting up a dedicated box for it. But stuff like the Ubuntu bug page is just so pathetic where everyone’s going on about how they’re going to get more people to adopt Linux. After all the mean spirited and petty things I’ve heard from the Linux crowd, I’ve got to wonder… do they even have a clue what we do on Windows to get work done? And do they even care about making it possible to show us– us now– how to do it better on Linux? I wonder….

But it’s not like everything’s wonderful in the Windows community to begin with. I can’t remember the last time I met someone that genuinely loved using a Microsoft product. People use their stuff out of fear, as often as not. Or they use it only because it’s what “everyone else” is using. And they dread the next major upgrades and the service packs…. They dread having to learn yet another data access paradigm when the old one was pretty decent at getting the job done. If I was completely happy with Windows products I wouldn’t even be looking at the alternatives to begin with. Inter-operating Open Source products with MS stuff is a bad deal for Redmond: things that you tolerated in ignorance suck hard once you’ve gotten to see some really good software in action. SVN, for example, makes Source Safe and even Visual Studio look clunky and dangerous.  At the same time, it seems to get harder every day to keep up with and configure MS Development tools.

I was in love with Access for a while. It was a similar deal as the extreme loyalty you see in the FoxPro crowd. It’s nice to be able to build your applications from within the database itself. You could write functions in VB and then call them from inside your SQL queries. And the query builder and the report generator were just great. They just worked and they did what you needed to do and they actually helped you to get things done. Occasionally you’d have to do some wacked out things in the event routines, but for the typical stuff it was the cat’s meow. Today I have to do that sort of thing with Active Reports that connect to stored procedures in SQL Server. The report editor is far from being a first class citizen of the IDE’s I have to use… and while Enterprise Manager is often saner and more industrial strength than Access ever thought to be, its GUI is the pits. (And don’t get me started on the evils of the 2005 version!) It slings out modal forms at will and its just plain tedious to get around in it. On the other hand, it’s a pain to try to share your Access programs with anyone else… and using it on projects where people were trying to cut corners was a nightmare. Access really wasn’t meant to be a real application platform. It’s a personal desktop database that’s great for munging data around to get it to do what you want. (For example, by importing data from a variety of sources and establishing ODBC connections to several database tables from different places, I could write queries against all of that as if it was all in the same place.) I don’t use it anymore, and there’s things I tried to use it for that it might not have been completely appropriate for, but I rarely use any piece of software and think, “man… this is as easy to use as Access was.”

But anyway. I told you all of that to tell you this. Some computing cultures and products are like the really crappy restaurant… the one that’s not so clean. They make you wait forever and force you to ask them things that you shouldn’t have to ask for. You’re not really there for the food (or the tools/platform) but for the something else. (You can’t quite put your finger on it, but you know it when you’ve got it.) And they end up emulating the notoriously rude comic book store guy at every turn. But you already know all about this stuff. You’ve watched the flame wars on Slashdot. You’ve been on one side or the other of the Linux/Open Source/Microsoft/Macintosh divide at one time or another. Maybe you’ve been a perpetrator of or a victim of blatant nerd rage. But there’s one computing culture you may not know so much about… one that quietly perpetuates itself outside of the usual jeers and insults of the online warzone. And that’s what I want to describe to you.

(Dang, my shiny thumb nail is driving me crazy…. I hope it goes away soon. The girl said it would last two weeks, though….)

Part III: A Detailed Description of IBM’s Inept Marketing Practices That Is Meant To Look Bizarre When Compared With Everything Discussed in the Previous Sections and is Really What I Wanted To Tell You About In the First Place But That I Really Didn’t Think You Could Fully Appreciate Without Having the Preceding Sections to Set the Stage

So a new project came down the pipe. I was going to be doing some reporting and data conversion stuff that didn’t sound too different from any of the other jobs from the past several years. But this time I was going to be using an AS/400 for the back end database. At this point all I knew about the platform what that the DB2 on it had impossible to read field names for all of the columns in the database tables. Its like the machine had outlawed vowels or something. I’d heard dim rumors about the platform in the past. Medium to largish sized companies tended to have just one of these machines sitting in a back room somewhere. And they all came with the requisite balding/overweight old dude to tend it.

So I had to figure out how to work the thing. For some reason it just seemed next-to-impossible to find what I wanted to know on the internet. And the books I managed to get ahold of were lousy; they all appeared to be written by overly enthusiastic people that didn’t get out much and that had a penchant for bad analogies. I didn’t think I was going to get very far on my own– and my department had room in the budget for it– so I looked into finding some training.

I spent hours picking over the IBM web site. This has to be one of the worst web sites anywhere. I don’t see how they can convince anyone to run their site with Websphere what with the way they have it all set up: broken links, “you can’t get there from here” scenarios, etc. And if you look at what a Microsoft guy would call something, what an AS400 guy on the street would call something, and what IBM’s marketing guys and web spinners would call something, you’d see there’s practically no intersection.

So somehow I find my way to the course listings. The whole thing is a nightmare. You can search the catalogue, but its not clear what you need to be putting into your criteria. The course numbers mean nothing to me, and the descriptions mean only a bit more than that… but you have to click onto an inner tab to find out where and when the classes are being held– if they’re even scheduled at all. There’s a pretty simple SQL query that would return most of what I needed to know: Select c.CourseCode, c.CourseName, c.Description, s.ClassDate FROM Catalogue c INNER JOIN Schedule s ON c.CourseCode=s.ClassDate ORDER BY ClassDate. (On the AS400 the field names would all be capitalized and without vowels, by the way.) But such a view was nowhere to be found and I spent what seemed like forever digging through page after page of that maze of twisty passages and dead ends that is the IBM web presence. (These guys are really going out of their way to get me to check out Websphere. And yes, for those of you wearing blue business suits, that was sarcasm.) So I finally find a few courses that look interesting… and I’m sure I’ve missed something or misunderstood something…. I know about databases and SQL and all of that. I just need to learn how to do it the IBM way, right? But there just isn’t a roadmap for a guy like me….

Aggravated, I call IBM for assistance. The guy that picks up had to be the most bored person I’d ever talk to. It just sounded like every shred of personality and creativity and humanity had just been ground out of him. I ask him a few questions and get hardly any information out of him. Exasperated, I say, “look… these courses cost thousands of dollars… and I really want to learn this stuff… and you can’t even sell me on one?!” Normally you end up having to beat salespeople off with a stick…. How can it be this hard to get someone to try to sell me something?! Grudgingly, the guy says that he’ll have someone call me back to answer my questions in 72 hours. “You’ve got to be kidding me,” I’m thinking….

I keep fighting with the web site and make a couple more calls for additional information about similar issues but get pretty much the same routine. A few days later I get a call from one of their people. It’s someone that actually knows something this time. He amicably helps me pick out a couple of courses and I go sign up for them. But the automated on-line sign-up process explodes on me. I end up having to call IBM again. It turns out that the Customer Number I’m using is incorrect. My company has several of them. And the guy on the phone is stuck in a do loop asking me over and over again for a correct number. When I give him a number he has to have me verify the bill to address. If I say something like “I’m not so sure about that…” then the loop restarts with no other options or memory of previous exchanges. It’s like he has one of those old school program flow charts and he’s scared to death to be caught leaving it– he just can’t lighten up and be real even for a second. About the third or fourth time through the loop, I attempt a new strategy: the bald faced lie. “Can you verify the bill to address?” he asks. “Yes, oh yes… you will be rewarded handsomely, I guarantee it,” I say without even blinking. That final hurdle overcome, it seemed as if all was well.

But then over the next couple of days I start getting the calls from the rest of the people who were assigned to call me back. “Yep; everything’s great. I’m all set. Thanks for calling. Bu-bye.” I set up my flights on Expedia. And then a few days after that I get this email asking me if I was going to participate in this other course.

Other course?

Yeah, this other course turned out to be the one that was most pertinent to my job. And somehow I missed in all those web pages and and phone calls. Argh! “Yeah, of course I’ll sign up for it.” I know the drill. I pay $140 to reschedule my flight. Argh!

(Now, I know a lot of you out there are aggravated by the whole “Web 2.0” buzzword thing. But… some Amazon style public feedback on the courses and maybe an automated up-sell routine would have saved me a lot of time. Something along the lines of “65% of the people who signed up for course X also signed up for course Y. Sign up for both with this special discounted price! Buy a special Education Pack now and save even more!!” And yeah, you probably cringe every time you hear the word “folksonomy,” but maybe it would have been easier to find some of this stuff out if the little blobs of information were tagged by regular people somehow.)

I was pretty peeved at this point. Then a couple days later I get another email saying that the course I just signed up for might be canceled. Canceled? I just changed my flight!! These people are lucky that I’ve never been exposed to high quantities of gamma radiation…. Fortunately the course wasn’t canceled. So I packed my bags, got on the plane and headed out to Houston. And here I am!

Part IV: A Detailed Look at Some IBM Training Classes Along With Some Rambling Architectural Comments That Probably Aren’t Entirely Accurate

The training classes are held at C-TREC in the Galleria mall on Westheimer. They’re pretty nice facilities. Our instructor is used to having a real projector, but in our classroom each team had a large monitor that showed what the instructor was looking at. He turned to point at the wall a couple of times before grudgingly wiggling the mouse for us. This doesn’t quite have the same effect in terms of expressiveness and rhetorical punctuation….

I’ve never been in training classes like this before. It always seemed like a scam or something. But if your boss is paying it can be a nice change of scene and a chance to absorb some new ideas when you’re not under the gun, going through trial-by-fire, or being thrown to the dogs. Just one thing, though: that hot chick you see in the advertisements and course materials… she isn’t there. She’s just a model, okay? (Actually, she might be across the hall taking the Power Point class, but there’s no way a techie like you could ever have any respect for someone taking a class on Power Point so don’t you even think about even trying to talk to her.)

C-TREC provides lotsa free donuts. They aren’t Krispy Kremes, but they’ll do in a pinch. And classes generally have short breaks every hour or two so you get a chance to mix it up with the other geeks. I introduced myself to this guy getting some coffee and asked him what class he was in. This guy was such a geek, that his brain must have worked just like a compiler for a strongly typed language. All he could do was stare back at me blankly and say, “I’m an instructor, actually.” I waited for him to tell me what class he was teaching, but he’s just so hung up on this minor correction of my syntax that he couldn’t move on and just have a conversation. I backed away slowly in fear that he might start waving his arms and yelling, “DOES NOT COMPUTE! DOES NOT COMPUTE!”

Back in class the next day, I have a similar experience with my teammate. I’m trying to log into the system and I ask him what the password was to get in. In a bizarre mixture of precision and annoyance he says, “if you didn’t change it, the password is xyzzy.” Spoken like a true engineer. Sounds like he’s been burned a few times in the past by making even the slightest assumption when answering a user’s question. It’s like, if he actually assumes that his users are not idiots… and then it turns out that they really were doing something idiotic… it doesn’t matter. The fact that he gave an answer that was technically incorrect by the slightest micron is grounds for having him tarred and feathered!

Yeah, so meeting these geeks from different backgrounds, different jobs, different platforms, different decades… it was clear that we deal with pretty much the same issues. The technical side of our work is just the fun part. The real work is in the people and the politics… and strangely, there are no course offerings on that subject….

Here’s the skinny on course OL370:

This course introduces SQL as if it was a hot new technology. From the average AS/400 user’s perspective, it is a hot new technology!! You see, Dr. Codd’s relational database model was pretty much rejected by IBM back in the seventies. IBM cooked up their own data definition file structure and/or language. A lot of users still use this older approach and are perfectly happy with it; and most of them are content to just get their jobs done and aren’t interested in being bullied into using the latest thing. So for them, SQL is this wow-gee-whiz kind of thing, strangely enough.

The pattern of the course is a series of lectures followed by a series of labs. Labs are done either with the STRSQL command (start interactive SQL session) on the green screen or with Java GUI iSeries Navigator (which is pretty much just like Enterprise Manager for SQLServer.) Now some people are required to use the green screen back at their old jobs. The reason for this is that many AS/400 shops implemented security at the GUI level via menus and so forth. Their database objects have no real security on them, so someone using Navigator can see and touch just about everything!

The green screen was pretty neat. For one thing, the ] character comes out as a sideways L that allows you to create negations in a highly unreadable manner. Very cool. While entering SQL commands, you have a nice easy-on-the-eyes display with pretty large characters. When you get a query result, the screen switches to another buffer with smaller chacters in columns that you can scroll in every direction via hot keys. Every screen is wired to accept function keys F1 to F24. You have to get good at thinking in base 12 to use them, but most screens will cue you as to the meaning of the most important ones. Each application can have a set of custom “hot commands” defined… usually a single letter attached to a text command and its requisite parameters. Unlike Emacs, these commands aren’t global, though. And unlike Unix where you have to just know what all the switches and stuff are for the commands, hitting F3 will take you to a screen listing all of the parameters with all of their defaults. This seems to be universal on the green screen applications. So green screens will tick off Unix people for being too slow and always reminding you of things… and it will tick of Windows people because it’s all keyboard driven and without any pretty interfaces.

Now most people taking this course have seen at least a little bit of SQL before. They can fake their way through a SELECT statement to get most of what they need to know. But many of them are mystified by UPDATE and INSERT and DELETE commands. SELECTS are nondestructive, so you can get away with iterating on those as much as you need. But those other three can cause sweeping changes when you execute them that you may not be able to “undo.” So you are forced to actually have a mental model of whats happening in order to execute them at all. And to get that model, you need to be able to move beyond a “spreadsheet-like” view of the world and start thinking three dimensionally… and relationally. And this is a tough hurdle for many people to overcome. Even people with programming experience can have a hard time with this because their tools have often trained them to think imperatively. What you need to do real SQL is to be able to think in terms of sets.

Unfortunately, the course does not address this core problem very well. I think nearly a third said they wanted to get into UPDATE queries when they were asked what they wanted to get out of the class. Update queries were tacked on quickly at the very end when the guys who were leaving early were scrambling to go catch their flights. The bulk of what you got in this class had to do with writing ever more sophisticated SELECT queries: grouping, aggregates, ordering, joins, subqueries, case, concatenation, casting, and so forth. All of this is important, no doubt… but I think this stuff should come after the class has gotten used to updating, inserting, and deleting. You need to get out of the way those howls of rage that come when you screw up a DELETE query. In fact, if you teach the neophyte SQL user anything, it should be how to recover from such a disaster or how to work against a “quick and dirty” copy to check that the SQL is right before running it against the real thing.

One thing I did pick up in the class was what the HAVING clause was for. I’m self-taught with SQL and I was in this class mainly to pick up on AS/400 related tools and paradigms. But I’ve never sat down and gone through SQL language in any kind of systematic way so I’ve learned it all on an as-needed basis. Now, one pattern that has recurred consistently of the years is the need to a summary/aggregate with a group by clause… but with an extra where clause on the end. To make this work, I might make a view with the grouping/aggregating in it… and then select from the view with a new where clause there. Alternately, I could use nested SQL or subselects to do the same thing. That repetitive pattern should have been a clue that I needed a better abstraction, and the HAVING clause is just that: it’s a where clause that runs against the result set generated by the SELECT/GROUP BY clauses that precede it. (Now if you learn LISP, you’ll be able to create such abstractions whenever you want. In this case, HAVING could be implemented with a macro that rewrites your query into the subselect version for you behind the scenes.)

Another cute trick I saw was with a special type of JOIN that is available on the DB2. The scenario is that you have a table of invoices in your system along with a table of invoice details. Then you have all of these processes running against invoices. Some of these are new untested code that’s being developed. In the course of developing this code on-the-fly… and weathering trouble from system failures and half-completed processes… you can end up with orphaned records: parent records without children and vice versa. So you need a way to identify the broken records. You typically do this with a LEFT JOIN and then a where clause that filters for all the NULLS where you have the non-existent records. That’s a pretty verbose way to ask for that, eh? Well… with an EXCEPTION join, you can get the same thing but with much more concise and readable code! (Again… this is a syntax issue that is easily addressed in any language with LISP style macros. But because your platform doesn’t support EXCEPTION joins or the ability to define them, you’re stuck writing hard to maintain code. Now if your application uses dynamic SQL generated from a LISP application….)

Now course OL380 threw me for a loop. You’re supposed to be doing embedded SQL and stored procedures in this one, right? Well… unlike the last course where everything was presented in both the green screen and/or the java GUI, this course was presented all from within the green screen. Graphical IDE’s exist, but the course did not even touch on them even tangentially! This is like signing up for training for a Microsoft product and then all of the course work and examples end up being done in Notepad or Emacs. Unbelievable!

This as much as anything else points to the fact that the IBM user community is frozen in some kind of metaphysical amber. The user base uses tools from the eighties well enough to do what they need to do– IBM has never broken backward compatibility so they can freely continue on that way as long as they like. This puts the MS culture in a bad light– there they’re always frenetically scrambling to pick up the latest thing from Redmond… and people are constantly trying to guess what the “next thing” is going to end up being. (Don’t you feel sorry for those poor bastards that thought that VSA was a good idea for their product?) But IBM, now…. their marketing and training and spin… all of it is geared towards they people they already have in their fold. It’s like they aren’t even trying to woo anyone away from any of the other computing camps. And if they do get anybody from outside to start picking things up… they’re so out of step with the rest of the development world that they don’t know how to explain things in terms that the outsider will care about. The unspoken message is that you somehow need to get hip to how bad it sucked being an RPGIII developer before you can get on board with the current ten-years-out-of-date “latest thing” that they haven’t even gotten their own users convinced they should use. For someone used to the constant and inescapable marketing that pours out from Microsoft, this sort of clumsy slow-reacting three toed sloth behavior is completely mystifying. No wonder Microsoft and Oracle were able to establish small (and not-so-small) empires in domains that IBM could have dominated had they adapted at all to the changing times!

Now the SQL class was pretty good from a tutorial standpoint. If we had to delve into the green screen side, all of the commands were pretty obvious based on the examples and the instruction. But in OL380… they just assume you know all the SQL and green screen commands by heart. Luckily, I worked with a partner that was somewhat more hip than myself, but it just seemed like a silly way to set up a course– why make a student play guessing games when the course should be set up to alleviate that sort of frustration?

Most of the work in this class was done in the SEU source editor with the RPG langauge. RPG is a position oriented language, so it matters where your characters are for them to do anything. You have line numbers down the left hand side and date-stamps running down the right hand side. While inside the file you can immediately tell what’s new and what’s changed when. You actually get a little more information on screen (and in a very readable/absorbable manner) than you would even with modern IDE’s and source code control. Nested ifs and loops are a bit hard to read, but you can switch to free form mode temporarily if you’re going to be doing a lot of that.

All of the examples on the slides were not free formatted at all. It’s as if IBM thought that this style would be more accessible than any other. From what I understand, the use of free form RPG is actually a bit controversial in some circles. But the more I look at this language the more it sinks in that it would work really good on a punch card rig. (Yep, those scary stories of programmers spilling their boxes of punched cards weren’t just dished out at you for color! It’s the foundational stage of iSeries culture.)

The data access code that we wrote was a bit different from the Microsoft DAO/ADO/ADO.Net approach. The iSeries platform has a fully integrated OS/database/runtime environment. This has all sorts of implications that I’ve not yet fully grasped, but it was interesting to see the RPG code picking up rows up data and plugging it directly into local variables. It’s strange looking, but concise in its own way. Your code doesn’t talk to the database through an object model, but rather your RPG language has SQL hardwired into it. In spite of this integration, you still see some of the dreaded SQL-statement-by-string-concatenation that looks like it could lead to a maintenance nightmare, but some of the features look passably useful if not entirely intriguing. The data access model is however cursor oriented and I heard nothing to indicate the existence of any access strategies that resemble the disconnected ADO.Net approach.

Back in the iSeries Navigator, we wrote a stored procedure that called some RPG code. It would kick out a file to the spool/queue/thing that you could review via the WRKSPLF command from the green screen or by double clicking an icon in the Navigator GUI. Not a bad trick. After all of the hubaloo that Microsoft raised about the stored procedures in the latest versions of their product being in the “language of your choice”, it’s kind of funny to find out that IBM has had that feature for longer than some MCSD’s have been born. As long as the language of your choice was COBOL or RPG….

Part V: A Short Conclusion That Is Supposed to Recapitulate Themes From all of the Previous Sections

The tools and techniques I saw were all geared toward getting a certain subset of business database applications done fast. The kind of dynamic adaptive programs that I want to write looked like they’d be at odds with the overriding culture and paradigm of the platform… if they were possible to do at all. On the other hand, there were some useful code reuse and separation strategies that are opened up by the newer ILE environment that I wish I could hear more about. But the people I met in these classes that use an iSeries day in and day out, they all love their machines. They love using them. They love depending on them. They can make the same “total cost of ownership” arguments that Windows users make against Linux advocates… but instead they can make them against Windows. They can make the same reliability arguments that Linux users make against Windows… but instead they can make them against Linux. (And even if they’re wrong about that last one, they can always run Linux on a separate partition….) They are completely confident that this is a knockout combination… the only missing ingredient is that IBM makes practically no effort to market their platform. Why is that?

It may be due to a little history over at Big Blue. Way back in the seventies IBM was being threatened by the government– much more serious than the piddly little Microsoft case we saw in the nineties. IBM really expected to get broken up. They spun off a mostly separate mid-range company just to be ready for such an event. They needed the group to do well enough to compete… but not take away from their mainframe business. So they placed all kinds of mean restrictions on them. Of course, technical people can work around such things. They came up with a punch card machine that was really a mini-mainframe in disguise. This steadily developed into more and more powerful computers. IBM wanted to consolidate all of their product lines in the eighties, but could not pull it off. The AS/400 came out of the ashes of that effort. So the iSeries is a computer that should never have existed in the first place and that IBM would have liked to have killed off on several occasions… and to this day the machine apparently has persisted on the fumes of the raw insistence of its user base.

And even stranger than that, there is no charismatic Paul Graham or Kenneth Getz to rise up and speak for this culture. There’s no brilliant and articulate visionary to inspire the user base and inculcate a conviction that the iSeries is the one true way of greatness in computing. This is both comforting and frightening at the same time. It’s a good indication because the users have this intense loyalty in spite of a lack of perpetual preaching and cheer-leading from some officially blessed authority. But on the other hand, a lot of the blogs and books I see have very much an amateur feel to them. It’s apparent that the dedicated “alpha users” aren’t necessarily the creme de la creme of the development community. The ambitious have gone off to Microsoft, the idealists are hacking on Linux, the brilliant are coding in Lisp or creating new start-ups… and what does that leave for the iSeries crowd? Mostly average people that just like getting their jobs done, I guess.

Anyways, I don’t know what to think just yet. It was a moderately strange experience getting this far. The iSeries represents a unique combination of benefits: some elements of a Linux type environment, some characteristics of an Emacs environment, some approaches of a late nineties Microsoft style of development, and some things that are completely different. I realize that it’s not as cool as say, an old school Lisp machine… but I really am interested in the possibilities that emerge from having the database and the operating system more or less fully integrated. (Ah well, let’s see how this next project goes….)

But for the iSeries to really take off, it’s going to take more than lower prices and nifty new Power6 chips. IBM is really going to have to work on its marketing skills. In the Macintosh commercials of the dumpy Microsoft business guy arguing with trendy Mac user, I’d hate to see what the archetypal iSeries user would be portrayed as. Linux advocates would like to see a classy and articulate hottie to represent their user base… but the way that IBM is pitching things, the iSeries folks would be lucky just to have an autistic idiot-savant lurching across the television screen. At any rate, those WebSphere dudes wandering around in their space suits are not it.