Rational Developer for System z
PL/I for Windows, Version 8.0, Programming Guide

Example with optimal code but no meaningful names

   dcl  x  bit(8) aligned;

   select( x );
     when( '01'b4 )
         .
         .
         .
     when( '02'b4 )
         .
         .
         .
     when( '03'b4 )
         .
         .
         .
   end;
Example with meaningful names but not optimal code
   dcl (  a1  init( '01'b4)
         ,a2  init( '02'b4)
         ,a3  init( '03'b4)
         ,a4  init( '04'b4)
         ,a5  init( '05'b4)
       ) bit(8) aligned static nonassignable;

   dcl  x  bit(8) aligned;

   select( x );
     when( a1 )
         .
         .
         .
     when( a2 )
         .
         .
         .
     when( a3 )
         .
         .
         .
   end;
Example with optimal code AND meaningful names
   dcl (  a1  value( '01'b4)
         ,a2  value( '02'b4)
         ,a3  value( '03'b4)
         ,a4  value( '04'b4)
         ,a5  value( '05'b4)
       ) bit(8);

   dcl  x  bit(8) aligned;

   select( x );
     when( a1 )
         .
         .
         .
     when( a2 )
         .
         .
         .
     when( a3 )
         .
         .
         .
   end;

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)