Hi,
I have a database. I want to create a macro-variable listing all the columns in my database.
I tried to do an sql proc. it does not work.
Result : %put &var_list.
Nom sexe classe_age Pond organe
data BDD_recod;
input Nom $ sexe $ classe_age $ Pond organe;
datalines;
Jean Masculin 0-4ans 10572.50 21
Marie Feminin 5-14ans 10572.50 2
Pierre Masculin 15-24ans 10572.5 0
J Feminin 0-4ans 10572.50 7
M Feminin 5-14ans 10572.50 6
Pe Masculin 0-4ans 10572.50 90
Je Masculin 15-24ans 10572.50 32
Ma Masculin 0-4ans 10572.50 2
Pire Feminin 25-30ans 10572.5 10
Mfir Feminin 35-40ans 10572.50 2.1
Pell Masculin 40-45ans 10572.50 4.53
Jeurs Masculin 15-24ans 10572.50 8
Mam Masculin 0-4ans 10572.50 56
Piress Feminin 15-24ans 10572.5 21.30
;
/*I tried this code*/
proc sql noprint;
select name into :var_list separated by ' '
from dictionary.columns
where libname = 'WORK' and memname = 'BDD_recod';
quit;
%put &var_list;
Can someone help me please.
Thanking you in advance.
Gick.
In the DICTIONARY tables, library and member names are all uppercase.
where libname = 'WORK' and memname = 'BDD_RECOD'
In the DICTIONARY tables, library and member names are all uppercase.
where libname = 'WORK' and memname = 'BDD_RECOD'
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.