Wednesday, December 18, 2013

QCAPCMD another alternative to QCMDEXC

Several of you commented on Capturing QCMDEXC error codes that you preferred to use the C library function SYSTEM( ) or the API QCAPCMD.

I have to confess that I had not used the QCAPCMD API prior to writing this post. So after some playing around with it this is what I found out about using it:

Friday, December 13, 2013

IBM i VUG December presentation replay

VUG presentation db2 enhancement

The presentation given by IBM's IBM i Virtural User Group last Wednesday (December 11, 2013), called IBM i 7.1 TR7 DB2 Enhancements, can either viewed or downloaded below. I have to admit I was a bit disappointed there was not more on the conversion from DDS to SQL DDL.

The next VUG meeting is on Tuesday January 14, 2014, at 9:30 - 11:00 AM US Central Time, and is entitled Introduction to the IBM i Performance Data Investigator.

IBM Navigator for i has Performance tasks that includes many traditional i performance capabilities. It also has the ability to manage your performance data collections. The most exciting feature is the Investigate Data task, which provides the ability to graphically view your i performance data through a browser interface; Collection Services, Disk Watcher, Job Watcher, and Performance Explorer data can all be investigated through this interface. This session will go through all the capabilities of the Performance Data Investigator. You will learn how to look at your performance data through PDI, discover various IBM-supplied views of your performance data, and how you can use PDI for performance reporting.

To register for the GotoMeeting here.

You can convert this time to your time zone here.

Thursday, December 12, 2013

Easiest way to read all the members in a multiple member file

The idea for this post came from a discussion I saw on Facebook. Someone asked:

  1. In your RPG how can you read from a particular member of a file?
  2. By default which member is read?
  3. How can you read all the members of your PF in your RPG program?
  4. How can you find out which member is being read?

The answer for the first question is to use the EXTMBR in the File specifications. I will not go into details about this as it is covered in Useful keywords for your F-specs.

The answer for the second question is that when a program opens a file with more than one member, by default, it opens the first member, which is the oldest member as that was the one created first.

The third and fourth questions I combined into my own scenario: I want to have a program that reads all the members in a multi member file to find a particular record and identify which member this record is in.

Tuesday, December 10, 2013

SYSTEM( ) as an alternative to QCMDEXC

system qcmdexc error codes

After my post about Capturing QCMDEXC error codes Markus During sent me an alternative method to execute CL commands and retrieve any error message id that might occur.

system() is a runtime C library function that performs the same purpose as the QCMDEXC API. With system() you pass a pointer to the command string and it is executed, no need for the for the command string length.

Tuesday, December 3, 2013

Email IFS files

send ibmi as400 email sndsmtpemm

The subject matter of this post compliments the previous post Zipping files in the IFS, which describes how to copy a file to the IFS and zip it in preparation for sending it via email.

Until recently it was not possible to email a file from the IFS without using a third party tool or an API. There is the command SNDDST that I have used to send emails from an IBM i (AS400) with the contents of files or files located in the QDLS file system as attachments. But it cannot access the IFS.

A new command SNDSMTPEMM has been introduced, via PTF, to IBM i 6.1 and 7.1 that allows you to email a file from the IFS as an attachment.