Use of Value label to fill another Var without input

Discussions about CSEntry
Post Reply
ikwamena
Posts: 11
Joined: July 17th, 2014, 2:08 pm

Use of Value label to fill another Var without input

Post 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.
khurshid.arshad
Posts: 572
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

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

Post 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.
ikwamena
Posts: 11
Joined: July 17th, 2014, 2:08 pm

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

Post 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.
shafique arif
Posts: 68
Joined: August 25th, 2013, 1:21 am

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

Post 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.
Post Reply