In a table I have column headings of the dates of activity based on a SAS table that is always being updated. Is there a way to program a list table to display column headings no matter what they are called or how many there are?
When I create new list tables it always asks for the column headings, essentially hard-coding the names and number of the columns. I need a more polymorphic solution. Any ideas? Thanks in advance.
With "traditional" SAS (SAS9, Viya spre) you can simply use something like:
proc print data=<your table> noobs;
run;
If you want a report in Viya then you need up-to-date metadata objects for the table in CAS and for the Report.
You can dynamically update table metadata so it stays in synch with the physical table but I don't believe you can do something similar for report metadata (a report object). How could SAS "know" where a new column would need to be placed in a report and how to use it.
Changing table structures always cause challenges and additional coding work. Ideally re-arrange your data from wide to long and load this stable table structure into CAS for reporting.
Instead of a table structure like below...
...re-arrange your data prior to loading into CAS to...
With "traditional" SAS (SAS9, Viya spre) you can simply use something like:
proc print data=<your table> noobs;
run;
If you want a report in Viya then you need up-to-date metadata objects for the table in CAS and for the Report.
You can dynamically update table metadata so it stays in synch with the physical table but I don't believe you can do something similar for report metadata (a report object). How could SAS "know" where a new column would need to be placed in a report and how to use it.
Changing table structures always cause challenges and additional coding work. Ideally re-arrange your data from wide to long and load this stable table structure into CAS for reporting.
Instead of a table structure like below...
...re-arrange your data prior to loading into CAS to...
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.