Page 1 of 1

Use of Value label to fill another Var without input

Posted: September 12th, 2014, 4:30 am
by ikwamena
Can you help me with this situation, Var A1 have value set - west=1, east=2, north=3 & south=4 i want a situation that if you pick option 1 in the A1 var then var A2 will be filled automatically as "West" without input.

Re: Use of Value label to fill another Var without input

Posted: September 14th, 2014, 2:48 am
by khurshid.arshad
Dear ikwamena

Option One

Code: Select all

PROC V1
If $=1 then
V2=1;
skip to V3;
else
endif;
Option Two

Code: Select all

Proc V2
Preproc
if V1=1 then
$=1
skip to V3;
else
endif;
I hope this answer will helpout.
a.

Re: Use of Value label to fill another Var without input

Posted: September 14th, 2014, 8:05 am
by ikwamena
Thanks very much for the help, but I want to show the value set label instead of the assigned code.
For instance if V1 option West=1 is selected, then I want V2="West" not V2=1.
I tried getlabel and write function, am not able to get want I want.

Re: Use of Value label to fill another Var without input

Posted: September 14th, 2014, 8:55 am
by shafique arif
Try this.


Option 1:

In V1 write:
Postproc
V2=getlabel (V1_VS1, V1);
skip to V3;


Option 2:
in V2 write:

preproc

$=getlabel (V1_VS1, V1);

Note: V2 must be alphnumerics with length atleast 5.