File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change
1
+ /************************************************************************************************
2
+ PROC SQL, GET A FULLY QUALIFIED LIST OF ALL COLUMN NAMES FROM A SAS DATA SET
3
+ This program will print a list of all column names from a SAS data set suitable
4
+ for a SELECT col1, col2, ... clause
5
+ Keywords: PROC SQL
6
+ SAS Versions: SAS 9, SAS Viya
7
+ Documentation: https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=default&docsetId=sqlproc&docsetTarget=n0a693shdq473qn1svlwshfci9rg.htm#p134acmdl6qc9ln10ightascplv3
8
+ 1. The FEEDBACK will return qualified column names
9
+ 2. The NOEXEC will not execute the SELECT statement, but you still get the feedback
10
+ 3. Use an alias to get shorter names
11
+ ************************************************************************************************/
12
+
13
+ proc sql
14
+ FEEDBACK /* 1 */
15
+ NOEXEC /* 2 */
16
+ ;
17
+ select *
18
+ from sashelp .cars as c /* 3 */
19
+ ;
20
+ quit ;
Original file line number Diff line number Diff line change 36
36
read data
37
37
report
38
38
debug
39
- remove duplicates
40
-
41
-
42
-
43
-
39
+ remove duplicates
You can’t perform that action at this time.
0 commit comments