Help using Base SAS procedures

how to ready a bunch of variables similar but ended by different letter

Reply
Occasional Contributor
Posts: 18

how to ready a bunch of variables similar but ended by different letter

I have a dataset with 2 wave survey info, for example
var1a var1b var1c var2a var2b var2c

number tells you which wave the variable comes from
last letter differentiates the variables.

If I want to subset variables from wave 2,
I am not allowed to do like following, instead I have to list every one.
proc means;
var var2a-var2c;
run;

Urgent advice needed. Many thanks.
Super Contributor
Super Contributor
Posts: 3,174

Re: how to ready a bunch of variables similar but ended by different letter

It would be most useful if you would share your SASLOG output to explain your problem, for assistance. Also, info about your data-points would be useful as well.

Scott Barry
SBBWorks, Inc.
Super Contributor
Posts: 260

Re: how to ready a bunch of variables similar but ended by different letter

Hi Jenn.
You can use this shortcut : VAR var2: ; which stands for 'all variables having their name beginning with "VAR2" '.
Regards
Olivier
Occasional Contributor
Posts: 18

Re: how to ready a bunch of variables similar but ended by different letter

thanks. that is a great help.
Ask a Question
Discussion stats
  • 3 replies
  • 115 views
  • 0 likes
  • 3 in conversation