Desktop productivity for business analysts and programmers

creating table

Not applicable
Posts: 1

creating table

I have a very simple question-

I need to create a table with around 600 variables that, for many, are in the form A1 A2 A3 etc. Is there a way to quickly create these variables other than typing them into the table through the GUI and once they are there, is there a way to kind of 'find and replace' or rename? ex: A1 becomes B1 etc.

Respected Advisor
Posts: 4,795

Re: creating table

Hi aabb

That's how you create the numeric vars A1-A600 and the character vars B1-B600;

data want;
array A {600};
array B {600} $10;
proc contents data=want short;

The renaming part you asked for would also be possible but needs a bit more programming.

Why do you need this renaming? It sounds a bit odd...

Regards, Patrick
Super User
Posts: 5,917

Re: creating table

You can use variable lists in the rename statement/data set option:

data rename;
set want(rename=(a1-a600 = c1-c600));

Data never sleeps
Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation