SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Variable labels in put statements

Reply
Frequent Learner
Posts: 1

Variable labels in put statements

Hi,

 

I am creating a cleaning program for a dataset, and I would like to put the variable label instead of the variable name in my put statement without having to type each one individually.  

 

What I currently have is:

if varname=. then put id= varname="Missing value";

 

What I want is:

if varname=. then put idvarlabel="Missing value";

 

 

Can someone please assist?

 

Thanks in advance!!

 

 

Super User
Posts: 19,080

Re: Variable labels in put statements

[ Edited ]

Try using the VLABEL function?

 

 

x=vlabel(varname);
if varname=. then put id= x="Missing value";

RS93 wrote:

Hi,

 

I am creating a cleaning program for a dataset, and I would like to put the variable label instead of the variable name in my put statement without having to type each one individually.  

 

What I currently have is:

if varname=. then put id= varname="Missing value";

 

What I want is:

if varname=. then put idvarlabel="Missing value";

 

 

Can someone please assist?

 

Thanks in advance!!

 

 



 

Ask a Question
Discussion stats
  • 1 reply
  • 117 views
  • 0 likes
  • 2 in conversation