Thursday, February 20, 2014

EDI Invoicing

Another tough day ahead with EDI Invoicing. When the going gets tough the tough get going. We will overcome!

Monday, January 13, 2014

Welcome Aboard!

Today most excellent RPGLE programmer and good friend Rick Santiago starts as Senior Programmer/Analyst at Capitol Lighting.

Rick and I first met at GE Aircraft Engines back in 1996. Since then I have sub-contracted Rick to do my "heavy lifting" RPGLE programming at every job I have worked at. Every single one was a huge success.

At Pylon Manufacturing we created awesome "Pick to Pallet" process and modified BPCS order ingestion program to incorporate Extol EDI to automate inbound processing.

At Quipp Systems we created Payroll time tracking and really wild commissions program utilizing MAPICS.

At NanjingUSA Rick assisted in several projects which included implementation of S2K ERP and automated EDI process.

The next five years are going to be really exciting. We now work together at Capitol Lighting and sky is the limit. Capitol is dedicated to the IBMi and is looking to us to help integrate technology into operations as Capitol grows to 100 million dollar sales mark. This is a terrific challenge and opportunity for us and Capitol Lighting.

We are IBMi, watch us grow!


Tuesday, August 6, 2013

We're not in Kansas anymore....

Web Services, SOA, SOAP, HTTP, C++, WSDL, DISCO, Lions, Tigers and Bears. I’m used to diving into the deep end of the pool but after two days I think I have fallen into the Marianas Trench still waiting to hit bottom.

My current challenge is to send Name, Order and Email for new orders to LISTRAK Email Marketing Services utilizing API and SOAP formatted XML from our IBMi.

A little lite reading.....


If we are facing in the right direction, all we have to do is keep on walking.  ~Buddhist Saying

Monday, May 27, 2013

Whooohooo! IBMi V7R1 installed and working with no problems.

Good to be back and up to date, was at V5R4 and I was missing some of the enhancements that were in V6R1. I upgraded several machines three years ago to V6R1 and did not like going back and working with V5R4.

Since I am now essentially a one man IT shop (software/IBMi) and buried deep in fixing and supporting a failed ERP implementation I outsourced the upgrade to Source Data Products. Over the years I have done about 15 installs/upgrades but has never been my focus and it takes planning to do it right. I did not have the time to plan and do the upgrade myself.

Bob and Mark did a fantastic job. Bob from the standpoint of providing a price that could not be beat and Mark for performing a flawless upgrade. As a bonus he configured ASMI port. Now I have full remote control access to the IBMi. From a powered off status I can start machine without manual intervention at the CO-LO and see status of machine before IPL.

Total time for upgrade excluding software downloads and third party software upgrades was around 7 hours. One small bump with credit card processing software, they missed sending be the bulletin to change JAVA path. IBM changed the JAVA path to QOPNSYS which is where it should have been in the first place.

For under $3k Source Data Products cannot be beat. Now I have to quickly get up to speed with RDi Development Tools and V7R1 enhancements. Can't wait to utilize RUNSQL in CLLE, SDA and RLU in RDi.

Thursday, February 21, 2013

SQL Update a Multi-Table View using INSTEAD OF Triggers

Yesterday I added another SQL trick to my bag ‘o tricks. I am currently working on fixing EDI invoicing process and I needed a way to delete records from four files based on the same key. I could have wrote RPGLE Free Embedded SQL that would have been about 60 lines of code but wheres the fun in that.

I popped open the Google window and searched on “iseries sql delete from multiple tables”. the second hit directed me to IBM and the fourth to Preform the Impossible: Update a Multi-table View using INSTEAD OF Triggers. What did we did before Google, oh yeah, read a manual!

Impossible, that’s for me. It took me a few minutes to understand and a peek at IBM documentation I had to create a view and then the trigger. Once created any time I delete from the view all associated records in the four files are deleted. Very cool.

After view and trigger created I can run this SQL interactive or embedded.

delete from yourlib.ediinvw
where ihedoc = 0000046475

My new view is EDIINVW and I am deleting by EDI document control number.

To accomplish this I created the view with the below code using SQL Explorer.

create view yourlib.ediinvw as
select ih.ihedoc, id.idedoc, ss.iaedoc, si.isedoc
from yourlib.vedinih ih
join yourlib.vedinid id on id.idedoc = ih.ihedoc
join yourlib.vediniss ss on ss.iaedoc = ih.ihedoc
join yourlib.vedinis si on si.isedoc = ih.ihedoc

The four fields in the Select statement is the key field for each of the four files.

I then attempted to create the delete Trigger. SQL Explorer did not like the syntax so I copied and pasted into the green screen iSeries SQL interactive command line. My guess is that SQL Explorer has an issue with INSTEAD OF DELETE ON.

create trigger yourlib.ediinvdel
Instead of delete on yourlib.ediinvw
referencing old as EdiInvwOld
for each row mode DB2SQL
begin atomic
delete from yourlib.vedinih
where ihedoc = EdiInvwOld.ihedoc;
delete from yourlib.vedinid
where idedoc = EdiInvwOld.idedoc;
delete from yourlib.vedinid
where iaedoc = EdiInvwOld.iaedoc;
delete from yourlib.vedinid
where isedoc = EdiInvwOld.isedoc;

I learned another very cool SQL trick, Thanks IT JUNGLE and Four Hundred Guru. This will come in handy over the next few weeks as I fix the EDI processes.

Have your best day!


In programming, as in everything else, to be in error is to be reborn.  ~Alan J. Perlis

Thursday, February 14, 2013

iSeries SQL Update multiple columns

SQL is cool s**t..I love this stuff.... Below SQL uses file created from spreadsheet and updates the min and max fields in the item balance file from one field from uploaded spreadsheet. 

Spreadsheet fields VENDOR, VMFG, CAPITEM, LOC, MINMAX.

update b50files.vinitmb 
set (ifsmin,ifsmax) = (select minmax, minmax from rbryant.upminmax  
where ifcomp = 1 and ifloc = loc and ifitem = capitem) 
where exists (select * from rbryant.upminmax where ifcomp = 1 and ifloc = loc 
                                 and ifitem = capitem)


One man's crappy software is another man's full time job.  ~Jessica Gaston

Clean iSeries output queue by days to keep

It’s has been a fast six months, new job has kept me hopping. One day I’m redesigning the EDI guidelines and RPGLE programming interfaces to the next day chasing Purchase order suggestions. Tape backup failing without notification to GL year end posting to rewriting code replacing OPNQRYF with embedded SQL. Point of Sale hiccups to AP check failure to working with eCommerce. Every single modification that the previous software vendor implemented has a problem one way or the other.

Basically I have not been happier than any other point in my career!  

I ran across the need to automate purging old spool file records and could not find any code close enough to cut, paste, compile, run and free. In the past have used TAATOOL but is not currently an option.

My good buddy Rick Santiago has a purge out queue by date program that he wrote a while back. Short and sweet I quickly envision modifying for my needs.

Through iSeries navigator I created a table with four fields, out queue name, out queue library, number of days to keep spool file entries and user data. 

I also added the following key constraints, C_OUTQUE, C_OUTLIB and C_USRDTA as unique.

Follow your nose and instructions in the comments of the CL and you’ll have a quick little program you can add to your nightly process.

Hopefully this help some other poor one man band quickly solve a minor annoyance programmatically.

CLNOUTQ is the driver and CLNOUTQ2 exists due to only being able to use one RCVF in a CL in a read loop and detect end of file.




Try to discover
The road to success
And you'll seek but never find,
But blaze your own path
And the road to success
Will trail right behind.
~Robert Brault,