Blogs

What is an AS400 web-service?

  • Posted on: 1 July 2015
  • By: NickLitten

Web Services With Cobol Or RPG on IBM ISeries - Restful Php Web Services

1. Introduction

Web Services and SOAP (or REST) are rapidly becoming state-of-art architectural approaches to allow the access of multiplatform and multilanguage systems,

Many companies have legacy applications which represent a high investment and Web Services promise to allow their access from the web without extensive modifications.

2. An Introduction to Web Services

Web services consist of a group of standards intended to make it possible for diverse systems to communicate, without requiring a particular type of middleware, programming language or even operating system. They can be based on SOAP, REST or XML-RPC,.

SOAP is an open source message standard, based on an XML dictionary, that uses standard transport protocols widely used over the Internet such as HTML or SMTP. It represents a paradigm shift in the way applications communicate with each other, because it does not require any special middleware to allow diverse applications to communicate. The messages are text based and accessible by any application over the network. They are described by using a special XML based language called WSDL.

REST is a simpler type of Web Service where the user simply accesses a URL to obtain back an XML document without any standard specification.

Webservices and RPGLE - Converting Character to Numeric

  • Posted on: 17 June 2015
  • By: NickLitten
Srdhar Maheswar likes to type

I'm in the final stages of a fun project writing web-services to interface INFOR System21 (on an IBM i aka AS400) with ACSIS Visitrack (on Windows Server), we are consuming (receiving) and serving (sending) all data in a standard alphameric layout But... as any RPG programmer will know... the conversion between alpha to numeric is easy to overlook and can quickly bite you in the arse.

This morning, I had a long discussion with one of the technical analysts talking about the differences in data layout between the "web" world and the "IBM i" world. Out there in website land data flows around in nice alphabetical chunks. I mean, my name is simply "Nick" and the number sixty seven is simply "67" and two and a half is simply "2.5". But in the database world character can be fixed length "Nick      " or varying length "Nick%" and numerics are commonly stored as packed decimal data so 67 could be stored in a field that is 15,5p so would look like "000000000000067000".  It sounds complicated but if we keep our code clean its a simple process to switch between these formats. Lord Sridhar Maheswar - I promised to write a blog about this to make it clear... here it is  :)

Drums The Word - Website Version Two Point Oh!

  • Posted on: 14 June 2015
  • By: NickLitten
Robert Litten - rob the drummer
Over at DRUMS THE WORD a new kid is on the block; the new kid is the old kid, but with a new coat on.
 
The King is dead so long live the King!
 
Rob and I have been working together over the last six months, between him in Hampshire (England) and me in California (America) and now South Carolina... we've taken his seven year old Drupal website and been through a full Drupal upgrade, but after lots of review and ecommerce tests Rob decided it just wasn't for him. His artistic flair took my logical programmer brain and gave it a well deserved right hook.... So, other CMS were reviewed and finally the winner was WordPress and Woocomerce. The final result is pretty damn slick and I'm super proud of the website collaboration that Rob and I have created. Many bottles of wine have been consumed, many Skype conversations have (literally) spent all day in design, testing and website revamps to come up with a rather cool new website.
 
Drums the Word V2.0 is born
 

Website Cleanup - Delete Drupal Users who have no ubercart orders

  • Posted on: 11 June 2015
  • By: NickLitten
sql trips for drupal

Migrating Cousin Rob's www.DRUMSTHEWORD.com website from his 6 year old Drupal6 website to a new (hopefully sexier) Wordpress4 website has meant a lot fo data cleansing before golive. Before we get any comments about Drupal vs. Wordpress, or a CMS flamewar, the new website was chosen to be on Wordpress because of WOOCOMMERCE and a neat Wordpress Theme that had already been selected.

So, I'm going to leave a little blog about any particular problems I found, or cool tricks I found, during data migration.

The old drupal website had over 48,000 users defined... many of them spam... many of them dead... many redundant or no longer needed.

So how do we cleanup users?

Using the PHP panel I used this SQL script to select the users that have been registered but who have never ordered anything using Drupal6 Ubercart:

select count(*) from users where mail not in (select primary_email from uc_orders) and uid <> '0' and mail NOT LIKE "%drumstheword.com%" and mail NOT LIKE "%projex%"

note: do not touch uid=0 because this is the ANONYMOUS user and do not touch any *@drumstheword.com or *@projex.com users

this will give you a count value showing how many users are selected and if your ready to delete then just use:

You gotta get GIT - change management for RPGLE via the IFS

  • Posted on: 4 June 2015
  • By: NickLitten
git off that code you slack jawed larkey whistle box

Thanks to Mr Aaron Bartell (of Krengel Technologies) for this excellent article on using GIT for controlling source code changes on IBM i.

I've been doing this for a while on source code for PROJEX4i and have kept meening to write a little blog about it. Aaron's article nicely touches on the high level concepts of GIT, it's ease of use and nice documentation techniques. Perhaps I will follow this up with another blog talking about GITHUB and it's lovely windows GUI for GIT'ting things

<Article originally published via itjungle.com on 2/10/15>

In a previous article, we learned about Ruby methods and encapsulation. During the various exercises there were many code changes made and we didn't really have a simple way to keep track of how the code changed from one version to the next. That's where source change management (SCM) tools like git come into play and is what we will be diving into with this article.

Display, View, Debug IBM i Data Queues

  • Posted on: 20 May 2015
  • By: NickLitten

Data Queues are a common object type in many applications on IBM i Systems: They offer an easy way to queue up data to be read and processed. Easy to load, easy to read and an easy way to handle sequential data. The only thing that I really dont like about them is the tricky way you have to poke around in them to look at their contents. But, I found this neat article on that highlights some new IBM i *API's that change to the old way that data quees are handled... we can now retrieve data queue entries without removing them. Yay!

This allows us to peek at Data Queue contents without upseting programs that are processing the queue itself...

 

In the past month or so, I've received two requests related to accessing data queue (*DTAQ) information. The first request concerned finding out how many messages were currently on a *DTAQ and how long the oldest message had been on the queue. These questions, to me anyway, suggest a management application to periodically poll *DTAQs and determine whether they are backlogged and in need of additional readers to be started and/or are stuck for some reason, for instance an outstanding inquiry message.

 

Varying fields in DDS after SQL:

  • Posted on: 6 May 2015
  • By: NickLitten
I found this terrific article over at IT Jungle. It's an oldie but a goldie

 

Working with Varying-Length Database Fields

 

Hey, David:

We use a utility to replicate data files between our iSeries system and several SQL Server databases running on Windows 2000. When the original file definition comes from SQL Server, this utility creates varying-length character fields on our iSeries. This caused a problem in an RPG program when I forgot to set the length of the field when I changed its value. Do you know how much space we save when a field is varying-length? Also, what is the easiest way to determine and set the length of data in a varying-length field after changing the field's value? Our programs are ILE RPG, and we are on V5R1.

--Rob

 

AS400 Client Access is dead - long live IBM i Access and BETA software!

  • Posted on: 4 May 2015
  • By: NickLitten
beta iseries emulator

Ask any AS400 programmer, iSeries Developer or IBM i Nerd and they will all tell you that good old "Client Access" is a pain in the arse!

Client Access was introduced back in the hazy 1990s on the old AS400 for DOS Computers, it was marginly revamped for the launch of the iSeries some years later. Premillenium saw Client Access being focussed more on Windows computers and now a decade later, it's finally being totally rewritten for the modern world of IBM i systems and connecting from any platform you like -- "Yes" its all written in JAVA so we will finally have a mobile solution to connecting to our IBM i Server from anywhere at anytime.

I've been running the technology preview for the last 6 months and overall am very impressed.

It's pretty solid and the main 5250 green-screen emulator is a big improvement over the old green screen emulator.

IBM i Error Message of the day - CEE3201

  • Posted on: 15 April 2015
  • By: NickLitten

Yesterday, I wrote a little SQLRPGLE web-service program to retrieve Picking details from System21 Warehousing. Days like this I really enjoy my job. Writing new programs in RPG is just plain good old fashioned fun. It ran perfectly with the handful of test data that I had to play with. But today I am testing it and after signing into the Infor S21 ERP and generating some pick notes, I find that when I have a hundred or so pick lists. Call the webservice and the program is timing out with an unusual error message: IBM i Exception code CEE3201.

I've never seen CEE3201 before and it has a generic error code that proclaims Exception recursion detected.    

sqlrpgle webservice error

Message . . . . :   Exception recursion detected.                            

Cause . . . . . :   An unhandled exception occurred in an exception handler. 

Recovery  . . . :   Do not let an exception that occurs in your exception handler go unhandled.

Start Stop System21 Background Jobs (WHSE, GL, IN, OE - BACK3)

  • Posted on: 14 April 2015
  • By: NickLitten
L1017 Infor start stop application background jobs.png

This is just a memory jogger for me and while I was typing this in my notes I realized that someone else may have asked the same question: "How do I see the status of the System 21 (JBA/GEAC/INFOR) background jobs to see what is running?"

I feverishly search the interweb superhighway and apart from some mystical mumbo-jumbo from ten years ago on an old ASCII bulletin board nothing came to light. Luckily, during a meeting today one of my clients propellor heads told me the infor program that does the magic. The simple answer is "L1017 is the program that shows the status ofall the system21 background jobs and allows you to start and stop them"

Nice.

So, we can either goto menu /L1S (or L1SUS if American) in both the green screen and Infor Client or simply call the program from the command line:

s21 background

Pages