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;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1208 views
  • 3 likes
  • 2 in conversation