[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Odp: EIS/Map object - change analysis variable
From:       Wojciech Sypko <w.sypko () PZUZYCIE ! COM ! PL>
Date:       1998-06-30 15:24:23
[Download RAW message or body]



>Can somebody give me a hint how to change the analysis variable with
>the map object?
>I tried _CHANGE_ANALYSIS_ from the EMDDB_M class like with a MDR but
>this methods results in an error (SIZE and COLOR variable are
>unknown).


Hello,

my first try was the same - and was no good, too.
The clue is the fact, that in map you must make your changes
in viewer, not in model. This is only one (known to me)
exception in dynamic changes of analitical vars.
The second thing - any changes must be done in POSTINIT,
but with BEFORE option - because if the viewer object
is builded, then making any changes is rather difficult -
you must manually rebuild whole object.

We will use the list APPLIST (global var), wchich 
contains all definitions we need.

So, here is the code:

/* handle to APPLLIST */
  length APPLLIST  8;

/* sample definition of new analysis var */
  NewVar   = 'Price';
  NewLabel = 'Price of something...';

/* a little orientation (don't remember delete it) */  
  call putlist( APPLLIST );

/* getting needed definitions */
/* in map is always only one anal var, named ANALYSIS1 */
  lDimL    = GetNItemL( APPLLIST, 'DIMENSIONS_L' );
  lAnalys1 = GetNItemL( lDimL,    'ANALYSIS1'    );
  lVar = GetItemL( lAnalys1, 1 );
  rc = SetNItemC( lVar, NewVar,   'VARNAME'  );
  rc = SetNItemC( lVar, NewLabel, 'VARLABEL' );
  Name = '';
  Name = NameItem( lAnalys1, 1, NewName );

If this is POSTINIT with BEFORE option, then it's all.
If you have more initializations in your code,
then you can turn on OVERRIDE option and add
after this code line:
call super ( _self_, _method_ );
which invokes original POSTINIT for you.

Don't forget, in this case, declare _method_ as follow:
length   _method_ $40 ;

And that's all. I hope, that I have helped you.

Wojtek Sypko 
(SAS user from Poland)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic