sj set indicator justification

Top  Previous  Next

This attribute controls the put file justification for the set element entries that are YES and NO.  It is addressed using the syntax

 

Localfileidentifier.sj=number;

 

or in the example putex9.gms

 

my1.sj=2;

 

where 1 is for right, 2 for left and 3 for center.

Example:

Using the example putex9.gms

 

set mine abcdefghijklmnopqrstuvwxyz

/a1  seta1

 b12345678901234567890  setbabcdefghijklmnopqrstuvwxyz

 small/;

set small(mine) smallone /small/;

loop(mine,

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

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 .sj of 1 we get

 

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

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 a1

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

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

 

showing the default flush right.  If we reset sj to 2 we get

 

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

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 a1

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

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

 

showing the left flush.  If we reset sj to 3 we get

 

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

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 a1

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

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

 

showing centering.