Reputation: 13
How can I use autocomplete in proc SQL queries?
For example, when I use proc print I can use autocomplete for libnames, tables and fields.
How can I do the same in proc SQL?
Thanks
Upvotes: 1
Views: 984
Reputation: 63424
In Enterprise Guide 5.1, you can autocomplete table names only in PROC SQL, as far as I can tell. So:
proc sql;
select * from sashelp.class
where age > 13;
quit;
When you started typing sashelp
it would not autocomplete for you, but when you start typing .class
it will (assuming your SAS session is connected, and you wait a bit for it to search the metadata - in my uses I almost always have to type the .
, then backspace over it, and type it again, for it to work properly). You also couldn't autocomplete age
.
In EG 7.1 (and not 6.1), you can also autocomplete the libname (sashelp
). The where clause however seems to still be not autocompleted. PROC SQL syntax is a bit more complex for the autocomplete parser to parse, so it's probably left out for that reason.
As Raphael notes in comments, ctrl+L
is the hotkey for Autocomplete Library; this works anywhere in an editor window (including in open code), so this would be a workaround for EG 5.1/6.1 not having this by default in PROC SQL
.
However, the key combination for Data Set Variable is ctrl+shift+V
, and this does not work in PROC SQL (but does work in Data Step, even in code that doesn't normally work this way). My guess is that SQL is harder to parse which dataset a variable is from, and SAS hasn't worked out this functionality yet.
Upvotes: 1