call label and vlabel

syntax:

call label(svar,namelabel);   namelabel=vlabel(svar);

example(http://support.sas.com/kb/24/664.html):

 

/* Create dummy data */
data one;
  input toy & $30. price type $;
  label toy='Hot Toys for 2000'
        price='Current Price'
        type='Regular or Sale Price';
datalines;
Tekno the Robotic Puppy  39.99  regular
Razor B1 Scooter  119.99  regular
Madeline Dollhouse  149.99  regular
Amazing Baby in Lavendar  36.99  sale
Kick and Play Piano  24.99  regular
;

data new;
  set one;

  /* Array of all character variables */
  array temp1 (*) _character_;

  /* Array of all numeric variables */
  array temp2 (*) _numeric_;

  length newlabel $40;

    /* For each element in the character array, assign its label */
    /* as the value of NEWLABEL, and output the observation      */
    do i=1 to dim(temp1);
      call label(temp1(i),newlabel);      /*newlabel=vlabel(temp1(i));*/
      output;
    end;

    /* For each element of the numeric array, assign its label as */
    /* the value of NEWLABEL, and output the observation          */
    do j=1 to dim(temp2);
      call label(temp2(j),newlabel);   /*newlabel=vlabel(temp2(j));*/
      output;
    end;
  stop;
  keep newlabel;
run;

proc print;
run;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值