Posted By

sarathannapareddy on 04/07/09


Tagged

data open functions variable exists null call dataset symput VARNUM


Versions (?)

Hoe to check if the variable exsits in the dataset or not


 / Published in: SAS
 

URL: http://studysas.blogspot.com/2009/04/how-to-check-if-variable-exists-in-sas.html

In SAS sometimes, we need to check whether the variable is exist in the dataset or not, we usually run the proc contents program and physically check if the variable exist in the dataset or not.

If we want to check it programmatically, then use the following code....

Sample dataset:...

data null; dset=open('old'); check=varnum(dset,'SCORE4'); call symput('chk',check); run;

%put &chk;

  1. www.studysas.blogspot.com

Report this snippet  

You need to login to post a comment.