.Sw set indicator width

Top  Previous  Next

This attribute controls the width printout for the set element entries that are YES and NO.  It is addressed using the syntax

 

Localfileidentifier.sw=number;

 

or in the example putex6.gms

 

my1.sw=12;

Example:

Using the example putex6.gms

 

set mine abcdefghijklmnopqrstuvwxyz

/a12345678901234567890  setaabcdefghijklmnopqrstuvwxyz

 b12345678901234567890  setbabcdefghijklmnopqrstuvwxyz

 small smallone/;

set small(mine) /small/;

loop(mine,

put 'start set element here $':0 mine(mine) '$ end here for name ' mine.tl /;)

put /;

loop(mine,

put 'start subset element here $':0 small(mine) '$ end here for name ' mine.tl /;)

put /;

 

where the items in orange are the sets for which we will put out element indicators and the blue items are statements causing those to be output into the put file.  In turn, when we run this with the default for .sw of 12 we get

 

start set element value here $         YES$ end here for name a12345678901

start set element value here $         YES$ end here for name b12345678901

start set element value here $         YES$ end here for name small

 

start subset element value here $          NO$ end here for name a12345678901

start subset element value here $          NO$ end here for name b12345678901

start subset element value here $         YES$ end here for name small

 

showing that by default a left padded 12 characters are always printed.  We could also reset to tw to 20 or 0 with the same effect as discussed for lw or tw above.