Is there any way to get the list of all columns in a project which are being used? Sashelp.vcolumn will give me all columns from certain tables, not only the ones i used in queries and programs.
Hello sasuser381 (creative name ;P),
if you use
proc contents data=TABLE_NAME; run;
you get the table (specified) column names and attributes... is this what you're looking for?
4 | EMP_BANDS | Char | 9 | $9. | EMP_BANDS |
2 | INCOME_BANDS | Char | 7 | $7. | INCOME_BANDS |
5 | INT_RATE_MARGIN_BANDS | Char | 18 | $18. | INT_RATE_MARGIN_BANDS |
1 | LOAN_BANDS | Char | 8 | $8. | LOAN_BANDS |
6 | Loan_Amount | Num | 8 | 18.2 | Loan Amount |
7 | N | Num | 8 | N |
Marlene
SASHELP.VCOLUMNS will only give you columns where libnames have been assigned, i.e. only if SAS Knows about the tables can it give the information. Some further information would be useful. What "project" - i.e. what software are you using. Do you have some sort of setup file?
I use SAS EG 7.1. and most of the project is done in query buliders or in a custom program. Can i get the list of all colums that are used in in, without running the project?
I don't believe so. This is a very good reason why you should document your whole process before even starting to code. No point trying to patch it up afterwards.
Run the whole project putting proc scaproc on before will get you all the inputs outputs, and the log will show what code is run. Have fun trying to patch it all together though, you will find out why documenting before even coding is required.
Not that I know of. And if you used any select * or SET it somewhat implies that you've used the entire data set. You can try PROC SCAPROC but I don't think it goes down to that level either.
@sasuser381 wrote:
Is there any way to get the list of all columns in a project which are being used? Sashelp.vcolumn will give me all columns from certain tables, not only the ones i used in queries and programs.
Maybe this is useful in what you want to achieve.
http://bi-notes.com/2012/10/sas-code-show-sas-macro-variables/
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.