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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1162 views
  • 3 likes
  • 2 in conversation