01 - Programming (EN)01d - Rational RDi and other tools (EN)

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:

About author

IBM i software developer

Leave a Reply

%d bloggers like this: