CHECK ACCESS TO MEMBERS FROM RDi

In general, RPG and COBOL programmers are not used to working under the control of an ALM (Application Lifecycle Management) or version management software. In the past I was lucky enough to use one of these products (it was Softlanding’s Turnover) and I must say that now that I no longer use it I miss it. Whatever the reason for this non-choice – money, laziness or simple ignorance – all RPG and COBOL programmers working in a team have the problem of allocating an origin member to prevent multiple people working on the same origin member by stomping their feet. Many got by creating a simple check-out command at home and modifying the STRSEU command to prevent the second programmer from accessing the origin member. But how do you get the same result from RDi? Years ago, with an RFE, I asked IBM to add some ‘exit points’ to be used to create a simple ALM at home, but of course IBM declined. I continued to investigate and finally I came to find that the communication between RDi and IBM i is the classic distributed data management (DDM), then it passes through the program specified in the DDMACC (DDM / DRDA request access) parameter of the network attributes, which can be set with the following command:

CHGNETA DDMACC (library / program)

The changes to this parameter are effective immediately and refer to the DDM and DRDA applications. Jobs currently running on the system do not use the new value, because the DDMACC value is accessed only when a job is started for the first time, so RDi must be disconnected and reconnected from the IBM i server. It is clear that such a solution can only be considered if development takes place on a dedicated server and not on the production server.

The program receives a parameter with some information – including user profile, library, source file, source member and type of request – and returns a flag which can take two values: * ON = request accepted; * OFF = request rejected.

Here is an example of a DDMACC program:

     ************************************************** *************************
     **
     ** Access request DDM / DRDA (DDMACC) command CHGNETA.
     **
     ************************************************** *************************

     H DFTACTGRP (* NO) ACTGRP (* CALLER) BNDDIR ('QC2LE')

     ************************************************** *************************
     **
     ** Fields
     **
     ************************************************** *************************

     DreturnCode S 1A
     Desito S 1A
     DmembroEditable S N

     ************************************************** *************************
     **
     ** Data structures
     **
     ************************************************** *************************

     DddmRequest DS QUALIFIED
     D input 1A
     D output 1A
     D update 1A
     D delete 1A
     Dvalues DS QUALIFIED
     D user 10A
     D application 10A
     D subApplication 10A
     D objectName 10A
     D objectLibrary 10A
     D member 10A
     D format 10A
     D length 5S 0
     D sourceRemoteLocation ...
     D 10A
     D sourceSystemName ...
     D 10A
     D other 2000A

     ************************************************** *************************
     **
     ** Constants
     **
     ************************************************** *************************

     DREQUEST_ACCEPTED ...
     D C * ON
     DREQUEST_REJECTED ...
     D C * OFF

     ************************************************** *************************
     **
     ** Parameters
     **
     ************************************************** *************************
     C * ENTRY PLIST
     C PARM returnCode
     C PARM values

     ************************************************** *************************
     **
     ** Main
     **
     ************************************************** *************************

       * INLR = * ON;
       returnCode = REQUEST_ACCEPTED;

       IF values.application <> '* DDM' OR values.subApplication <> 'OPEN';
         RETURN; // I'm not interested in the request: request accepted.
       ENDIF;

       IF values.member> = 'RSE0000000' AND values.member <= 'RSE9999999';
         RETURN; // Working members created by RDi.
       ENDIF;

       ddmRequest = values.other;

       IF ddmRequest.input = * ON;
         RETURN; // It's a read-only request: request accepted.
       ENDIF;

       // Enter the source member checkout check here.
       // For example, check that the source member is in the development library.

       IF values.objectLibrary = 'DEVELOPMENT'; 
         RETURN; // Request accepted.
       ENDIF;

       // If I get here the request is to be rejected.

       returnCode = REQUEST_REJECTED;

In the event of a request rejected in RDi, this somewhat cryptic message appears, so I recommend that you also notify the user with an email:

Related Posts
DB2 for i SQL – String Manipulation – POSSTR-LOCATE-LOCATE_IN_STRING (EN)

Introduction Often, in our applications, we need to work with text strings, and DB2 SQL can come in very useful Read more

DB2 for i – FAQ & Howtos (EN)

DB2 Database and SQL ... maybe the most important things on IBM i platform: here's a collection of FAQs, tips Read more

IBM i 7.4 Announcement (En)

Comes directly with the Easter egg this IBM announcement for the news of the IBM i 7.4 version, iNext version Read more

Generated Always Columns (EN)

Introduction "Generated Always Column": are columns, table fields, filled by DB2 engine: something like columns with a default value but Read more

View Comments

  • This is a terrific idea! I am designing an open source ALS (Turnover style change management system) and will incorporate this idea into it for RDi development and checkout. Nice one :)

Recent Posts

ACS Access Client Solution 1.1.9.5

Early April saw the release of the "Spring Version" of ACS Access Client Solution, version 1.1.9.5 Interesting new features especially…

19 hours ago

Tim Rowe and Scott Forstie for CEC 2024 – Milan

If the packed agenda of sessions at Common Europe Congress 2024, June 3-6 Milan, wasn't enough for you, here's another…

19 hours ago

Code for IBM i 2.10.0 – Debug IBM i App with Visual Studio Code

Debugging functions with Visual Studio Code have been available for some time but this new version 2.10.0 simplifies the handling…

3 days ago

ObjectConnect over TCP/IP

Two and a half years after my post Transferring objects with ObjectConnect and Enterprise Extender, I finally got around to…

4 days ago

SQL: SELECT with “superpowers”

With a little trick even a simple SELECT statement can execute any system command! Let's see how to do that...

5 months ago

NetServer for everyone – part 5

A mini-serial guide to configuring, managing, using, and troubleshooting the IBM i NetServer

1 year ago