DATA Step, Macro, Functions and more

Create column names w/ seq no in Proc sql

Reply
Occasional Contributor
Posts: 12

Create column names w/ seq no in Proc sql

[ Edited ]

Hi,

I need to create variables in a sequence like var1,var2,var3... and write the values inside that variables using proc sql.

can anyone help me out with this.

 

Thanks,

sabharish

Super User
Posts: 17,907

Re: Proc sql


Sabharish wrote:

can anyone help me out with this.

 


Not with the information provided. Please explain your problem in detail. Also, justify the need for SQL. 

SQL doesn't support variable lists so a data step is easier. 

Super User
Posts: 9,687

Re: Proc sql


proc sql;
create table have (
 var1 num,
 var2 num,
 var3 num
);

insert into have
 values(1,1,1)
 values(2,2,2);

quit;

Ask a Question
Discussion stats
  • 2 replies
  • 236 views
  • 0 likes
  • 3 in conversation