How to delete first few rows from a file with IBM i SQL This morning I was working with a flatfile import from IFS into a DB2 database file. This should have been straight forward but the flat file contained several rows of crappy data at the start of the file. *ugh* Since I am

Read More

Let’s look at a quick little example RPG email validation program – SQLRPGLE ILE There are lots of code snippets, example programs, and long waffling discussions in internet land filled with pointy-headed AS400, Series, and IBM i programmer chaps (and chappettes) arguing about the best way to “validate an email address in RPG”. I know

Read More

Going for the Guinness Book of Records for vague blog titles I decided to waffle about inner joins and outer joins in the world of bellybuttons *cough* Structured Query Language. Since plagiarism is the best form of flattery, Chirag Sharma (over at Guru99) wrote a very nice article about the finer points of SQL INNER

Read More

Only Numpty Programmers hardcode library names #internetfact One of the mumbling, drooling, gray haired programmers on my team asked me to peer review his code this morning. This was for a simple SQL table to be created and promoted through multiple environments using TURNOVER. The code looked something like this: CREATE TABLE MYLIB/TESTSQL ( TSTFLD

Read More

IBM i Data Obfuscation – Making Data Foggy Murky and Squinty A little while ago, I wrote a data obfuscation tool – which I decided to call Data Fogging. This is specifically to solve the data privacy problems that we face when we want to suck down real data from production environments to our development

Read More

I found this wonderful article over at Midrange Blog It does exactly what I am trying to do: Lets me encrypt a certain field (column) in a table so that its encrypted as its added and updated. It also lets me automatically decrypt it when I read the record back (the only caveat is that

Read More

I recently updated the blog to use the very impressive THRIVE THEME called PRESSIVE. I love the SHOW IMAGE IN TITLE function on the blog pages. 90% of my blogs have a unique header image and I would like to go back and upate all (1k+) blogs to set this flag by default. Is there

Read More

IBM i SQL – Using SUBST A while ago I had a problem where I wanted to change the first two characters in a table and I used the very simple concat and subst operations to do it with SQL. Today, we had a slightly more complex requirement of updating text in the middle of

Read More

Using SQLRPGLE to Validate email addresses in IBM i Following on from my previous blog (basic email validation) I decided that it would much nicer to (a) have the regex stored in a data area so that we can easily play with it to try different validation scenarios and (b) lets have a shot at

Read More

AS400 hundred year date format I had to pull records from two files with a matching date value in each file. To make things interesting, the date on one file was stored in timestamp format and the date field in the other file was stored in hundred year date format. SQL (and QUERY400) can very

Read More

This week I be mainly…. working on a Casino System upgrade, dragging decades old code into the twenty first century. Old RPG3, RPG400, CLP programs and techniques using outdated OPNQRYF and QUERIES are fighting back tooth and nail. I love this schnizzle. 🙂 One of the techniques for upgrading/converting older QUERY400 reports to modern SQL

Read More

IBM i SQL to validate Email So, we have a customer master file that’s been around for years. Users have been keying in customer info and sometimes adding email addresses, sometimes not, sometimes entering nonsense, or even just text that says things like “this chap has no email so don’t email him”. Yes, it’s a

Read More