BookmarkSubscribeRSS Feed
SAShole
Pyrite | Level 9

Hello SAS Community,

I'm using proc x11 to run a forecast on multiple areas. is there a way i can request specific tables for each area, with out typing out all areas?

For example, my current code looks something like this:

proc x11 data = have;

    monthly date = time_key;

    var   baton_rouge Cleveland    Connecticut;

    output out=want                            

               b1=baton_rouge_orig Cleveland_orig    Connecticut_orig   

               d11=baton_rouge_adj Cleveland_adj    Connecticut_adj;

run;

I tried using _all_ for the var statement and that worked but i can't figuire it out for specific tables

Thank you,

1 REPLY 1
udo_sas
SAS Employee

Hello -

You might consider reading all variable names into a macro variable and then run X11.

As an example (I'm not filtering out the DATE variable I know - but it might be a start):

%macro lst(dsn);

   %global x;

   %let x=;

   %let dsid=%sysfunc(open(&dsn));

   %let cnt=%sysfunc(attrn(&dsid,nvars));

   %do i = 1 %to &cnt;

      %let x=&x %sysfunc(varname(&dsid,&i));

   %end;

   %let rc=%sysfunc(close(&dsid));

%mend lst;

%lst(sashelp.workers)

proc x11 data=sashelp.workers noprint;

   monthly date=date;

   var &x;

   tables b1 d11;

   output out=out b1=&x d11=&x;

run;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1566 views
  • 3 likes
  • 2 in conversation