MC Press Online

Wednesday, Jun 21st

Last updateTue, 20 Jun 2017 11am

You are here: Home ARTICLES Programming APIs

Programming / APIs

The API Corner: Moving Jobs Within and Across Job Queues

Let's look at what we can do with the Move Job API.

bruce viningWritten by Bruce Vining

Earlier this month, over on Midrange-L, Becky B. wrote in with this:

 

During month-end we have a large number of user-submitted jobs that automatically go to the QBATCH job queue and hold up other jobs. Is there a way to automatically redirect jobs to a different subsystem once they hit the job queue?

 

Included was a follow-on note explaining that management was hoping for a silver bullet so that they wouldn't have to change the programs submitting month-end jobs.

Read more ...

The API Corner: What Time Zone Do You Want That Date and Time In?

Today, we'll look at more uses for the Convert Date and Time Format API.

bruce viningWritten by Bruce Vining

Last month, in How Do You Want That Date and Time?, we used the first five parameters of the Convert Date and Time Format (QWCCVTDT) API to format a date and time value stored in a *DTS format to a YYYYMMDDHHMMSS format that's much friendlier to work with. This month, we'll look at the two optional parameter groups of the API. But first some background.

Read more ...

The API Corner: How Do You Want That Date and Time?

Have it the way you want it by using the Convert Date and Time Format API.

bruce viningWritten by Bruce Vining

Last month, in What's the Status of My Data Queue?, we used the Convert Date and Time Format (QWCCVTDT) API to format a date and time value stored in an internal format to a YYYYMMDDHHMMSS format much friendlier to work with, but we really didn't discuss how the API is used. This month, we'll look at some of the uses of QWCCVTDT.

 

The Convert Date and Time Format API converts date and time values from one format to another. For example, using the API you can:

Read more ...

The API Corner: What's the Status of My Data Queue?

Find out by using the Retrieve Data Queue APIs.

bruce viningWritten by Bruce Vining

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.

Read more ...

The API Corner: What Was the Change in This Record?

Let's discuss some things you should know about flexibly tracking field values.

bruce viningWritten by Bruce Vining

Last month, in So Just What Changed in This Record?, we saw how a program could identify by name each field that was changed by an update operation on a record. We accomplished this using the database trigger support of the IBM i along with the List Record Formats (QUSLRCD) and List Fields (QUSLFLD) APIs. This month, we'll extend that program to display not only the names of the fields changed, but also the original and new values of the field.

Read more ...

TechTip: Ruby Talks to DB2 for i

Using the ibm_db gem, we can easily communicate with DB2 for i directory from Ruby.

aaron bartellWritten by Aaron Bartell

In the article "Sinatra Sings, Ruby Plays," I introduced the Sinatra web framework , and we went through initial installation and a simple Hello World application. In this article, we will take that app further by introducing database access. Specifically, we will use the ibm_db gem to query a DB2 table named USERS and display the contents back to the web page.

Read more ...

The API Corner: So Just What Changed in This Record?

Learn about flexibly tracking field changes.

bruce viningWritten by Bruce Vining

On the IT Knowledge Exchange, Luissimon recently posted, "I need to get which field changed in a file, instead of writing multiple (IF this field changed THEN DO…) for each field in each file. I was wondering if I could use some tool in RPG for doing that?" While I can't say that I'm familiar with an RPG built-in to accomplish this, I can see how using a few system APIs within an RPG application program can meet this need.

Read more ...

The API Corner: Regaining Control in Your Program

It's easily done using the Register Call Stack Termination User Exit Procedure (CEERTX).

bruce viningWritten by Bruce Vining

Mark B. recently sent me a note asking if there was a way to perform some cleanup functions in his program when someone issues an ENDJOB command while his program is running. The answer, as you might expect, is "yes" and involves an API that actually covers more areas than just the ENDJOB command.

Read more ...