Help using Base SAS procedures

PROC SQL COLUMN SEQUENCE

Reply
Regular Contributor
Posts: 157

PROC SQL COLUMN SEQUENCE

Hi,

If we have columns which are in sequence then how can we use it in select statement

For example

If i have id1-id24 then in proc sql how to use the sql statement

proc sql noprint;

create table test as

select id1-id24

from dummy;

quit;

i want to use some thing like that.Can any one let me know how can i use that in sql select statement.


PROC Star
Posts: 7,471

Re: PROC SQL COLUMN SEQUENCE

proc sql noprint;

create table test as

select *

from dummy (keep=id1-id24);

quit;

Regular Contributor
Posts: 157

Re: PROC SQL COLUMN SEQUENCE

Hi,

I am also having an inner join with other table and i am picking some other values as well in this table

instead of writing dumm1,dumm2,dumm3 i want to write like dumm1-dumm24 in sql.

proc sql

create table test as

select dumm1.info,dummy1.pro

dumm2.peter,dumm2.marta,dumm1-dumm24

from
dummy1 innre jon dummy2

on (dumm1=dumm2);

PROC Star
Posts: 7,471

Re: PROC SQL COLUMN SEQUENCE

Your proc sql statement has too many errors and ambiguities to show a correct example, but you can use select * and then, on the 2nd from the bottom line, add (keep=) statements after each filename.

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