Thursday, September 18, 2014

IBM i 7.1 TR6 and TR7 Redbook updated

The IBM Redbook titled IBM i Technical Overview with Technology Refresh was updated on September 12, as it approaches its planned publishing date of October 31 2014. The Redbook covers last year’s Technology Refresh 6 and 7 (TR6 and TR 7). You can download it here. It is a big book of 952 pages.

I thought it would be useful to accompany this with IBM i chief architect Steve Will's overview of these Techincal Refreshes.

Technology Refresh 8 (TR8) for IBM i 7.1 was released in April 2014, and I am hearing that Technology Refresh 9 (TR9) is "coming soon". We will have to wait for a Redbook about them.

Wednesday, September 17, 2014

Use QTEMP for your work files

rpg extfile extdesc rename qtemp

This post is inspired by a situation that I encountered a couple of weeks ago that left me flabbergasted. It started with a phone call from a department head complaining that another department was eating into his department's time to run a report. At first I was confused, and after talking to three department heads I discovered that each one has a time they can run this report. Department A can run the report with any selection criteria they desire from 8:00 – 8:59 AM, Department B can do the same from 9:00 – 9:59 AM, and Department C from 10:00 – 10:59 AM. Anyone can run the report in the afternoon, but only after calling the other departments to make sure they are not running the report at the same time.

Why was this an issue? In this job the programmer who had created it used a work file that was in a production library. Therefore, only one person could run the report at a time to ensure that only one department's data was included in the report. If two people ran the report at the same time the work file could contain mixed data from both jobs. I also found that when the job completed the work file was not cleared, still containing all of the data from the last run, wasting disk space.

The programmer who created these programs has retired so I was not able to ask the question I wanted to: Why?

Looking at library list for the jobs from this application I found that QTEMP was in the library below all of the production libraries. Could this be the reason why?

Wednesday, September 10, 2014

Accessing multiple member files in SQL

How to handle multi-member files using create alias and drop alias

I was recently asked the following question, via Facebook:

How we can read a particular member of physical file thru SQL EXEC in RPGLESQL program ?

Others suggested using "Override with Data Base File" (OVRDBF) command, which could be used. But there is a way to do this just in SQL.

Thursday, September 4, 2014

Row and Column Access Contol Redbook now available

RCAC stands for "Row and Column Access Control", which is one of the features introduced in release 7.2 to DB2 for i (SQL).

Since the release announcement I have seen many questions asking what it is and how to implement it. IBM must have seen the same and have created a new Redbook called: Row and Column Access Support in DB2 for IBM i. You can download it here.

To accompany the release of the Redbook is this brief video of Mike Cain, one of the members of the DB2 for i Center of Excellence team, giving an overview of RCAC.

Wednesday, September 3, 2014

FTP i-to-i part 3

ftp program automate

In the past two posts about this subject I discussed how to manually copy files from one IBM i to another using FTP, File Transfer Protocol. In this post I am going to demonstrate how to create a program to start FTP, execute FTP subcommands, and then produce a printed log of what happened.

The program I will show is very simple and can be used for any types FTP subcommands. In this post I will use the example I discussed in Part 2, to copy a number of files from one library on QSRV1 to another library on QSRV2, and then call the program on QSRV2 to process the copied files.

Wednesday, August 27, 2014

FTP i-to-i part 2

ftp physical file from one IBM i to another

Having gone through a lot of the basics of using FTP, File Transfer Protocol, on an IBM i in the post FTP i-to-i part 1, in this post I will describe how I can transfer physical files, using FTP, to another instance of IBM i, whether it be another partition or another server.

In this scenario I have a job on QSRV1 that generates physical files that need to be transferred to QSRV2 to be processed. If this was a real job I would automate the FTP transfer, I will explain how to do it in Part 3. But in this post I am going describe how I would do it manually, one FTP subcommand at a time.

Wednesday, August 20, 2014

FTP i-to-i part 1

ftp get put quote rcmd

FTP, File Transfer Protocol, is probably the most widely used way to transfer objects between computers. It should come as no surprise to you that FTP has been available since the AS400 era.

I work in an environment with 11 IBM i partitions and servers, and I can spend a lot of time moving objects between. To move objects between partitions on the same server I use the SAVRSTOBJ and SAVRSTLIB commands. To move objects from one server to another, especially if they are in different geographical locations, I use FTP.

Why FTP rather than SNDNETF or SAVRSTOBJ? In my experience when moving very large amounts of data between servers it can be several hours quicker to FTP the file rather than use the other methods.

This post is going to first of several posts explaining how to FTP a file or files from one IBM i server to another. This method is not secure and I only do this within my company's network or while part of a VPN. I do not recommend doing this in an unsecure environment, i.e. over the internet while not being part of a VPN, as it can be "sniffed" and the data compromised. If you do want to send data via an unsecure environment then use SFTP, Secure FTP.