User Tools

Site Tools


rpg:bit_operation

Bit Operation

This is a demo program for the bitand built-in function.

      *---------------------------------------------------------------
      * Variablen
      *---------------------------------------------------------------
     D flags           S              2A   inz(x'0000')
     D flag            S              2A   inz(x'0800')
      /free
       flag = flags;
 
       if ( %bitand(flags : flag) = x'0800' );
         dsply 'yes';
       else;
         dsply 'no';
       endif;
 
       *inlr = *on;
       return;
      /end-free
rpg/bit_operation.txt · Last modified: 2013/06/20 07:00 (external edit)