RPGIV @ Work

A unique site for RPG and System i Lovers

Welcome!

Hi, this site will provide all what you need in System i and RPG developments.

My Name is Chamara Withanachchi, System i Expert and RPG Developer. And in the field for last 11 years.

I hope you will find lot of valuable information from this site

Get Commitment Status Using QTNRCMTI API Print E-mail
User Rating: / 0
PoorBest 
Written by Chamara Withanachchi   
       // Data Structures
       // ----------------------------------------------------------------------
       Dcl-DS comStatus;
         byteReturned Int(10:0);
         byteAvailable Int(10:0);
         commitStatus Char(1);
       End-DS;

       Dcl-DS APIError;
         byteProvided Int(10:0);
         eByteAvailable Int(10:0);
         exceptionID Char(7);
         recerved Char(1);
         exceptData Char(100);
       End-DS;

       Dcl-S wCmd Char(110);
       Dcl-S wCmdLen Packed(15:5);
       Dcl-S wLenRcvVar Int(10:0);
       Dcl-S wFormatName Char(8);

       Dcl-PR callCLCmd ExtPgm('QCMDEXC');
         Dcl-Parm cmd Char(110);
         Dcl-Parm cmdLen Packed(15:5);
       End-PR;

       Dcl-PR callCommitStsAPI ExtPgm('QTNRCMTI');
         Dcl-Parm pComStatus Like(comStatus);
         Dcl-Parm comLen Int(10:0);
         Dcl-Parm pFormatName Like(wFormatName);
         Dcl-Parm pAPIError Like(APIError);
       End-PR;

       wFormatName = 'CMTI0100';
       wLenRcvVar = %Len(comStatus);
       wCmd = 'STRCMTCTL LCKLVL(*ALL) CMTSCOPE(*JOB)';
       wCmdLen = %len(%trim(wCmd));
       callCLCmd(wCmd : wCmdLen);

       callCommitStsAPI(comStatus : wLenRcvVar : wFormatName : APIError);

       wCmd = 'ENDCMTCTL';
       wCmdLen = %len(%trim(wCmd));
       callCLCmd(wCmd : wCmdLen);

       callCommitStsAPI(comStatus : wLenRcvVar : wFormatName : APIError);

       *INlr = *on; 

User Comments

Please login or register to add comments

Next>