BookmarkSubscribeRSS Feed
JasonNC
Quartz | Level 8

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.


3 REPLIES 3
art297
Opal | Level 21

proc sql noprint;

create table test as

select *

from dummy (keep=id1-id24);

quit;

JasonNC
Quartz | Level 8

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);

art297
Opal | Level 21

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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1166 views
  • 0 likes
  • 2 in conversation