☑ This topic is solved.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 05-29-2023 05:20 AM
(1166 views)
Hi guys, may I know how should I write my codes to select multiple columns without listing the column names one by one?
Example
Proc sql;
Select
Country,
P1,
P2,
P3,
P4
From country_list;
I wish to have a shortcut like this
Proc sql;
Select
Country,
P1-P4
From country_list
Example
Proc sql;
Select
Country,
P1,
P2,
P3,
P4
From country_list;
I wish to have a shortcut like this
Proc sql;
Select
Country,
P1-P4
From country_list
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ChrisWoo,
There are no variable lists in PROC SQL, but in most cases you can use dataset options which support variable lists:
proc sql;
select *
from country_list(keep=country p1-p4);
quit;
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ChrisWoo,
There are no variable lists in PROC SQL, but in most cases you can use dataset options which support variable lists:
proc sql;
select *
from country_list(keep=country p1-p4);
quit;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
i see. Thx